summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.dir-locals.el3
-rw-r--r--ChangeLog87
-rw-r--r--GNUmakefile8
-rw-r--r--Makefile.in111
-rw-r--r--README7
-rw-r--r--admin/ChangeLog48
-rw-r--r--admin/charsets/mule-charsets.el46
-rw-r--r--admin/grammars/Makefile.in113
-rw-r--r--admin/grammars/README11
-rw-r--r--admin/grammars/c.by10
-rw-r--r--admin/grammars/java-tags.wy5
-rw-r--r--admin/grammars/js.wy6
-rw-r--r--admin/grammars/python.wy8
-rw-r--r--admin/unidata/Makefile.in26
-rw-r--r--admin/unidata/unidata-gen.el34
-rwxr-xr-xbuild-aux/msys-to-w32170
-rw-r--r--configure.ac83
-rw-r--r--doc/emacs/ChangeLog18
-rw-r--r--doc/emacs/Makefile.in1
-rw-r--r--doc/emacs/buffers.texi54
-rw-r--r--doc/emacs/cmdargs.texi14
-rw-r--r--doc/emacs/emacs.texi3
-rw-r--r--doc/emacs/text.texi4
-rw-r--r--doc/lispintro/ChangeLog9
-rw-r--r--doc/lispintro/Makefile.in1
-rw-r--r--doc/lispintro/emacs-lisp-intro.texi6
-rw-r--r--doc/lispref/ChangeLog57
-rw-r--r--doc/lispref/Makefile.in1
-rw-r--r--doc/lispref/frames.texi8
-rw-r--r--doc/lispref/hooks.texi6
-rw-r--r--doc/lispref/loading.texi52
-rw-r--r--doc/lispref/modes.texi2
-rw-r--r--doc/lispref/os.texi17
-rw-r--r--doc/lispref/searching.texi3
-rw-r--r--doc/lispref/windows.texi5
-rw-r--r--doc/misc/ChangeLog27
-rw-r--r--doc/misc/Makefile.in2
-rw-r--r--doc/misc/dbus.texi31
-rw-r--r--doc/misc/org.texi15
-rw-r--r--doc/misc/ses.texi106
-rw-r--r--etc/ChangeLog14
-rw-r--r--etc/NEWS65
-rw-r--r--etc/TODO8
-rw-r--r--etc/enriched.txt (renamed from etc/enriched.doc)42
-rw-r--r--etc/refcards/orgcard.tex2
-rw-r--r--leim/ChangeLog34
-rw-r--r--leim/Makefile.in156
-rw-r--r--leim/README24
-rw-r--r--leim/leim-ext.el26
-rw-r--r--lib/getgroups.c15
-rw-r--r--lisp/ChangeLog697
-rw-r--r--lisp/ChangeLog.163
-rw-r--r--lisp/Makefile.in27
-rw-r--r--lisp/cedet/ChangeLog22
-rw-r--r--lisp/cedet/semantic/bovine/c-by.el2224
-rw-r--r--lisp/cedet/semantic/bovine/grammar.el111
-rw-r--r--lisp/cedet/semantic/bovine/make-by.el391
-rw-r--r--lisp/cedet/semantic/bovine/scm-by.el196
-rw-r--r--lisp/cedet/semantic/db.el2
-rw-r--r--lisp/cedet/semantic/grammar.el20
-rw-r--r--lisp/cedet/semantic/wisent/grammar.el114
-rw-r--r--lisp/cedet/semantic/wisent/javat-wy.el688
-rw-r--r--lisp/cedet/semantic/wisent/js-wy.el530
-rw-r--r--lisp/cedet/semantic/wisent/python-wy.el847
-rw-r--r--lisp/cedet/srecode/srt-wy.el306
-rw-r--r--lisp/comint.el1
-rw-r--r--lisp/composite.el18
-rw-r--r--lisp/cus-start.el2
-rw-r--r--lisp/doc-view.el1
-rw-r--r--lisp/electric.el2
-rw-r--r--lisp/emacs-lisp/authors.el1
-rw-r--r--lisp/emacs-lisp/byte-run.el11
-rw-r--r--lisp/emacs-lisp/bytecomp.el30
-rw-r--r--lisp/emacs-lisp/debug.el84
-rw-r--r--lisp/emacs-lisp/eldoc.el19
-rw-r--r--lisp/emacs-lisp/helpers.el32
-rw-r--r--lisp/emacs-lisp/lisp-mnt.el4
-rw-r--r--lisp/emacs-lisp/package.el2
-rw-r--r--lisp/emacs-lisp/regexp-opt.el4
-rw-r--r--lisp/emacs-lock.el3
-rw-r--r--lisp/epa-file.el26
-rw-r--r--lisp/erc/ChangeLog5
-rw-r--r--lisp/erc/erc-button.el2
-rw-r--r--lisp/filenotify.el5
-rw-r--r--lisp/files.el2
-rw-r--r--lisp/frame.el49
-rw-r--r--lisp/gnus/ChangeLog52
-rw-r--r--lisp/gnus/gnus-art.el34
-rw-r--r--lisp/gnus/gnus-html.el3
-rw-r--r--lisp/gnus/gnus-icalendar.el96
-rw-r--r--lisp/gnus/message.el11
-rw-r--r--lisp/gnus/mm-view.el9
-rw-r--r--lisp/gnus/nndoc.el8
-rw-r--r--lisp/gnus/rfc2231.el3
-rw-r--r--lisp/help.el136
-rw-r--r--lisp/imenu.el29
-rw-r--r--lisp/international/.gitignore17
-rw-r--r--lisp/international/characters.el70
-rw-r--r--lisp/international/charprop.el88
-rw-r--r--lisp/international/ja-dic-cnv.el15
-rw-r--r--lisp/international/titdic-cnv.el28
-rw-r--r--lisp/international/uni-bidi.el26
-rw-r--r--lisp/international/uni-category.el38
-rw-r--r--lisp/international/uni-combining.el26
-rw-r--r--lisp/international/uni-comment.elbin2416 -> 0 bytes
-rw-r--r--lisp/international/uni-decimal.elbin2800 -> 0 bytes
-rw-r--r--lisp/international/uni-decomposition.elbin29362 -> 0 bytes
-rw-r--r--lisp/international/uni-digit.elbin3118 -> 0 bytes
-rw-r--r--lisp/international/uni-lowercase.elbin6475 -> 0 bytes
-rw-r--r--lisp/international/uni-mirrored.elbin9457 -> 0 bytes
-rw-r--r--lisp/international/uni-name.elbin162389 -> 0 bytes
-rw-r--r--lisp/international/uni-numeric.elbin4636 -> 0 bytes
-rw-r--r--lisp/international/uni-old-name.elbin19790 -> 0 bytes
-rw-r--r--lisp/international/uni-titlecase.elbin6515 -> 0 bytes
-rw-r--r--lisp/international/uni-uppercase.elbin6511 -> 0 bytes
-rw-r--r--lisp/isearch.el15
-rw-r--r--lisp/json.el5
-rw-r--r--lisp/ldefs-boot.el753
-rw-r--r--lisp/leim/.gitignore2
-rw-r--r--lisp/leim/quail/.gitignore (renamed from leim/quail/.gitignore)0
-rw-r--r--lisp/leim/quail/arabic.el (renamed from leim/quail/arabic.el)0
-rw-r--r--lisp/leim/quail/croatian.el (renamed from leim/quail/croatian.el)0
-rw-r--r--lisp/leim/quail/cyril-jis.el (renamed from leim/quail/cyril-jis.el)0
-rw-r--r--lisp/leim/quail/cyrillic.el (renamed from leim/quail/cyrillic.el)0
-rw-r--r--lisp/leim/quail/czech.el (renamed from leim/quail/czech.el)0
-rw-r--r--lisp/leim/quail/ethiopic.el (renamed from leim/quail/ethiopic.el)0
-rw-r--r--lisp/leim/quail/georgian.el (renamed from leim/quail/georgian.el)0
-rw-r--r--lisp/leim/quail/greek.el (renamed from leim/quail/greek.el)0
-rw-r--r--lisp/leim/quail/hangul.el (renamed from leim/quail/hangul.el)5
-rw-r--r--lisp/leim/quail/hanja-jis.el (renamed from leim/quail/hanja-jis.el)0
-rw-r--r--lisp/leim/quail/hanja.el (renamed from leim/quail/hanja.el)0
-rw-r--r--lisp/leim/quail/hanja3.el (renamed from leim/quail/hanja3.el)0
-rw-r--r--lisp/leim/quail/hebrew.el (renamed from leim/quail/hebrew.el)0
-rw-r--r--lisp/leim/quail/indian.el (renamed from leim/quail/indian.el)0
-rw-r--r--lisp/leim/quail/ipa-praat.el (renamed from leim/quail/ipa-praat.el)0
-rw-r--r--lisp/leim/quail/ipa.el (renamed from leim/quail/ipa.el)0
-rw-r--r--lisp/leim/quail/japanese.el (renamed from leim/quail/japanese.el)0
-rw-r--r--lisp/leim/quail/lao.el (renamed from leim/quail/lao.el)0
-rw-r--r--lisp/leim/quail/latin-alt.el (renamed from leim/quail/latin-alt.el)0
-rw-r--r--lisp/leim/quail/latin-ltx.el (renamed from leim/quail/latin-ltx.el)0
-rw-r--r--lisp/leim/quail/latin-post.el (renamed from leim/quail/latin-post.el)0
-rw-r--r--lisp/leim/quail/latin-pre.el (renamed from leim/quail/latin-pre.el)0
-rw-r--r--lisp/leim/quail/lrt.el (renamed from leim/quail/lrt.el)0
-rw-r--r--lisp/leim/quail/persian.el (renamed from leim/quail/persian.el)0
-rw-r--r--lisp/leim/quail/py-punct.el (renamed from leim/quail/py-punct.el)0
-rw-r--r--lisp/leim/quail/pypunct-b5.el (renamed from leim/quail/pypunct-b5.el)0
-rw-r--r--lisp/leim/quail/rfc1345.el (renamed from leim/quail/rfc1345.el)0
-rw-r--r--lisp/leim/quail/sgml-input.el (renamed from leim/quail/sgml-input.el)0
-rw-r--r--lisp/leim/quail/sisheng.el (renamed from leim/quail/sisheng.el)0
-rw-r--r--lisp/leim/quail/slovak.el (renamed from leim/quail/slovak.el)0
-rw-r--r--lisp/leim/quail/symbol-ksc.el (renamed from leim/quail/symbol-ksc.el)0
-rw-r--r--lisp/leim/quail/thai.el (renamed from leim/quail/thai.el)0
-rw-r--r--lisp/leim/quail/tibetan.el (renamed from leim/quail/tibetan.el)0
-rw-r--r--lisp/leim/quail/uni-input.el (renamed from leim/quail/uni-input.el)7
-rw-r--r--lisp/leim/quail/viqr.el (renamed from leim/quail/viqr.el)0
-rw-r--r--lisp/leim/quail/vntelex.el (renamed from leim/quail/vntelex.el)0
-rw-r--r--lisp/leim/quail/vnvni.el (renamed from leim/quail/vnvni.el)0
-rw-r--r--lisp/leim/quail/welsh.el (renamed from leim/quail/welsh.el)0
-rw-r--r--lisp/loadup.el32
-rw-r--r--lisp/minibuffer.el21
-rw-r--r--lisp/mouse.el118
-rw-r--r--lisp/net/dbus.el37
-rw-r--r--lisp/net/eww.el238
-rw-r--r--lisp/net/newst-reader.el9
-rw-r--r--lisp/net/shr.el78
-rw-r--r--lisp/net/tramp-cmds.el9
-rw-r--r--lisp/net/tramp-sh.el83
-rw-r--r--lisp/net/tramp.el2
-rw-r--r--lisp/notifications.el2
-rw-r--r--lisp/obsolete/rcompile.el (renamed from lisp/net/rcompile.el)1
-rw-r--r--lisp/org/ChangeLog184
-rw-r--r--lisp/org/ob-latex.el6
-rw-r--r--lisp/org/ob-plantuml.el4
-rw-r--r--lisp/org/ob-python.el4
-rw-r--r--lisp/org/ob-ruby.el4
-rw-r--r--lisp/org/org-agenda.el19
-rw-r--r--lisp/org/org-archive.el1
-rw-r--r--lisp/org/org-clock.el3
-rw-r--r--lisp/org/org-colview.el5
-rw-r--r--lisp/org/org-compat.el10
-rw-r--r--lisp/org/org-crypt.el10
-rw-r--r--lisp/org/org-docview.el8
-rw-r--r--lisp/org/org-element.el10
-rw-r--r--lisp/org/org-id.el4
-rw-r--r--lisp/org/org-macs.el8
-rw-r--r--lisp/org/org-table.el5
-rw-r--r--lisp/org/org.el356
-rw-r--r--lisp/org/ox-ascii.el161
-rw-r--r--lisp/org/ox-html.el92
-rw-r--r--lisp/org/ox-latex.el24
-rw-r--r--lisp/org/ox-odt.el43
-rw-r--r--lisp/org/ox-publish.el5
-rw-r--r--lisp/org/ox-texinfo.el32
-rw-r--r--lisp/org/ox.el32
-rw-r--r--lisp/pcmpl-x.el37
-rw-r--r--lisp/play/gomoku.el114
-rw-r--r--lisp/progmodes/compile.el33
-rw-r--r--lisp/progmodes/gdb-mi.el8
-rw-r--r--lisp/progmodes/grep.el8
-rw-r--r--lisp/progmodes/js.el2
-rw-r--r--lisp/progmodes/octave.el159
-rw-r--r--lisp/progmodes/python.el97
-rw-r--r--lisp/progmodes/ruby-mode.el23
-rw-r--r--lisp/progmodes/sh-script.el2
-rw-r--r--lisp/replace.el4
-rw-r--r--lisp/ses.el34
-rw-r--r--lisp/simple.el20
-rw-r--r--lisp/startup.el44
-rw-r--r--lisp/subr.el17
-rw-r--r--lisp/textmodes/enriched.el4
-rw-r--r--lisp/textmodes/tex-mode.el2
-rw-r--r--lisp/time.el2
-rw-r--r--lisp/uniquify.el2
-rw-r--r--lisp/vc/diff-mode.el3
-rw-r--r--lisp/vc/log-edit.el87
-rw-r--r--lisp/vc/smerge-mode.el29
-rw-r--r--lisp/vc/vc-dispatcher.el2
-rw-r--r--lisp/vc/vc-git.el19
-rw-r--r--lisp/vc/vc.el7
-rw-r--r--lisp/windmove.el14
-rw-r--r--lisp/window.el2015
-rw-r--r--lwlib/ChangeLog2
-rwxr-xr-xmake-dist23
-rw-r--r--nt/ChangeLog11
-rw-r--r--nt/README.W324
-rw-r--r--nt/addpm.c2
-rw-r--r--nt/epaths.nt10
-rw-r--r--nt/inc/ms-w32.h5
-rw-r--r--nt/paths.h5
-rw-r--r--src/.gdbinit2
-rw-r--r--src/ChangeLog762
-rw-r--r--src/ChangeLog.122
-rw-r--r--src/Makefile.in72
-rw-r--r--src/alloc.c34
-rw-r--r--src/bidi.c65
-rw-r--r--src/blockinput.h2
-rw-r--r--src/buffer.c24
-rw-r--r--src/buffer.h7
-rw-r--r--src/callproc.c31
-rw-r--r--src/charset.c10
-rw-r--r--src/charset.h2
-rw-r--r--src/chartab.c2
-rw-r--r--src/composite.c2
-rw-r--r--src/data.c151
-rw-r--r--src/dispextern.h77
-rw-r--r--src/dispnew.c188
-rw-r--r--src/editfns.c40
-rw-r--r--src/emacs.c65
-rw-r--r--src/epaths.in6
-rw-r--r--src/eval.c68
-rw-r--r--src/fileio.c49
-rw-r--r--src/fns.c71
-rw-r--r--src/font.c2
-rw-r--r--src/font.h21
-rw-r--r--src/frame.c409
-rw-r--r--src/frame.h280
-rw-r--r--src/fringe.c4
-rw-r--r--src/ftfont.c1
-rw-r--r--src/gnutls.c6
-rw-r--r--src/gtkutil.c49
-rw-r--r--src/gtkutil.h2
-rw-r--r--src/image.c4
-rw-r--r--src/indent.c4
-rw-r--r--src/insdel.c6
-rw-r--r--src/intervals.c2
-rw-r--r--src/intervals.h2
-rw-r--r--src/keyboard.c45
-rw-r--r--src/keyboard.h1
-rw-r--r--src/lisp.h23
-rw-r--r--src/lisp.mk2
-rw-r--r--src/lread.c270
-rw-r--r--src/menu.c12
-rw-r--r--src/minibuf.c3
-rw-r--r--src/nsfns.m23
-rw-r--r--src/nsfont.m1
-rw-r--r--src/nsterm.h6
-rw-r--r--src/nsterm.m132
-rw-r--r--src/print.c7
-rw-r--r--src/process.c11
-rw-r--r--src/regex.c2
-rw-r--r--src/term.c12
-rw-r--r--src/textprop.c28
-rw-r--r--src/tparam.c2
-rw-r--r--src/undo.c6
-rw-r--r--src/w32fns.c324
-rw-r--r--src/w32font.c33
-rw-r--r--src/w32inevt.c10
-rw-r--r--src/w32menu.c9
-rw-r--r--src/w32notify.c29
-rw-r--r--src/w32proc.c34
-rw-r--r--src/w32term.c141
-rw-r--r--src/w32term.h19
-rw-r--r--src/w32xfns.c1
-rw-r--r--src/widget.c12
-rw-r--r--src/window.c1111
-rw-r--r--src/window.h345
-rw-r--r--src/xdisp.c940
-rw-r--r--src/xfaces.c7
-rw-r--r--src/xfns.c90
-rw-r--r--src/xmenu.c6
-rw-r--r--src/xrdb.c2
-rw-r--r--src/xterm.c329
-rw-r--r--src/xterm.h18
-rw-r--r--test/ChangeLog95
-rw-r--r--test/automated/Makefile.in15
-rw-r--r--test/automated/data-tests.el46
-rw-r--r--test/automated/dbus-tests.el136
-rw-r--r--test/automated/decoder-tests.el2
-rw-r--r--test/automated/file-notify-tests.el48
-rw-r--r--test/automated/python-tests.el32
-rw-r--r--test/automated/reftex-tests.el9
-rw-r--r--test/automated/regexp-tests.el31
-rw-r--r--test/automated/ruby-mode-tests.el23
-rw-r--r--test/automated/tramp-tests.el14
314 files changed, 10923 insertions, 10169 deletions
diff --git a/.dir-locals.el b/.dir-locals.el
index 5bee88267c8..203343f0842 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -7,7 +7,8 @@
;; See admin/notes/bugtracker.
(log-edit-mode . ((log-edit-rewrite-fixes
"[ \n](bug#\\([0-9]+\\))" . "debbugs:\\1")
- (log-edit-font-lock-gnu-style . t)))
+ (log-edit-font-lock-gnu-style . t)
+ (log-edit-setup-add-author . t)))
(change-log-mode . ((add-log-time-zone-rule . t)
(fill-column . 74)
(bug-reference-url-format . "http://debbugs.gnu.org/%s")
diff --git a/ChangeLog b/ChangeLog
index 30c87c3e613..6183719e98c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,90 @@
+2013-12-01 Dmitry Gutov <dgutov@yandex.ru>
+
+ * .dir-locals.el (log-edit-move): Add the "Author: " header.
+
+2013-11-30 Dani Moncayo <dmoncayo@gmail.com>
+
+ * build-aux/msys-to-w32 (w32pathlist): Do not translate paths
+ starting with %emacs_dir%.
+
+2013-11-30 Glenn Morris <rgm@gnu.org>
+
+ Stop keeping (most) generated cedet grammar files in the repository.
+ * configure.ac (SUBDIR_MAKEFILES, AC_CONFIG_FILES):
+ Add admin/grammars Makefile.
+ * Makefile.in (distclean, bootstrap-clean, maintainer-clean):
+ Also clean admin/grammars, if present.
+
+2013-11-29 Dani Moncayo <dmoncayo@gmail.com>
+
+ * Makefile.in (epaths-force-w32): Fix 2013-11-20 typo.
+
+2013-11-29 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * configure.ac (HAVE_MENUS): Remove.
+
+2013-11-28 Glenn Morris <rgm@gnu.org>
+
+ * configure.ac (PATH_SEP): Replace with pre-existing SEPCHAR.
+
+2013-11-28 Eli Zaretskii <eliz@gnu.org>
+
+ * GNUmakefile (Makefile): Don't use $(CFG).
+ (CFG): Don't compute.
+
+ * configure.ac (PATH_SEP): Set and AC_SUBST.
+
+2013-11-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ Merge from gnulib, incorporating:
+ 2013-11-13 getgroups: work around _DARWIN_C_SOURCE problem
+ * lib/getgroups.c: Update from gnulib.
+
+2013-11-27 Glenn Morris <rgm@gnu.org>
+
+ Move ja-dic, quail, leim-list.el from leim to lisp/leim.
+ * Makefile.in (abs_builddir, leimdir): Remove.
+ (buildlisppath, SUBDIR, COPYDIR, COPYDESTS): No more leim directory.
+ (epaths-force-w32): No longer set BLD.
+ (leim): Remove.
+ (install-arch-indep): No longer run or install leim.
+ (mostlyclean, clean): No longer run leim rule.
+ (bootstrap-clean): Change leim target.
+ (maintainer-clean): Add leim.
+ (check-declare): Remove leim.
+ * README: Update for leim changes.
+ * configure.ac (leimdir): Remove.
+ (standardlisppath): No more leimdir.
+
+ * make-dist: Update for files from leim/ now being in lisp/leim/.
+
+2013-11-26 Glenn Morris <rgm@gnu.org>
+
+ Preload leim-list.el.
+ * Makefile.in (abs_builddir): New, set by configure.
+ (buildlisppath): Add leim/.
+ (epaths-force-w32): Set BLD.
+
+2013-11-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix some dependency problems that cause unnecessary recompiles.
+ * configure.ac (OLDXMENU_TARGET, OLDXMENU, OLDXMENU_DEPS):
+ Remove.
+ (LIBXMENU): Now is always either empty or a file name,
+ so that it can be used as a dependency.
+
+2013-11-20 Glenn Morris <rgm@gnu.org>
+
+ * make-dist: Distribute build-aux/msys-to-w32.
+
+2013-11-20 Dani Moncayo <dmoncayo@gmail.com>
+
+ * build-aux/msys-to-w32: New file.
+ * Makefile.in (msys_to_w32, msys_lisppath_to_w32): Remove.
+ (msys_w32prefix_subst): Rename from msys_prefix_subst.
+ Operate on w32prefixpattern.
+ (epaths-force-w32): Use build-aux/msys-to-w32.
+
2013-11-17 Paul Eggert <eggert@cs.ucla.edu>
* configure.ac (DEBUGGER_SEES_C_MACROS): Remove.
diff --git a/GNUmakefile b/GNUmakefile
index 25c586d8356..856b47ca992 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -32,12 +32,6 @@
# run "configure" by hand. But run autogen.sh first, if the source
# was checked out directly from the repository.
-ifneq ($(MSYSTEM),)
-CFG = CONFIG_SITE=$(CURDIR)/nt/mingw-cfg.site
-else
-CFG =
-endif
-
# If a Makefile already exists, just use it.
ifeq ($(wildcard Makefile),Makefile)
@@ -75,7 +69,7 @@ configure:
Makefile: configure
@echo >&2 'There seems to be no Makefile in this directory.'
@echo >&2 'Running ./configure ...'
- $(CFG) ./configure
+ ./configure
@echo >&2 'Makefile built.'
endif
diff --git a/Makefile.in b/Makefile.in
index e00eb790d66..aedb9acff0d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -48,6 +48,8 @@
#
# make extraclean
# Still more severe - delete backup and autosave files, too.
+# Also generated files that do not normally change and can be slow
+# to rebuild (eg leim/ja-dic).
#
# make bootstrap
# Removes all the compiled files to force a new bootstrap from a
@@ -190,15 +192,13 @@ iconsrcdir=$(srcdir)/etc/images/icons
# These variables hold the values Emacs will actually use. They are
# based on the values of the standard Make variables above.
-# Where to install the lisp, leim files distributed with
-# Emacs. This includes the Emacs version, so that the
-# lisp files for different versions of Emacs will install
-# themselves in separate directories.
+# Where to install the lisp files distributed with Emacs.
+# This includes the Emacs version, so that the lisp files for different
+# versions of Emacs will install themselves in separate directories.
lispdir=@lispdir@
-leimdir=@leimdir@
# Directories Emacs should search for standard lisp files.
-# The default is ${lispdir}:${leimdir}.
+# The default is ${lispdir}.
standardlisppath=@standardlisppath@
# Directories Emacs should search for lisp files specific to this
@@ -213,12 +213,13 @@ locallisppath=@locallisppath@
# The default is ${locallisppath}:${standardlisppath}.
lisppath=@lisppath@
-# Where Emacs will search for its lisp files while
-# building. This is only used during the process of
-# compiling Emacs, to help Emacs find its lisp files
-# before they've been installed in their final location.
+# Where Emacs will search for its lisp files while building.
+# This is only used during the process of compiling Emacs,
+# to help Emacs find its lisp files before they've been installed
+# in their final location.
# This should be a colon-separated list of directories.
# Normally it points to the lisp/ directory in the sources.
+# NB lread.c relies on lisp/ being first here.
buildlisppath=${abs_srcdir}/lisp
# Where to install the other architecture-independent
@@ -274,7 +275,7 @@ EMACS = ${EMACS_NAME}${EXEEXT}
EMACSFULL = `echo emacs-${version} | sed '$(TRANSFORM)'`${EXEEXT}
# Subdirectories to make recursively.
-SUBDIR = $(NTDIR) lib lib-src src lisp leim
+SUBDIR = $(NTDIR) lib lib-src src lisp
# The subdir makefiles created by config.status.
SUBDIR_MAKEFILES_IN = @SUBDIR_MAKEFILES_IN@
@@ -283,10 +284,9 @@ SUBDIR_MAKEFILES = `echo $(SUBDIR_MAKEFILES_IN:.in=) | sed 's|$(srcdir)/||g'`
# Subdirectories to install, and where they'll go. lib-src's and nt's
# makefiles know how to install them, so we don't do that here.
# Directories that cannot simply be copied, eg info, are treated
-# separately. quail appears twice because in out-of-tree builds, it
-# exists twice.
-COPYDIR = ${srcdir}/etc ${srcdir}/lisp ${srcdir}/leim/ja-dic ${srcdir}/leim/quail leim/quail
-COPYDESTS = "$(DESTDIR)${etcdir}" "$(DESTDIR)${lispdir}" "$(DESTDIR)${leimdir}/ja-dic" "$(DESTDIR)${leimdir}/quail" "$(DESTDIR)${leimdir}/quail"
+# separately.
+COPYDIR = ${srcdir}/etc ${srcdir}/lisp
+COPYDESTS = "$(DESTDIR)${etcdir}" "$(DESTDIR)${lispdir}"
all: ${SUBDIR}
@@ -317,22 +317,9 @@ epaths-force: FRC
-e 's;\(#.*PATH_DOC\).*$$;\1 "${etcdocdir}";') && \
${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h
-# Convert MSYS-style /x/foo or Windows-style x:\foo file names
-# into x:/foo that Windows can grok.
-msys_to_w32=sed -e 's,\\\\,/,g' -e 's,^/\([A-Za-z]\)/,\1:/,'
-
-# Transform directory search path and its components. Original can
-# be MSYS or Windows style. Set path separator to ";", directory
-# separator to "/" and transform MSYS-style "/c/" to "c:/".
-# Remove empty path components and escape semicolons.
-msys_lisppath_to_w32=sed -e 's,\\\\,/,g' \
- -e 's,\(^\|[:;]\)\([A-Za-z]\):/,\1/\2/,g' \
- -e 's/:/;/g' -e 's,\(^\|;\)/\([A-Za-z]\)/,\1\2:/,g' \
- -e 's/;\+/;/g' -e 's/^;//' -e 's/;$$//' -e 's/;/\\\\;/g'
-
-# Replace "${prefix}" with '%emacs_dir%' (which expands to install
+# Replace "${w32prefix}" with '%emacs_dir%' (which expands to install
# directory at runtime).
-msys_prefix_subst=sed -e 's!\(^\|;\)'"$${prefixpattern}"'\([;/]\|$$\)!\1%emacs_dir%\2!g'
+msys_w32prefix_subst=sed -e 's!\(^\|;\)'"$${w32prefixpattern}"'\([;/]\|$$\)!\1%emacs_dir%\2!g'
# Quote Sed special characters (except backslash and newline) with
# a double backslash.
@@ -340,22 +327,21 @@ msys_sed_sh_escape=sed -e 's/[];$$*.^[]/\\\\&/g'
# The w32 build needs a slightly different editing, and it uses
# nt/epaths.nt as the template.
+#
# Use the value of ${locallisppath} supplied by `configure',
# to support the --enable-locallisppath argument.
#
-# When building with MinGW inside the MSYS tree, 'pwd' produces directories
-# relative to the root of the MSYS tree, e.g. '/home/user/foo' instead of
-# '/d/MSYS/home/user/foo'. If such a value of srcdir is written to
-# src/epaths.h, that causes temacs to fail, because, being a MinGW
-# program that knows nothing of MSYS root substitution, it cannot find
-# the data directory. "pwd -W" produces Windows-style 'd:/foo/bar'
-# absolute directory names, so we use it here to countermand that lossage.
+# In this case, the paths written to 'src/epaths.h' must be in native
+# MS-Windows format (e.g. 'c:/foo/bar'), because temacs is a MinGW
+# program that doesn't support MSYS-style paths (e.g. '/c/foo/bar' or
+# '/foo/bar').
epaths-force-w32: FRC
- @(w32srcdir=`cd "${srcdir}" && pwd -W` ; \
- prefixpattern=`echo '${prefix}' | ${msys_to_w32} | ${msys_sed_sh_escape}` ; \
- locallisppath=`echo '${locallisppath}' | ${msys_lisppath_to_w32} | ${msys_prefix_subst}` ; \
+ @(w32srcdir=`${srcdir}/build-aux/msys-to-w32 "${srcdir}"`; \
+ w32prefix=`${srcdir}/build-aux/msys-to-w32 "${prefix}" N`; \
+ w32prefixpattern=`echo "$${w32prefix}" | ${msys_sed_sh_escape}` ; \
+ w32locallisppath=`${srcdir}/build-aux/msys-to-w32 "${locallisppath}" N ":" "\\;" | ${msys_w32prefix_subst}` ; \
sed < ${srcdir}/nt/epaths.nt > epaths.h.$$$$ \
- -e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "'"$${locallisppath}"'";' \
+ -e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "'"$${w32locallisppath}"'";' \
-e '/^.*#/s/@VER@/${version}/g' \
-e '/^.*#/s/@CFG@/${configuration}/g' \
-e "/^.*#/s|@SRC@|$${w32srcdir}|g") && \
@@ -369,12 +355,11 @@ lib-src src: $(NTDIR) lib
src: lib-src
-# We need to build `emacs' in `src' to compile the *.elc files in `lisp'
-# and `leim'.
-lisp leim: src
+# We need to build `emacs' in `src' to compile the *.elc files in `lisp'.
+lisp: src
# These targets should be "${SUBDIR} without `src'".
-lib lib-src lisp leim nt: Makefile FRC
+lib lib-src lisp nt: Makefile FRC
cd $@ && $(MAKE) all $(MFLAGS) \
CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
LDFLAGS='${LDFLAGS}' MAKE='${MAKE}'
@@ -561,9 +546,12 @@ set_installuser=for installuser in $${LOGNAME} $${USERNAME} $${USER} \
## Note that the Makefiles in the etc directory are potentially useful
## in an installed Emacs, so should not be excluded.
-## We used to create locallisppath, but if it points to non-standard
-## locations, is not really Emacs's job to create these directories,
-## so it is no longer done.
+## We always create the _default_ locallisppath directories, and
+## ensure that they contain a subdirs.el file (via write_subdir).
+## This is true even if locallisppath has a non-default value.
+## In case of non-default value, we used to create the specified directories,
+## but not add subdirs.el to them. This was a strange halfway house.
+## Nowadays we do not create non-default directories.
## Note that we use tar instead of plain old cp -R/-r because the latter
## is apparently not portable (even in 2012!).
@@ -572,7 +560,7 @@ set_installuser=for installuser in $${LOGNAME} $${USERNAME} $${USER} \
## work correctly, and therefore no idea when tar can be replaced.
## See also these comments from 2004 about cp -r working fine:
## http://lists.gnu.org/archive/html/autoconf-patches/2004-11/msg00005.html
-install-arch-indep: lisp leim install-info install-man ${INSTALL_ARCH_INDEP_EXTRA}
+install-arch-indep: lisp install-info install-man ${INSTALL_ARCH_INDEP_EXTRA}
-set ${COPYDESTS} ; \
unset CDPATH; \
$(set_installuser); \
@@ -584,13 +572,8 @@ install-arch-indep: lisp leim install-info install-man ${INSTALL_ARCH_INDEP_EXTR
[ "$$exp_dest" = "`cd $${dir} && /bin/pwd`" ] && continue ; \
else true; \
fi; \
- if [ "$${dir}" = "leim/quail" ]; then \
- [ "`cd $${dir} && /bin/pwd`" = "`cd ${srcdir}/leim/quail && /bin/pwd`" ] && \
- continue ; \
- else \
- rm -rf "$${dest}" ; \
- umask 022; ${MKDIR_P} "$${dest}" ; \
- fi ; \
+ rm -rf "$${dest}" ; \
+ umask 022; ${MKDIR_P} "$${dest}" ; \
echo "Copying $${dir} to $${dest}..." ; \
(cd $${dir}; tar -chf - . ) \
| (cd "$${dest}"; umask 022; \
@@ -617,8 +600,6 @@ install-arch-indep: lisp leim install-info install-man ${INSTALL_ARCH_INDEP_EXTR
done ); \
find "$${dest}" -exec chown $${installuser} {} ';' ;\
done
- -rm -f "$(DESTDIR)${leimdir}/leim-list.el"
- ${INSTALL_DATA} leim/leim-list.el "$(DESTDIR)${leimdir}/leim-list.el"
-rm -f "$(DESTDIR)${lispdir}/subdirs.el"
umask 022; $(srcdir)/build-aux/update-subdirs "$(DESTDIR)${lispdir}"
subdir="$(DESTDIR)${datadir}/emacs/${version}/site-lisp" ; \
@@ -629,7 +610,7 @@ install-arch-indep: lisp leim install-info install-man ${INSTALL_ARCH_INDEP_EXTR
( echo "Compressing *.el ..." ; \
unset CDPATH; \
thisdir=`/bin/pwd`; \
- for dir in "$(DESTDIR)${lispdir}" "$(DESTDIR)${leimdir}"; do \
+ for dir in "$(DESTDIR)${lispdir}"; do \
cd "$${thisdir}" ; \
cd "$${dir}" || exit 1 ; \
for f in `find . -name "*.elc" -print`; do \
@@ -826,7 +807,6 @@ mostlyclean: FRC
-cd doc/misc && $(MAKE) $(MFLAGS) mostlyclean
-cd doc/lispref && $(MAKE) $(MFLAGS) mostlyclean
-cd doc/lispintro && $(MAKE) $(MFLAGS) mostlyclean
- cd leim && $(MAKE) $(MFLAGS) mostlyclean
### `clean'
### Delete all files from the current directory that are normally
@@ -848,7 +828,6 @@ clean: FRC
-cd doc/misc && $(MAKE) $(MFLAGS) clean
-cd doc/lispref && $(MAKE) $(MFLAGS) clean
-cd doc/lispintro && $(MAKE) $(MFLAGS) clean
- cd leim && $(MAKE) $(MFLAGS) clean
cd nextstep && $(MAKE) $(MFLAGS) clean
### `bootclean'
@@ -878,7 +857,7 @@ distclean: FRC
cd leim && $(MAKE) $(MFLAGS) distclean
cd lisp && $(MAKE) $(MFLAGS) distclean
cd nextstep && $(MAKE) $(MFLAGS) distclean
- for dir in test/automated admin/unidata; do \
+ for dir in test/automated admin/grammars admin/unidata; do \
[ ! -d $$dir ] || (cd $$dir && $(MAKE) $(MFLAGS) distclean); \
done
${top_distclean}
@@ -897,10 +876,10 @@ bootstrap-clean: FRC
-cd doc/misc && $(MAKE) $(MFLAGS) maintainer-clean
-cd doc/lispref && $(MAKE) $(MFLAGS) maintainer-clean
-cd doc/lispintro && $(MAKE) $(MFLAGS) maintainer-clean
- cd leim && $(MAKE) $(MFLAGS) maintainer-clean
+ cd leim && $(MAKE) $(MFLAGS) bootstrap-clean
cd lisp && $(MAKE) $(MFLAGS) bootstrap-clean
cd nextstep && $(MAKE) $(MFLAGS) maintainer-clean
- for dir in test/automated admin/unidata; do \
+ for dir in test/automated admin/grammars admin/unidata; do \
[ ! -d $$dir ] || (cd $$dir && $(MAKE) $(MFLAGS) bootstrap-clean); \
done
[ ! -f config.log ] || mv -f config.log config.log~
@@ -922,8 +901,9 @@ top_maintainer_clean=\
rm -fr autom4te.cache
maintainer-clean: bootstrap-clean FRC
cd src && $(MAKE) $(MFLAGS) maintainer-clean
+ cd leim && $(MAKE) $(MFLAGS) maintainer-clean
cd lisp && $(MAKE) $(MFLAGS) maintainer-clean
- for dir in test/automated admin/unidata; do \
+ for dir in test/automated admin/grammars admin/unidata; do \
[ ! -d $$dir ] || (cd $$dir && $(MAKE) $(MFLAGS) maintainer-clean); \
done
${top_maintainer_clean}
@@ -1088,5 +1068,4 @@ check-declare:
echo "You must build Emacs to use this command"; \
exit 1; \
fi
- cd leim && $(MAKE) $(MFLAGS) $@
cd lisp && $(MAKE) $(MFLAGS) $@
diff --git a/README b/README
index ebd07eaaa3d..d909962237c 100644
--- a/README
+++ b/README
@@ -64,9 +64,10 @@ There are several subdirectories:
its primitives, the redisplay code, and some basic editing
functions).
`lisp' holds the Emacs Lisp code for Emacs (most everything else).
-`leim' holds the library of Emacs input methods, Lisp code and
- auxiliary data files required to type international characters
- which can't be directly produced by your keyboard.
+`leim' holds the original source files for the generated files
+ in lisp/leim. These form the library of Emacs input methods,
+ required to type international characters that can't be
+ directly produced by your keyboard.
`lib' holds source code for libraries used by Emacs and its utilities
`lib-src' holds the source code for some utility programs for use by or
with Emacs, like movemail and etags.
diff --git a/admin/ChangeLog b/admin/ChangeLog
index b8fdf09ddff..730253e616f 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,51 @@
+2013-12-04 Eli Zaretskii <eliz@gnu.org>
+
+ * unidata/unidata-gen.el (unidata-prop-alist): Update bidi-class
+ to include the new isolate-related classes introduced with Unicode
+ v6.3.
+ (unidata-encode-val): Accept an additional optional argument, a
+ warning message to emit when UnicodeData.txt defines bidi-class
+ values that are not in unidata-prop-alist. Add a comment
+ explaining what should maintainers do if/when such a warning ever
+ appears.
+ (unidata-gen-table): Call unidata-encode-val with 3rd arg non-nil
+ when generating uni-bidi.el.
+
+2013-12-01 Glenn Morris <rgm@gnu.org>
+
+ * unidata/Makefile.in (${DSTDIR}/charprop.el):
+ Ensure output files are writable.
+
+2013-11-30 Glenn Morris <rgm@gnu.org>
+
+ * grammars/Makefile.in: Ensure output files are writable.
+
+2013-11-30 Eli Zaretskii <eliz@gnu.org>
+
+ * charsets/mule-charsets.el: Rewritten to work in Emacs 23 and
+ later. (Bug#16007)
+
+2013-11-30 Glenn Morris <rgm@gnu.org>
+
+ Stop keeping (most) generated cedet grammar files in the repository.
+ * grammars/README: Remove.
+ * grammars/Makefile.in: New file.
+ * grammars/c.by, grammars/java-tags.wy, grammars/js.wy:
+ * grammars/python.wy: Update declarations to match generated outputs.
+
+2013-11-28 Glenn Morris <rgm@gnu.org>
+
+ * unidata/unidata-gen.el (unidata-gen-files):
+ Disable autoloads in generated files.
+
+2013-11-27 Glenn Morris <rgm@gnu.org>
+
+ * unidata/Makefile.in (all, install, clean, bootstrap-clean)
+ (distclean, maintainer-clean): Declare as PHONY.
+ (compile, extraclean): New.
+ (${DSTDIR}/charprop.el): Depend on source files rather than
+ intermediate products.
+
2013-11-11 Glenn Morris <rgm@gnu.org>
* unidata/BidiMirroring.txt, unidata/UnicodeData.txt: Update to 6.3.0.
diff --git a/admin/charsets/mule-charsets.el b/admin/charsets/mule-charsets.el
index 4a48d994b1b..4ccf4bfb5be 100644
--- a/admin/charsets/mule-charsets.el
+++ b/admin/charsets/mule-charsets.el
@@ -19,20 +19,32 @@
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-(if (not (or (and (= emacs-major-version 21) (= emacs-minor-version 4))
- (= emacs-major-version 22)))
- (error "Use Emacs of version 21.4 or any of version 22"))
-
-(defun func (start end)
- (while (<= start end)
- (let ((split (split-char start))
- (unicode (encode-char start 'ucs)))
- (if unicode
- (if (nth 2 split)
- (insert (format "0x%02X%02X 0x%04X\n"
- (nth 1 split) (nth 2 split) unicode))
- (insert (format "0x%02X 0x%04X\n" (nth 1 split) unicode)))))
- (setq start (1+ start))))
+;; For the record: the old, pre-v23 code was this:
+;; (if (not (or (and (= emacs-major-version 21) (= emacs-minor-version 4))
+;; (= emacs-major-version 22)))
+;; (error "Use Emacs of version 21.4 or any of version 22"))
+;;
+;; (defun func (start end)
+;; (while (<= start end)
+;; (let ((split (split-char start))
+;; (unicode (encode-char start 'ucs)))
+;; (if unicode
+;; (if (nth 2 split)
+;; (insert (format "0x%02X%02X 0x%04X\n"
+;; (nth 1 split) (nth 2 split) unicode))
+;; (insert (format "0x%02X 0x%04X\n" (nth 1 split) unicode)))))
+;; (setq start (1+ start))))
+
+(defun func (range charset)
+ (let ((start (car range))
+ (end (cdr range)))
+ (while (and (<= start end) (<= start #x10ffff))
+ (let ((ch (encode-char start charset)))
+ (if ch
+ (if (> ch 256)
+ (insert (format "0x%04X 0x%04X\n" ch start))
+ (insert (format "0x%02X 0x%04X\n" ch start)))))
+ (setq start (1+ start)))))
(defconst charset-alist
'(("MULE-ethiopic.map" . ethiopic)
@@ -51,6 +63,8 @@
(dolist (elt charset-alist)
(with-temp-buffer
(insert header)
- (map-charset-chars 'func (cdr elt))
- (write-file (car elt))))
+ (map-charset-chars 'func (cdr elt) (cdr elt))
+ (sort-lines nil (point-min) (point-max))
+ (let ((coding-system-for-write 'unix))
+ (write-file (car elt)))))
diff --git a/admin/grammars/Makefile.in b/admin/grammars/Makefile.in
new file mode 100644
index 00000000000..e279dad3e57
--- /dev/null
+++ b/admin/grammars/Makefile.in
@@ -0,0 +1,113 @@
+### @configure_input@
+
+## Copyright (C) 2013 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/>.
+
+### Commentary:
+
+## This directory contains grammar files in Bison and Wisent,
+## used to generate the parser data in the lisp/cedet directory.
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = @top_builddir@
+
+EMACS = ${top_builddir}/src/emacs
+emacs = EMACSLOADPATH= "${EMACS}" -batch --no-site-file --no-site-lisp
+
+make_bovine = ${emacs} -l semantic/bovine/grammar -f bovine-batch-make-parser
+make_wisent = ${emacs} -l semantic/wisent/grammar -f wisent-batch-make-parser
+
+cedetdir = ${top_srcdir}/lisp/cedet
+bovinedir = ${cedetdir}/semantic/bovine
+wisentdir = ${cedetdir}/semantic/wisent
+
+BOVINE = \
+ ${bovinedir}/c-by.el \
+ ${bovinedir}/make-by.el \
+ ${bovinedir}/scm-by.el
+
+## FIXME Should include this one too:
+## ${cedetdir}/semantic/grammar-wy.el
+## but semantic/grammar.el (which is what we use to generate grammar-wy.el)
+## requires it!
+WISENT = \
+ ${wisentdir}/javat-wy.el \
+ ${wisentdir}/js-wy.el \
+ ${wisentdir}/python-wy.el \
+ ${cedetdir}/srecode/srt-wy.el
+
+ALL = ${BOVINE} ${WISENT}
+
+.PHONY: all bovine wisent
+
+all: ${ALL}
+
+bovine: ${BOVINE}
+
+wisent: ${WISENT}
+
+
+${bovinedir}/c-by.el: ${srcdir}/c.by
+ [ ! -f "$@" ] || chmod +w "$@"
+ ${make_bovine} -o "$@" ${srcdir}/c.by
+
+${bovinedir}/make-by.el: ${srcdir}/make.by
+ [ ! -f "$@" ] || chmod +w "$@"
+ ${make_bovine} -o "$@" ${srcdir}/make.by
+
+${bovinedir}/scm-by.el: ${srcdir}/scheme.by
+ [ ! -f "$@" ] || chmod +w "$@"
+ ${make_bovine} -o "$@" ${srcdir}/scheme.by
+
+
+${cedetdir}/semantic/grammar-wy.el: ${srcdir}/grammar.wy
+ [ ! -f "$@" ] || chmod +w "$@"
+ ${make_wisent} -o "$@" ${srcdir}/grammar.wy
+
+${wisentdir}/javat-wy.el: ${srcdir}/java-tags.wy
+ [ ! -f "$@" ] || chmod +w "$@"
+ ${make_wisent} -o "$@" ${srcdir}/java-tags.wy
+
+${wisentdir}/js-wy.el: ${srcdir}/js.wy
+ [ ! -f "$@" ] || chmod +w "$@"
+ ${make_wisent} -o "$@" ${srcdir}/js.wy
+
+${wisentdir}/python-wy.el: ${srcdir}/python.wy
+ [ ! -f "$@" ] || chmod +w "$@"
+ ${make_wisent} -o "$@" ${srcdir}/python.wy
+
+${cedetdir}/srecode/srt-wy.el: ${srcdir}/srecode-template.wy
+ [ ! -f "$@" ] || chmod +w "$@"
+ ${make_wisent} -o "$@" ${srcdir}/srecode-template.wy
+
+
+.PHONY: distclean bootstrap-clean maintainer-clean extraclean
+
+distclean:
+ rm -f Makefile
+
+bootstrap-clean maintainer-clean: distclean
+
+## We do not normally delete the generated files, even in bootstrap.
+## Creating them does not take long, so we could easily change this.
+extraclean:
+ rm -f ${ALL}
+
+# Makefile.in ends here
diff --git a/admin/grammars/README b/admin/grammars/README
deleted file mode 100644
index e38260952a5..00000000000
--- a/admin/grammars/README
+++ /dev/null
@@ -1,11 +0,0 @@
-This directory contains grammar files in Bison and Wisent, used to
-generate the parser data in the lisp/semantic/bovine/ and
-lisp/semantic/wisent/ directories. You can run the parser generators
-with
-
-emacs -batch -Q -l semantic/bovine/grammar -f bovine-make-parsers
-emacs -batch -Q -l semantic/wisent/grammar -f wisent-make-parsers
-
-Currently, the parser files in lisp/ are not generated directly from
-these grammar files when making Emacs. This state of affairs, and the
-contents of this directory, will change in a future version of Emacs.
diff --git a/admin/grammars/c.by b/admin/grammars/c.by
index 5d2f407e8e3..55ec0fbaf01 100644
--- a/admin/grammars/c.by
+++ b/admin/grammars/c.by
@@ -41,9 +41,13 @@
%provide semantic/bovine/c-by
%{
-(declare-function semantic-c-reconstitute-token "semantic/bovine/c")
-(declare-function semantic-c-reconstitute-template "semantic/bovine/c")
-(declare-function semantic-expand-c-tag "semantic/bovine/c")
+(declare-function semantic-c-reconstitute-token "semantic/bovine/c"
+ (tokenpart declmods typedecl))
+(declare-function semantic-c-reconstitute-template "semantic/bovine/c"
+ (tag specifier))
+(declare-function semantic-expand-c-tag "semantic/bovine/c" (tag))
+(declare-function semantic-parse-region "semantic"
+ (start end &optional nonterminal depth returnonerror))
}
%languagemode c-mode c++-mode
diff --git a/admin/grammars/java-tags.wy b/admin/grammars/java-tags.wy
index 71607f452a0..3f5c3ad04c6 100644
--- a/admin/grammars/java-tags.wy
+++ b/admin/grammars/java-tags.wy
@@ -25,6 +25,11 @@
%package wisent-java-tags-wy
%provide semantic/wisent/javat-wy
+%{
+(declare-function semantic-parse-region "semantic"
+ (start end &optional nonterminal depth returnonerror))
+}
+
%languagemode java-mode
;; The default start symbol
diff --git a/admin/grammars/js.wy b/admin/grammars/js.wy
index 3b602296552..a6a358a0ee7 100644
--- a/admin/grammars/js.wy
+++ b/admin/grammars/js.wy
@@ -59,6 +59,12 @@
%package wisent-javascript-jv-wy
%provide semantic/wisent/js-wy
+
+%{
+(declare-function semantic-parse-region "semantic"
+ (start end &optional nonterminal depth returnonerror))
+}
+
;; JAVE I prefere ecmascript-mode
%languagemode ecmascript-mode javascript-mode
diff --git a/admin/grammars/python.wy b/admin/grammars/python.wy
index 02fb7390b01..b82125d2bc3 100644
--- a/admin/grammars/python.wy
+++ b/admin/grammars/python.wy
@@ -91,8 +91,12 @@
%provide semantic/wisent/python-wy
%{
-(declare-function wisent-python-reconstitute-function-tag "semantic/wisent/python")
-(declare-function wisent-python-reconstitute-class-tag "semantic/wisent/python")
+(declare-function wisent-python-reconstitute-function-tag
+ "semantic/wisent/python" (tag suite))
+(declare-function wisent-python-reconstitute-class-tag "semantic/wisent/python"
+ (tag))
+(declare-function semantic-parse-region "semantic"
+ (start end &optional nonterminal depth returnonerror))
}
%languagemode python-mode
diff --git a/admin/unidata/Makefile.in b/admin/unidata/Makefile.in
index 4d947363514..2c65ee5b65f 100644
--- a/admin/unidata/Makefile.in
+++ b/admin/unidata/Makefile.in
@@ -31,6 +31,8 @@ EMACS = ${top_builddir}/src/emacs
DSTDIR = ${top_srcdir}/lisp/international
emacs = "${EMACS}" -batch --no-site-file --no-site-lisp
+.PHONY: all compile install
+
all: ${DSTDIR}/charprop.el
.el.elc:
@@ -39,7 +41,16 @@ all: ${DSTDIR}/charprop.el
unidata.txt: ${srcdir}/UnicodeData.txt
sed -e 's/\([^;]*\);\(.*\)/(#x\1 "\2")/' -e 's/;/" "/g' < ${srcdir}/UnicodeData.txt > $@
-${DSTDIR}/charprop.el: ${srcdir}/unidata-gen.elc unidata.txt
+compile: ${srcdir}/unidata-gen.elc
+
+## Depend on .el rather than .elc so as not to needlessly rebuild
+## uni-*.el files just because .elc is missing.
+## Same for UnicodeData.txt v unidata.txt.
+${DSTDIR}/charprop.el: ${srcdir}/unidata-gen.el ${srcdir}/UnicodeData.txt
+ ${MAKE} ${MFLAGS} compile unidata.txt EMACS="${EMACS}"
+ -if [ -f "$@" ]; then \
+ cd ${DSTDIR} && chmod +w charprop.el `sed -n 's/^;; FILE: //p' < charprop.el`; \
+ fi
${emacs} -L ${srcdir} -l unidata-gen -f unidata-gen-files \
${srcdir} "${DSTDIR}"
@@ -48,6 +59,8 @@ charprop.el: ${srcdir}/unidata-gen.elc unidata.txt
${emacs} -L ${srcdir} -l unidata-gen -f unidata-gen-files \
${srcdir}
+.PHONY: clean bootstrap-clean distclean maintainer-clean extraclean
+
install: charprop.el
cp charprop.el ${DSTDIR}
cp `sed -n 's/^;; FILE: //p' < charprop.el` ${DSTDIR}
@@ -61,6 +74,15 @@ clean:
bootstrap-clean: clean
distclean: clean
- -rm -f ./Makefile
+ rm -f Makefile
maintainer-clean: distclean
+
+## Do not remove these files, even in a bootstrap, because they rarely
+## change and it slows down bootstrap (a tiny bit).
+## Cf leim/ja-dic (which is much slower).
+extraclean:
+ if test -f ${DSTDIR}/charprop.el; then \
+ (cd ${DSTDIR} && rm -f `sed -n 's/^;; FILE: //p' < charprop.el`); \
+ rm -f ${DSTDIR}/charprop.el; \
+ fi
diff --git a/admin/unidata/unidata-gen.el b/admin/unidata/unidata-gen.el
index dd667f9571d..fa8f81636e3 100644
--- a/admin/unidata/unidata-gen.el
+++ b/admin/unidata/unidata-gen.el
@@ -194,8 +194,8 @@ Property value is an integer."
4 unidata-gen-table-symbol "uni-bidi.el"
"Unicode bidi class.
Property value is one of the following symbols:
- L, LRE, LRO, R, AL, RLE, RLO, PDF, EN, ES, ET,
- AN, CS, NSM, BN, B, S, WS, ON"
+ L, LRE, LRO, LRI, R, AL, RLE, RLO, RLI, FSI, PDF, PDI,
+ EN, ES, ET, AN, CS, NSM, BN, B, S, WS, ON"
unidata-describe-bidi-class
;; The assignment of default values to blocks of code points
;; follows the file DerivedBidiClass.txt from the Unicode
@@ -205,7 +205,8 @@ Property value is one of the following symbols:
(#xFB1D #xFB4F R) (#x10800 #x10FFF R) (#x1E800 #x1EFFF R))
;; The order of elements must be in sync with bidi_type_t in
;; src/dispextern.h.
- (L R EN AN BN B AL LRE LRO RLE RLO PDF ES ET CS NSM S WS ON))
+ (L R EN AN BN B AL LRE LRO RLE RLO PDF LRI RLI FSI PDI
+ ES ET CS NSM S WS ON))
(decomposition
5 unidata-gen-table-decomposition "uni-decomposition.el"
"Unicode decomposition mapping.
@@ -397,12 +398,17 @@ is the character itself.")))
;; If VAL is one of VALn, just return n.
;; Otherwise, VAL-LIST is modified to this:
;; ((nil . 0) (VAL1 . 1) (VAL2 . 2) ... (VAL . n+1))
+;;
+;; WARN is an optional warning to display when the value list is
+;; extended, for property values that need to be in sync with other
+;; parts of Emacs; currently only used for bidi-class.
-(defun unidata-encode-val (val-list val)
+(defun unidata-encode-val (val-list val &optional warn)
(let ((slot (assoc val val-list))
val-code)
(if slot
(cdr slot)
+ (if warn (message warn val))
(setq val-code (length val-list))
(nconc val-list (list (cons val val-code)))
val-code)))
@@ -413,6 +419,16 @@ is the character itself.")))
(let ((table (make-char-table 'char-code-property-table))
(prop-idx (unidata-prop-index prop))
(vec (make-vector 128 0))
+ ;; When this warning is printed, there's a need to make the
+ ;; following changes:
+ ;; (1) update unidata-prop-alist with the new bidi-class values;
+ ;; (2) extend bidi_type_t enumeration on src/dispextern.h to
+ ;; include the new classes;
+ ;; (3) possibly update the assertion in bidi.c:bidi_check_type; and
+ ;; (4) possibly update the switch cases in
+ ;; bidi.c:bidi_get_type and bidi.c:bidi_get_category.
+ (bidi-warning "\
+** Found new bidi-class '%s', please update bidi.c and dispextern.h")
tail elt range val val-code idx slot
prev-range-data)
(setq val-list (cons nil (copy-sequence val-list)))
@@ -438,7 +454,9 @@ is the character itself.")))
(setq elt (car tail) tail (cdr tail))
(setq range (car elt)
val (funcall val-func (nth prop-idx elt)))
- (setq val-code (if val (unidata-encode-val val-list val)))
+ (setq val-code (if val (unidata-encode-val val-list val
+ (and (eq prop 'bidi-class)
+ bidi-warning))))
(if (consp range)
(when val-code
(set-char-table-range table range val-code)
@@ -486,7 +504,9 @@ is the character itself.")))
(setq new-val (funcall val-func (nth prop-idx elt)))
(if (not (eq val new-val))
(setq val new-val
- val-code (if val (unidata-encode-val val-list val))))
+ val-code (if val (unidata-encode-val
+ val-list val (and (eq prop 'bidi-class)
+ bidi-warning)))))
(if val-code
(aset vec (- range start) val-code))
(setq tail (cdr tail)))
@@ -1241,6 +1261,7 @@ is the character itself.")))
";; coding: utf-8\n"
";; version-control: never\n"
";; no-byte-compile: t\n"
+ ";; no-update-autoloads: t\n"
";; End:\n\n"
(format ";; %s ends here\n" basename)))
(write-file file)
@@ -1250,6 +1271,7 @@ is the character itself.")))
";; coding: utf-8\n"
";; version-control: never\n"
";; no-byte-compile: t\n"
+ ";; no-update-autoloads: t\n"
";; End:\n\n"
(format ";; %s ends here\n"
(file-name-nondirectory charprop-file))))))
diff --git a/build-aux/msys-to-w32 b/build-aux/msys-to-w32
new file mode 100755
index 00000000000..e9a06d76732
--- /dev/null
+++ b/build-aux/msys-to-w32
@@ -0,0 +1,170 @@
+#!/bin/sh
+# Take a list of MSYS-compatible paths and convert them to native
+# MS-Windows format.
+# Status is zero if successful, nonzero otherwise.
+
+# Copyright (C) 2013 Free Software Foundation, Inc.
+
+# This program 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.
+
+# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Take only the basename from the full pathname
+me=${0//*\//}
+
+usage="usage: ${me} PATHLIST [MUSTEXIST] [SEPARATOR [SEPARATOR2]]"
+
+help="$usage
+ or: ${me} OPTION
+
+Convert MSYS-compatible paths to MS-Windows native format.
+
+PATHLIST should be a list of paths separated by SEPARATOR. This list
+will be written to the standard output after performing the following
+transformations:
+1. Discard empty paths.
+2. Replace backslashes with forward slashes.
+3. Replace two consecutive slashes with single ones.
+4. Translate to Windows-native format those paths that are not in such
+ format already. The translated paths will not end with a slash,
+ except for root directories (e.g. 'c:/' or 'c:/foo'). Paths
+ starting with '%emacs_dir%' will not be translated.
+5. Escape with backslashes every occurrence of SEPARATOR2 within the paths.
+6. Concatenate the translated paths with SEPARATOR2.
+
+If MUSTEXIST is 'Y' or not supplied, then each path in PATHLIST must
+exist. Otherwise, only some part of each path is required to exist
+(the deepest existing subpath will be translated and the remainder
+concatenated to the translation).
+
+If SEPARATOR is not supplied, PATHLIST will be regarded as a single
+path.
+
+If SEPARATOR2 is not supplied, it will take the same value as
+SEPARATOR.
+
+Options:
+ --help display this help and exit
+
+Report bugs to <bug-gnu-emacs@gnu.org>."
+
+for arg
+do
+ case $arg in
+ --help | --hel | --he | --h)
+ exec echo "$help" ;;
+ --)
+ shift
+ break ;;
+ -*)
+ echo "${me}: invalid option: $arg" >&2
+ exit 1 ;;
+ *)
+ break ;;
+ esac
+done
+
+{ test $# -ge 1 && test $# -le 4; } ||
+{ echo "${me}: $usage" >&2; exit 1; }
+
+# Arguments
+pathlist="$1"
+mustexist="${2:-Y}"
+separator="$3"
+separator2="${4:-${separator}}"
+
+# Split pathlist into its path components
+if test -n "$separator"
+then
+ IFS=${separator} patharray=( $pathlist )
+else
+ patharray=( "$pathlist" )
+fi
+
+w32pathlist=""
+
+for p in "${patharray[@]}"
+do
+ # Skip empty paths
+ test "$p" = "" && continue
+
+ # Replace '\' with '/' and '//' with '/'
+ p="${p//\\//}"
+ p="${p//\/\///}"
+
+ if test "${p:0:11}" = "%emacs_dir%"
+ then
+ # Paths starting with "%emacs_dir%" will not be translated
+ w32p=$p
+ elif test -d "$p"
+ then
+ # The path exists, so just translate it
+ w32p=`cd "$p" && pwd -W`
+ else
+ # The path does not exist. So, try to guess the
+ # Windows-native translation, by looking for the deepest
+ # existing directory in this path, and then translating the
+ # existing part and concatenating the remainder.
+
+ test "${mustexist}" = "Y" &&
+ { echo "${me}: invalid path: $p" >&2; exit 1; }
+
+ p1=$p
+ IFS=/ pcomponents=( $p )
+
+ for (( i=${#pcomponents[@]}-1 ; i>=0 ; i-- ))
+ do
+
+ if test "${pcomponents[i]}" = ""
+ then
+ # The path component is empty. This can only mean
+ # that the path starts with "/" and all components
+ # have been stripped out already. So in this case we
+ # want to test with the MSYS root directory
+ p1="/"
+ else
+ p1="${p1%/}"
+ p1="${p1%${pcomponents[i]}}"
+ fi
+
+ if test -d "${p1}"
+ then
+
+ # Existing path found
+
+ # Translate the existing part and concatenate the
+ # remainder (ensuring that only one slash is used in
+ # the join, and no trailing slash is left)
+ w32p1=`cd "${p1}" && pwd -W`
+ remainder="${p#${p1}}"
+ remainder="${remainder#/}"
+ remainder="${remainder%/}"
+ w32p="${w32p1%/}/${remainder}"
+
+ break
+ fi
+
+ done
+
+ # If no existing directory was found, error out
+ test -e "${p1}" ||
+ { echo "${me}: invalid path: ${p}" >&2; exit 1; }
+ fi
+
+ # Concatenate the translated path to the translated pathlist
+ test "${w32pathlist}" = "" || w32pathlist="${w32pathlist}${separator2}"
+ w32pathlist="${w32pathlist}${w32p//${separator2}/\\${separator2}}"
+
+done
+
+# Write the translated pathlist to the standard output
+printf "%s" "${w32pathlist}"
diff --git a/configure.ac b/configure.ac
index a9baf608bf3..46ddb43635c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,8 +80,7 @@ dnl hence the single quotes. This is per the GNU coding standards, see
dnl (autoconf) Installation Directory Variables
dnl See also epaths.h below.
lispdir='${datadir}/emacs/${version}/lisp'
-leimdir='${datadir}/emacs/${version}/leim'
-standardlisppath='${lispdir}:${leimdir}'
+standardlisppath='${lispdir}'
locallisppath='${datadir}/emacs/${version}/site-lisp:'\
'${datadir}/emacs/site-lisp'
lisppath='${locallisppath}:${standardlisppath}'
@@ -1683,7 +1682,6 @@ if test "${HAVE_NS}" = yes; then
infodir="\${ns_appresdir}/info"
mandir="\${ns_appresdir}/man"
lispdir="\${ns_appresdir}/lisp"
- leimdir="\${ns_appresdir}/leim"
INSTALL_ARCH_INDEP_EXTRA=
fi
@@ -1868,9 +1866,6 @@ to configure.])
fi
fi
-### We always support menus.
-HAVE_MENUS=yes
-
# Does the opsystem file prohibit the use of the GNU malloc?
# Assume not, until told otherwise.
GNU_MALLOC=yes
@@ -3837,12 +3832,22 @@ else
AC_DEFINE(NULL_DEVICE, ["/dev/null"])
fi
-AH_TEMPLATE(SEPCHAR, [Character that separates PATH elements.])
if test "${opsys}" = "mingw32"; then
- AC_DEFINE(SEPCHAR, [';'])
+ SEPCHAR=';'
else
- AC_DEFINE(SEPCHAR, [':'])
-fi
+ SEPCHAR=':'
+fi
+AC_DEFINE_UNQUOTED(SEPCHAR, ['$SEPCHAR'], [Character that separates PATH elements.])
+dnl This is for MinGW, and is used in test/automated/Makefile.in.
+dnl The MSYS Bash has heuristics for replacing ':' with ';' when it
+dnl decides that a command-line argument to be passed to a MinGW program
+dnl is a PATH-style list of directories. But that heuristics plays it
+dnl safe, and only does the replacement when it is _absolutely_ sure it
+dnl sees a colon-separated list of file names; e.g. ":." is left alone,
+dnl which breaks in-tree builds. So we do this manually instead.
+dnl Note that we cannot rely on PATH_SEPARATOR, as that one will always
+dnl be computed as ':' in MSYS Bash.
+AC_SUBST(SEPCHAR)
dnl Everybody supports this, except MS-DOS.
AC_DEFINE(subprocesses, 1, [Define to enable asynchronous subprocesses.])
@@ -4490,7 +4495,6 @@ AC_SUBST(libexecdir)
AC_SUBST(mandir)
AC_SUBST(infodir)
AC_SUBST(lispdir)
-AC_SUBST(leimdir)
AC_SUBST(standardlisppath)
AC_SUBST(locallisppath)
AC_SUBST(lisppath)
@@ -4598,61 +4602,29 @@ AC_SUBST(TOOLKIT_LIBW)
if test "${opsys}" != "mingw32"; then
if test "$USE_X_TOOLKIT" = "none"; then
LIBXT_OTHER="\$(LIBXSM)"
- OLDXMENU_TARGET="really-oldXMenu"
else
LIBXT_OTHER="\$(LIBXMU) -lXt \$(LIBXTR6) -lXext"
- OLDXMENU_TARGET="really-lwlib"
fi
fi
AC_SUBST(LIBXT_OTHER)
-## The X Menu stuff is present in the X10 distribution, but missing
-## from X11. If we have X10, just use the installed library;
-## otherwise, use our own copy.
if test "${HAVE_X11}" = "yes" ; then
AC_DEFINE(HAVE_X11, 1,
- [Define to 1 if you want to use version 11 of X windows.
- Otherwise, Emacs expects to use version 10.])
-
- if test "$USE_X_TOOLKIT" = "none"; then
- OLDXMENU="\${oldXMenudir}/libXMenu11.a"
- else
- OLDXMENU="\${lwlibdir}/liblw.a"
- fi
- LIBXMENU="\$(OLDXMENU)"
+ [Define to 1 if you want to use version 11 of X windows.])
LIBX_OTHER="\$(LIBXT) \$(LIBX_EXTRA)"
- OLDXMENU_DEPS="\${OLDXMENU} ../src/\${OLDXMENU}"
else
- ## For a syntactically valid Makefile; not actually used for anything.
- ## See comments in src/Makefile.in.
- OLDXMENU=nothing
- ## FIXME This case (!HAVE_X11 && HAVE_X_WINDOWS) is no longer possible(?).
- if test "${HAVE_X_WINDOWS}" = "yes"; then
- LIBXMENU="-lXMenu"
- else
- LIBXMENU=
- fi
LIBX_OTHER=
- OLDXMENU_DEPS=
fi
+AC_SUBST(LIBX_OTHER)
-if test "$HAVE_GTK" = "yes" || test "$HAVE_MENUS" != "yes"; then
- OLDXMENU_TARGET=
- OLDXMENU=nothing
+if test "$HAVE_GTK" = yes || test "$HAVE_X11" != yes; then
LIBXMENU=
- OLDXMENU_DEPS=
+elif test "$USE_X_TOOLKIT" = none; then
+ LIBXMENU='$(oldXMenudir)/libXMenu11.a'
+else
+ LIBXMENU='$(lwlibdir)/liblw.a'
fi
-
-AC_SUBST(OLDXMENU_TARGET)
-AC_SUBST(OLDXMENU)
AC_SUBST(LIBXMENU)
-AC_SUBST(LIBX_OTHER)
-AC_SUBST(OLDXMENU_DEPS)
-
-if test "${HAVE_MENUS}" = "yes" ; then
- AC_DEFINE(HAVE_MENUS, 1,
- [Define to 1 if you have mouse menus. (This is supported in all configurations, but the option to specify it remains.)])
-fi
if test "${GNU_MALLOC}" = "yes" ; then
AC_DEFINE(GNU_MALLOC, 1,
@@ -4999,13 +4971,12 @@ if test -f "$srcdir/$opt_makefile.in"; then
fi
-dnl admin/ may or may not be present.
-opt_makefile=admin/unidata/Makefile
-
-if test -f "$srcdir/$opt_makefile.in"; then
- SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $opt_makefile"
+dnl The admin/ directory used to be excluded from tarfiles.
+if test -d $srcdir/admin; then
+ SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES admin/unidata/Makefile admin/grammars/Makefile"
AC_CONFIG_FILES([admin/unidata/Makefile])
-fi
+ AC_CONFIG_FILES([admin/grammars/Makefile])
+fi dnl -d admin
SUBDIR_MAKEFILES_IN=`echo " ${SUBDIR_MAKEFILES}" | sed -e 's| | $(srcdir)/|g' -e 's|Makefile|Makefile.in|g'`
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 7f051e751e5..cf37ab25199 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,21 @@
+2013-11-30 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (distclean): Remove Makefile.
+
+2013-11-29 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * buffers.texi (Icomplete): Rename from Iswitchb and
+ rewrite accordingly.
+
+2013-11-23 Glenn Morris <rgm@gnu.org>
+
+ * cmdargs.texi (General Variables):
+ Empty elements in EMACSLOADPATH now mean the default load-path.
+
+2013-11-21 Glenn Morris <rgm@gnu.org>
+
+ * cmdargs.texi (Action Arguments): Use path-separator with -L.
+
2013-11-04 Glenn Morris <rgm@gnu.org>
* cmdargs.texi (Action Arguments): Mention that `-L :...' appends.
diff --git a/doc/emacs/Makefile.in b/doc/emacs/Makefile.in
index 9c4a90db4aa..527b2f7a77d 100644
--- a/doc/emacs/Makefile.in
+++ b/doc/emacs/Makefile.in
@@ -196,6 +196,7 @@ clean: mostlyclean
rm -f emacs-manual-${version}.tar*
distclean: clean
+ rm -f Makefile
## In the standalone tarfile, the clean rule runs this.
infoclean:
diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi
index 2d3ff5b05d8..2fadb7b4910 100644
--- a/doc/emacs/buffers.texi
+++ b/doc/emacs/buffers.texi
@@ -598,7 +598,7 @@ convenient to switch between buffers.
@menu
* Uniquify:: Making buffer names unique with directory parts.
-* Iswitchb:: Switching between buffers with substrings.
+* Icomplete:: Fast minibuffer selection.
* Buffer Menus:: Configurable buffer menu.
@end menu
@@ -641,39 +641,31 @@ buffer names before you type one. But as an experienced user, if you
know the rule, you won't have to look. And then you may find that one
rule or another is easier for you to remember and apply quickly.
-@node Iswitchb
-@subsection Switching Between Buffers using Substrings
-
-@findex iswitchb-mode
-@cindex Iswitchb mode
-@cindex mode, Iswitchb
-@kindex C-x b @r{(Iswitchb mode)}
-@kindex C-x 4 b @r{(Iswitchb mode)}
-@kindex C-x 5 b @r{(Iswitchb mode)}
-@kindex C-x 4 C-o @r{(Iswitchb mode)}
-
- Iswitchb global minor mode provides convenient switching between
-buffers using substrings of their names. It replaces the normal
-definitions of @kbd{C-x b}, @kbd{C-x 4 b}, @kbd{C-x 5 b}, and @kbd{C-x
-4 C-o} with alternative commands that are somewhat ``smarter''.
-
- When one of these commands prompts you for a buffer name, you can
-type in just a substring of the name you want to choose. As you enter
-the substring, Iswitchb mode continuously displays a list of buffers
-that match the substring you have typed.
-
- At any time, you can type @key{RET} to select the first buffer in
-the list. So the way to select a particular buffer is to make it the
+@node Icomplete
+@subsection Fast minibuffer selection
+
+@findex icomplete-mode
+@cindex Icomplete mode
+
+ Icomplete global minor mode provides a convenient way to quickly select an
+element among the possible completions in a minibuffer. When enabled, typing
+in the minibuffer continuously displays a list of possible completions that
+match the string you have typed.
+
+ At any time, you can type @key{C-j} to select the first completion in
+the list. So the way to select a particular completion is to make it the
first in the list. There are two ways to do this. You can type more
-of the buffer name and thus narrow down the list, excluding unwanted
-buffers above the desired one. Alternatively, you can use @kbd{C-s}
-and @kbd{C-r} to rotate the list until the desired buffer is first.
+of the completion name and thus narrow down the list, excluding unwanted
+completions above the desired one. Alternatively, you can use @kbd{C-.}
+and @kbd{C-,} to rotate the list until the desired buffer is first.
- @key{TAB} while entering the buffer name performs completion on the
-string you have entered, based on the displayed list of buffers.
+ @key{M-TAB} will select the first completion in the list, like @key{C-j} but
+without exiting the minibuffer, so you can edit it further. This is typically
+used when entering a file name, where @key{M-TAB} can be used a few times to
+descend in the hierarchy of directories.
- To enable Iswitchb mode, type @kbd{M-x iswitchb-mode}, or customize
-the variable @code{iswitchb-mode} to @code{t} (@pxref{Easy
+ To enable Icomplete mode, type @kbd{M-x icomplete-mode}, or customize
+the variable @code{icomplete-mode} to @code{t} (@pxref{Easy
Customization}).
@node Buffer Menus
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi
index d0f5f1e06b1..4294f775e5e 100644
--- a/doc/emacs/cmdargs.texi
+++ b/doc/emacs/cmdargs.texi
@@ -10,6 +10,7 @@
@cindex switches (command line)
@cindex startup (command line arguments)
@cindex invocation (command line arguments)
+@c FIXME: Document `--smid'? --xfq
Emacs supports command line arguments to request various actions
when invoking Emacs. These are for compatibility with other editors
@@ -141,6 +142,8 @@ relative order; i.e., using @samp{-L /foo -L /bar} results in
a @code{load-path} of the form @code{("/foo" "/bar" @dots{})}.
If @var{dir} begins with @samp{:}, Emacs removes the @samp{:} and
appends (rather than prepends) the remainder to @code{load-path}.
+(On MS Windows, use @samp{;} instead of @samp{:}; i.e., use
+the value of @code{path-separator}.)
@item -f @var{function}
@opindex -f
@@ -452,13 +455,16 @@ This is used to initialize the variable @code{data-directory}.
Directory for the documentation string file, which is used to
initialize the Lisp variable @code{doc-directory}.
@item EMACSLOADPATH
-A colon-separated list of directories@footnote{ Here and below,
+A colon-separated list of directories@footnote{Here and below,
whenever we say ``colon-separated list of directories'', it pertains
to Unix and GNU/Linux systems. On MS-DOS and MS-Windows, the
directories are separated by semi-colons instead, since DOS/Windows
-file names might include a colon after a drive letter.} to search for
-Emacs Lisp files. If set, it overrides the usual initial value of the
-@code{load-path} variable (@pxref{Lisp Libraries}).
+file names might include a colon after a drive letter.} to search for
+Emacs Lisp files. If set, it modifies the usual initial value of the
+@code{load-path} variable (@pxref{Lisp Libraries}). An empty element
+stands for the default value of @code{load-path}; e.g., using
+@samp{EMACSLOADPATH="/tmp:"} adds @file{/tmp} to the front of
+the default @code{load-path}.
@item EMACSPATH
A colon-separated list of directories to search for executable files.
If set, Emacs uses this in addition to @env{PATH} (see below) when
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index 68d431ac4bc..8d502645b3a 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -115,6 +115,7 @@ display editor. This manual describes how to edit with Emacs and
some of the ways to customize it; it corresponds to GNU Emacs version
@value{EMACSVER}.
+@c See `manual-html-mono' and `manual-html-node' in admin/admin.el.
@ifset WWW_GNU_ORG
@html
The homepage for GNU Emacs is at
@@ -501,7 +502,7 @@ Using Multiple Buffers
Convenience Features and Customization of Buffer Handling
* Uniquify:: Making buffer names unique with directory parts.
-* Iswitchb:: Switching between buffers with substrings.
+* Icomplete:: Fast minibuffer selection.
* Buffer Menus:: Configurable buffer menu.
Multiple Windows
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi
index b2cb5ee3d3b..e45189ba1d0 100644
--- a/doc/emacs/text.texi
+++ b/doc/emacs/text.texi
@@ -2011,8 +2011,8 @@ highlighting (@pxref{Font Lock}). Unlike Enriched mode, Font Lock
mode assigns text properties automatically, based on the current
buffer contents; those properties are not saved to disk.
- The file @file{etc/enriched.doc} in the Emacs distribution serves as
-an example of the features of Enriched mode.
+ The file @file{enriched.txt} in Emacs's @code{data-directory}
+serves as an example of the features of Enriched mode.
@menu
* Enriched Mode:: Entering and exiting Enriched mode.
diff --git a/doc/lispintro/ChangeLog b/doc/lispintro/ChangeLog
index 2e6164968c3..f9cdeda17b6 100644
--- a/doc/lispintro/ChangeLog
+++ b/doc/lispintro/ChangeLog
@@ -1,3 +1,12 @@
+2013-12-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ * emacs-lisp-intro.texi (Counting Words): Don't use ':' in xref
+ titles, as this isn't supported by Texinfo.
+
+2013-11-30 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (distclean): Remove Makefile.
+
2013-10-23 Glenn Morris <rgm@gnu.org>
* Makefile.in (install-dvi, install-html, install-pdf)
diff --git a/doc/lispintro/Makefile.in b/doc/lispintro/Makefile.in
index 9a643c004ed..9fca51861dc 100644
--- a/doc/lispintro/Makefile.in
+++ b/doc/lispintro/Makefile.in
@@ -113,6 +113,7 @@ clean: mostlyclean
rm -f emacs-lispintro-${version}.tar*
distclean: clean
+ rm -f Makefile
infoclean:
-cd $(buildinfodir) && rm -f eintr$(INFO_EXT) eintr$(INFO_EXT)-[1-9]
diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi
index 84c9d905487..d05cf3ec866 100644
--- a/doc/lispintro/emacs-lisp-intro.texi
+++ b/doc/lispintro/emacs-lisp-intro.texi
@@ -13544,7 +13544,7 @@ regexps. @xref{the-the, , @code{the-the} Duplicated Words Function}.
@end itemize
@node Counting Words
-@chapter Counting: Repetition and Regexps
+@chapter Counting via Repetition and Regexps
@cindex Repetition for word counting
@cindex Regular expressions for word counting
@@ -14428,7 +14428,7 @@ exclamation mark, and question mark. Do the same using recursion.
Our next project is to count the number of words in a function
definition. Clearly, this can be done using some variant of
-@code{@value{COUNT-WORDS}}. @xref{Counting Words, , Counting Words:
+@code{@value{COUNT-WORDS}}. @xref{Counting Words, , Counting via
Repetition and Regexps}. If we are just going to count the words in
one definition, it is easy enough to mark the definition with the
@kbd{C-M-h} (@code{mark-defun}) command, and then call
@@ -15602,7 +15602,7 @@ Let's write a function definition to do these tasks. We will use a
directory, checking what needs to be done; and we will use a recursive
call to repeat the actions on each sub-directory. The recursive
pattern is `accumulate'
-(@pxref{Accumulate, , Recursive Pattern: @emph{accumulate}}),
+(@pxref{Accumulate}),
using @code{append} as the combiner.
@ignore
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index f4fc1acfa69..f4f036f33ad 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,60 @@
+2013-12-04 Juri Linkov <juri@jurta.org>
+
+ * searching.texi (Search and Replace): Fix `unread-command-events'
+ and add ref.
+
+2013-12-03 Juri Linkov <juri@jurta.org>
+
+ * windows.texi (Choosing Window): Rename `no-display-ok' to
+ `allow-no-window'. (Bug#13594)
+
+2013-11-30 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (distclean): Remove Makefile.
+
+2013-11-29 Andreas Politz <politza@fh-trier.de>
+
+ * modes.texi (Imenu): Make it clear that sub-alist is the cdr
+ (Bug#14029).
+
+2013-11-27 Glenn Morris <rgm@gnu.org>
+
+ * loading.texi (Library Search):
+ * os.texi (Startup Summary): No more leim directory.
+
+2013-11-26 Glenn Morris <rgm@gnu.org>
+
+ * os.texi (Startup Summary): Update for leim-list being preloaded.
+
+2013-11-23 Brian Jenkins <brian@brianjenkins.org> (tiny change)
+
+ * frames.texi (Input Focus):
+ * hooks.texi (Standard Hooks): Mention focus-in-hook, focus-out-hook.
+
+2013-11-23 Glenn Morris <rgm@gnu.org>
+
+ * loading.texi (Library Search):
+ Empty elements in EMACSLOADPATH now mean the default load-path.
+
+2013-11-22 Glenn Morris <rgm@gnu.org>
+
+ * loading.texi (Library Search): Minor clarification.
+
+2013-11-20 Leo Liu <sdl.web@gmail.com>
+
+ * windows.texi (Choosing Window): Mention `no-display-ok'. (Bug#13594)
+
+2013-11-19 Xue Fuqiao <xfq.free@gmail.com>
+
+ * os.texi (File Notifications): Add an index.
+
+ * loading.texi (Loading): Add an cross-reference.
+
+2013-11-18 Xue Fuqiao <xfq.free@gmail.com>
+
+ * os.texi (Session Management, Desktop Notifications): Add some
+ indexes and a cross-reference.
+
2013-11-17 Xue Fuqiao <xfq.free@gmail.com>
* os.texi (Time Parsing):
diff --git a/doc/lispref/Makefile.in b/doc/lispref/Makefile.in
index e2cc9ac088a..d7348754657 100644
--- a/doc/lispref/Makefile.in
+++ b/doc/lispref/Makefile.in
@@ -169,6 +169,7 @@ clean: mostlyclean
rm -f emacs-lispref-${version}.tar*
distclean: clean
+ rm -f Makefile
infoclean:
-cd $(buildinfodir) && rm -f elisp$(INFO_EXT) elisp$(INFO_EXT)-[1-9] elisp$(INFO_EXT)-[1-9][0-9]
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index 4935534d6eb..01ced2bf6ab 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -1479,6 +1479,14 @@ The redirection lasts until @code{redirect-frame-focus} is called to
change it.
@end defun
+@defvar focus-in-hook
+This is a normal hook run when an Emacs frame gains input focus.
+@end defvar
+
+@defvar focus-out-hook
+This is a normal hook run when an Emacs frame loses input focus.
+@end defvar
+
@defopt focus-follows-mouse
This option is how you inform Emacs whether the window manager transfers
focus when the user moves the mouse. Non-@code{nil} says that it does.
diff --git a/doc/lispref/hooks.texi b/doc/lispref/hooks.texi
index 745393f8166..74adda1d495 100644
--- a/doc/lispref/hooks.texi
+++ b/doc/lispref/hooks.texi
@@ -115,6 +115,12 @@ Function to call to ``quit'' the current buffer.
@vindex delayed-warnings-hook
The command loop runs this soon after @code{post-command-hook} (q.v.).
+@item focus-in-hook
+@vindex focus-in-hook
+@itemx focus-out-hook
+@vindex focus-out-hook
+@xref{Input Focus}.
+
@item delete-frame-functions
@xref{Deleting Frames}.
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi
index 637057c99b0..0505b67961d 100644
--- a/doc/lispref/loading.texi
+++ b/doc/lispref/loading.texi
@@ -29,6 +29,8 @@ into a buffer and evaluated there. (Indeed, most code is tested this
way.) Most often, the forms are function definitions and variable
definitions.
+For on-demand loading of external libraries, @pxref{Dynamic Libraries}.
+
@menu
* How Programs Do Loading:: The @code{load} function and others.
* Load Suffixes:: Details about the suffixes that @code{load} tries.
@@ -268,16 +270,19 @@ is a directory something like
"/usr/local/share/emacs/@var{version}/lisp"
@end example
-followed by a similarly named @file{leim} directory. These
-directories contain the standard Lisp files that come with Emacs.
-If Emacs cannot find them, it will not start correctly.
+(In this and the following examples, replace @file{/usr/local} with
+the installation prefix appropriate for your Emacs.)
+These directories contain the standard Lisp files that come with
+Emacs. If Emacs cannot find them, it will not start correctly.
If you run Emacs from the directory where it was built---that is, an
executable that has not been formally installed---Emacs instead
-initializes @code{load-path} using the @file{lisp} and @file{leim}
-directories in the directory containing the sources from which it
-was built. If you built Emacs in a separate directory from the
-sources, it also adds those directories from the build directory.
+initializes @code{load-path} using the @file{lisp}
+directory in the directory containing the sources from which it
+was built.
+@c Though there should be no *.el files in builddir/lisp, so it's pointless.
+If you built Emacs in a separate directory from the
+sources, it also adds the lisp directories from the build directory.
(In all cases, elements are represented as absolute file names.)
@cindex site-lisp directories
@@ -306,25 +311,34 @@ directories, if they exist. Normally these directories do not contain
@file{site-lisp} directories.)
@cindex @env{EMACSLOADPATH} environment variable
-If the environment variable @env{EMACSLOADPATH} is set, it overrides
-the above initialization procedure. That is, Emacs initializes
-@code{load-path} based solely on the value of the environment
-variable. You must therefore include the directory containing the
-standard Lisp files, else Emacs will not function. In most
-situations, it is better to use the @option{-L} command-line option
-(see below) to add elements to @code{load-path}.
+If the environment variable @env{EMACSLOADPATH} is set, it modifies
+the above initialization procedure. Emacs initializes
+@code{load-path} based on the value of the environment variable.
The syntax of @env{EMACSLOADPATH} is the same as used for @code{PATH};
directory names are separated by @samp{:} (or @samp{;}, on some
-operating systems), and @samp{.} stands for the current default
-directory. Here is an example of how to set @env{EMACSLOADPATH}
-variable (from a @command{sh}-style shell):
+operating systems).
+@ignore
+@c AFAICS, does not (yet) work right to specify non-absolute elements.
+and @samp{.} stands for the current default directory.
+@end ignore
+Here is an example of how to set @env{EMACSLOADPATH} variable (from a
+@command{sh}-style shell):
@example
-export EMACSLOADPATH
-EMACSLOADPATH=/home/foo/.emacs.d/lisp:/usr/local/emacs/24.3/lisp
+export EMACSLOADPATH=/home/foo/.emacs.d/lisp:
@end example
+An empty element in the value of the environment variable, whether
+trailing (as in the above example), leading, or embedded, is replaced
+by the default value of @code{load-path} as determined by the standard
+initialization procedure. If there are no such empty elements, then
+@env{EMACSLOADPATH} specifies the entire @code{load-path}. You must
+include either an empty element, or the explicit path to the directory
+containing the standard Lisp files, else Emacs will not function.
+(Another way to modify @code{load-path} is to use the @option{-L}
+command-line option when starting Emacs; see below.)
+
For each directory in @code{load-path}, Emacs then checks to see if
it contains a file @file{subdirs.el}, and if so, loads it. The
@file{subdirs.el} file is created when Emacs is built/installed,
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 180fef7241d..dc643bda9c8 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -2483,7 +2483,7 @@ Selecting a special element performs:
A nested sub-alist element looks like this:
@example
-(@var{menu-title} @var{sub-alist})
+(@var{menu-title} . @var{sub-alist})
@end example
It creates the submenu @var{menu-title} specified by @var{sub-alist}.
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index 0cd9e1465dc..38ebcccb688 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -71,11 +71,12 @@ in their turn. The files @file{subdirs.el} are normally generated
automatically when Emacs is installed.
@item
-If the library @file{leim-list.el} exists, Emacs loads it. This
-optional library is intended for registering input methods; Emacs
-looks for it in @code{load-path} (@pxref{Library Search}), skipping
-those directories containing the standard Emacs libraries (since
-@file{leim-list.el} should not exist in those directories).
+It loads any @file{leim-list.el} that it finds in the @code{load-path}
+directories. This file is intended for registering input methods.
+The search is only for any personal @file{leim-list.el} files that you
+may have created; it skips the directories containing the standard Emacs
+libraries (these should contain only a single @file{leim-list.el} file,
+which is compiled into the Emacs executable).
@vindex before-init-time
@item
@@ -2244,6 +2245,7 @@ saved session to restore. For Emacs, this argument is @samp{--smid
@var{session}}.
@defvar emacs-save-session-functions
+@cindex session file
Emacs supports saving state via a hook called
@code{emacs-save-session-functions}. Emacs runs this hook when the
session manager tells it that the window system is shutting down. The
@@ -2283,11 +2285,13 @@ Emacs is restarted by the session manager.
@node Desktop Notifications
@section Desktop Notifications
@cindex desktop notifications
+@cindex notifications, on desktop
Emacs is able to send @dfn{notifications} on systems that support the
freedesktop.org Desktop Notifications Specification. In order to use
this functionality, Emacs must have been compiled with D-Bus support,
-and the @code{notifications} library must be loaded.
+and the @code{notifications} library must be loaded. @xref{Top, ,
+D-Bus,dbus,D-Bus integration in Emacs}.
@defun notifications-notify &rest params
This function sends a notification to the desktop via D-Bus,
@@ -2523,6 +2527,7 @@ specification prior to @samp{"1.0"}.
@node File Notifications
@section Notifications on File Changes
@cindex file notifications
+@cindex watch, for filesystem events
Several operating systems support watching of filesystems for changes
of files. If configured properly, Emacs links a respective library
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 15aa23f77ea..a5bd5ab719b 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -1770,10 +1770,9 @@ Do not take action for this question---in other words, ``no''.
Answer this question ``no'', and give up on the entire series of
questions, assuming that the answers will be ``no''.
-@c FIXME: Document ‘unread-comment-events’? --xfq
@item exit-prefix
Like @code{exit}, but add the key that was pressed to
-@code{unread-comment-events}.
+@code{unread-command-events} (@pxref{Event Input Misc}).
@item act-and-exit
Answer this question ``yes'', and give up on the entire series of
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 13c9ca53222..661860025f3 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -1842,7 +1842,10 @@ The constant @code{display-buffer-fallback-action}.
@noindent
Each action function is called in turn, passing the buffer as the
first argument and the combined action alist as the second argument,
-until one of the functions returns non-@code{nil}.
+until one of the functions returns non-@code{nil}. The caller can
+pass @code{(allow-no-window . t)} as an element of the action alist to
+indicate its readiness to handle the case of not displaying the
+buffer in a window.
The argument @var{action} can also have a non-@code{nil}, non-list
value. This has the special meaning that the buffer should be
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 6ea80e4be8d..5a7b301d5b0 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,30 @@
+2013-12-06 Bastien Guerry <bzg@gnu.org>
+
+ * org.texi: Don't include Emacs version within Org's version.
+
+2013-12-06 Nicolas Goaziou <n.goaziou@gmail.com>
+
+ * org.texi (Creating one-off styles): Use new export snippet
+ syntax.
+
+ * org.texi (Export settings): documentation describing how text
+ above the first heading is ignored when an :export: tag is in a
+ file.
+
+2013-12-05 Michael Albinus <michael.albinus@gmx.de>
+
+ * dbus.texi (Type Conversion): Clarify unibyte-ness of strings.
+
+2013-11-30 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (distclean): Remove Makefile.
+
+2013-11-20 era eriksson <era+emacsbugs@iki.fi>
+
+ * ses.texi (Quick Tutorial): New chapter. (Bug#14748)
+ (The Basics, Formulas): Copyedits.
+ (Resizing, Printer functions): Add index entries.
+
2013-11-17 Jay Belanger <jay.p.belanger@gmail.com>
* calc.texi (Customizing Calc): Mention new variable
diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in
index f43520e97a4..70fb05e23e3 100644
--- a/doc/misc/Makefile.in
+++ b/doc/misc/Makefile.in
@@ -842,7 +842,7 @@ clean: mostlyclean
rm -f emacs-misc-${version}.tar*
distclean: clean
-# rm -f Makefile
+ rm -f Makefile
## buildinfodir is relative to srcdir.
infoclean:
diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi
index 52c3c883cc8..1e887e02a30 100644
--- a/doc/misc/dbus.texi
+++ b/doc/misc/dbus.texi
@@ -1138,10 +1138,11 @@ The signal @code{PropertyModified}, discussed as example in
(@var{INTEGER} ((@var{STRING} @var{BOOL} @var{BOOL}) (@var{STRING} @var{BOOL} @var{BOOL}) @dots{}))
@end lisp
-@defun dbus-byte-array-to-string byte-array
+@defun dbus-byte-array-to-string byte-array &optional multibyte
If a D-Bus method or signal returns an array of bytes, which are known
to represent an UTF8 string, this function converts @var{byte-array}
-to the corresponding string. Example:
+to the corresponding string. The string is unibyte encoded, unless
+@var{multibyte} is non-@code{nil}. Example:
@lisp
(dbus-byte-array-to-string '(47 101 116 99 47 104 111 115 116 115))
@@ -1151,20 +1152,30 @@ to the corresponding string. Example:
@end defun
@defun dbus-unescape-from-identifier string
-Retrieve the original string from the encoded @var{string}.
-@var{string} must have been coded with
+Retrieve the original string from the encoded @var{string} as unibyte
+string. @var{string} must have been encoded with
@code{dbus-escape-as-identifier}. Example:
@lisp
(dbus-unescape-from-identifier "_30123abc_5fxyz_01_ff")
-@ifinfo
-@result{} "0123abc_xyz^Aÿ"
-@end ifinfo
-@ifnotinfo
-@result{} "0123abc_xyz^A@"y"
-@end ifnotinfo
+@result{} "0123abc_xyz\x01\xff"
@end lisp
+
+If the original string used in @code{dbus-escape-as-identifier} is a
+multibyte string, it cannot be expected that this function returns
+that string:
+
+@lisp
+(string-equal
+ (dbus-unescape-from-identifier
+ (dbus-escape-as-identifier "Grüß Göttin"))
+ "Grüß Göttin")
+
+@result{} nil
+@end lisp
+
+
@end defun
diff --git a/doc/misc/org.texi b/doc/misc/org.texi
index 5c416b65d77..015b519df6c 100644
--- a/doc/misc/org.texi
+++ b/doc/misc/org.texi
@@ -2,7 +2,7 @@
@c %**start of header
@setfilename ../../info/org
@settitle The Org Manual
-@set VERSION 8.2.3 (GNU Emacs 24.3)
+@set VERSION 8.2.4
@c Use proper quote and backtick for code sections in PDF output
@c Cf. Texinfo manual 14.2
@@ -10518,7 +10518,8 @@ clocktable.
The tags that select a tree for export (@code{org-export-select-tags}). The
default value is @code{:export:}. Within a subtree tagged with
@code{:export:}, you can still exclude entries with @code{:noexport:} (see
-below).
+below). When headlines are selectively exported with @code{:export:}
+anywhere in a file, text before the first headline is ignored.
@item EXCLUDE_TAGS
The tags that exclude a tree from export (@code{org-export-exclude-tags}).
@@ -12542,13 +12543,13 @@ file. The use of this feature is better illustrated with couple of examples.
@enumerate
@item Embedding ODT tags as part of regular text
-You can include simple OpenDocument tags by prefixing them with
-@samp{@@}. For example, to highlight a region of text do the following:
+You can inline OpenDocument syntax by enclosing it within
+@samp{@@@@odt:...@@@@} markup. For example, to highlight a region of text do
+the following:
@example
-@@<text:span text:style-name="Highlight">This is a
-highlighted text@@</text:span>. But this is a
-regular text.
+@@@@odt:<text:span text:style-name="Highlight">This is a highlighted
+text</text:span>@@@@. But this is a regular text.
@end example
@strong{Hint:} To see the above example in action, edit your
diff --git a/doc/misc/ses.texi b/doc/misc/ses.texi
index a44d790781d..8ac023b8135 100644
--- a/doc/misc/ses.texi
+++ b/doc/misc/ses.texi
@@ -66,6 +66,7 @@ To report bugs, use @kbd{M-x report-emacs-bug}.
@menu
* Sales Pitch:: Why use @acronym{SES}?
+* Quick Tutorial:: A quick introduction
* The Basics:: Basic spreadsheet commands
* Advanced Features:: Want to know more?
* For Gurus:: Want to know @emph{even more}?
@@ -98,6 +99,95 @@ To report bugs, use @kbd{M-x report-emacs-bug}.
@c ===================================================================
+@node Quick Tutorial
+@chapter Quick Tutorial
+@cindex introduction
+@cindex tutorial
+
+If you want to get started quickly and think that you know what to
+expect from a simple spreadsheet, this chapter may be all that you
+need.
+
+First, visit a new file with the @file{.ses} extension.
+Emacs presents you with an empty spreadsheet containing a single cell.
+
+Begin by inserting a headline: @kbd{"Income"@key{RET}}. The double
+quotes indicate that this is a text cell. (Notice that Emacs
+automatically inserts the closing quotation mark.)
+
+To insert your first income value, you must first resize the
+spreadsheet. Press @key{TAB} to add a new cell and navigate back up
+to it. Enter a number, such as @samp{2.23}. Then proceed to add a
+few more income entries, e.g.:
+
+@example
+@group
+A
+ Income
+ 2.23
+ 0.02
+ 15.76
+ -4.00
+@end group
+@end example
+
+To add up the values, enter a Lisp expression:
+
+@example
+(+ A2 A3 A4 A5)
+@end example
+
+Perhaps you want to add a cell to the right of cell A4 to explain
+why you have a negative entry. Pressing @kbd{TAB} in that cell
+adds an entire new column @samp{B}, where you can add such a note.
+
+The column is fairly narrow by default, but pressing @kbd{w} allows
+you to resize it as needed. Make it 20 characters wide. You can
+now add descriptive legends for all the entries, e.g.:
+
+@example
+@group
+A B
+ Income
+ 2.23 Consulting fee
+ 0.02 Informed opinion
+ 15.76 Lemonade stand
+ -4 Loan to Joe
+ 14.01 Total
+@end group
+@end example
+
+By default, the labels in column B are right-justified. To change
+that, you can enter a printer function for the whole column, using
+e.g., @kbd{M-p ("%s")}. You can override a column's printer function
+in any individual cell using @kbd{p}.
+
+If Joe pays back his loan, you might blank that entry; e.g., by
+positioning the cursor in cell A5 and pressing @kbd{C-d} twice.
+If you do that, the total cell will display @samp{######}. That is
+because the regular @code{+} operator does not handle a range that
+contains some empty cells. Instead of emptying the cell, you could
+enter a literal @samp{0}, or delete the entire row using @kbd{C-k}.
+An alternative is to use the special function @code{ses+} instead of
+the regular @code{+}:
+
+@example
+(ses+ A2 A3 A4 A5)
+@end example
+
+To make a formula robust against changes in the spreadsheet geometry,
+you can use the @code{ses-range} macro to refer to a range of cells by
+the end-points, e.g.:
+
+@example
+(apply 'ses+ (ses-range A2 A5))
+@end example
+
+(The @code{apply} is necessary because @code{ses-range} produces a
+@emph{list} of values. This allows for more complex possibilities.)
+
+@c ===================================================================
+
@node The Basics
@comment node-name, next, previous, up
@chapter The Basics
@@ -117,6 +207,7 @@ A @dfn{cell identifier} is a symbol with a column letter and a row
number. Cell B7 is the 2nd column of the 7th row. For very wide
spreadsheets, there are two column letters: cell AB7 is the 28th
column of the 7th row. Super wide spreadsheets get AAA1, etc.
+You move around with the regular Emacs movement commands.
@table @kbd
@item j
@@ -161,13 +252,17 @@ Highlight all cells (@code{mark-whole-buffer}).
@section Cell formulas
@cindex formulas
@cindex formulas, entering
+@cindex values
+@cindex cell values
+@cindex editing cells
@findex ses-read-cell
@findex ses-read-symbol
@findex ses-edit-cell
@findex ses-recalculate-cell
@findex ses-recalculate-all
-To enter a number into the current cell, just start typing:
+To insert a value into a cell, simply type a numeric expression,
+@samp{"double-quoted text"}, or a Lisp expression.
@table @kbd
@item 0..9
@@ -213,6 +308,13 @@ Recalculate the entire spreadsheet (@code{ses-recalculate-all}).
@node Resizing
@section Resizing the spreadsheet
@cindex resizing spreadsheets
+@cindex dimensions
+@cindex row, adding or removing
+@cindex column, adding or removing
+@cindex adding rows or columns
+@cindex inserting rows or columns
+@cindex removing rows or columns
+@cindex deleting rows or columns
@findex ses-insert-row
@findex ses-insert-column
@findex ses-delete-row
@@ -269,6 +371,8 @@ Undo previous action (@code{(undo)}).
@node Printer functions
@section Printer functions
@cindex printer functions
+@cindex cell formatting
+@cindex formatting cells
@findex ses-read-cell-printer
@findex ses-read-column-printer
@findex ses-read-default-printer
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 120f4d4db1c..71e86dcbc85 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,17 @@
+2013-11-23 Xue Fuqiao <xfq.free@gmail.com>
+
+ * TODO: Minor update.
+
+2013-11-23 Glenn Morris <rgm@gnu.org>
+
+ * enriched.txt: Rename from enriched.doc. (Bug#15947)
+ Misc small updates for this hardly being "new" any more.
+
+2013-11-20 Leo Liu <sdl.web@gmail.com>
+
+ * NEWS: Mention new display action alist entry `no-display-ok'.
+ (Bug#13594)
+
2013-11-18 Leo Liu <sdl.web@gmail.com>
* NEWS: Mention new features for Octave mode.
diff --git a/etc/NEWS b/etc/NEWS
index 5f6cf12fb24..f354f5ce2f7 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -63,8 +63,19 @@ To use the old backend by default, do on the command line:
* Startup Changes in Emacs 24.4
+++
+** When initializing `load-path', an empty element in the EMACSLOADPATH
+environment variable (either leading, e.g., ":/foo"; trailing, e.g.,
+"/foo:"; or embedded, e.g., "/foo::/bar") is replaced with the default
+load-path (the one that would have been used if EMACSLOADPATH was unset).
+This makes it easier to _extend_ the load-path via EMACSLOADPATH
+(previously, EMACSLOADPATH had to specify the complete load-path,
+including the defaults). (In older versions of Emacs, an empty element
+was replaced by ".", so use an explicit "." now if that is what you want.)
+
++++
** The -L option, which normally prepends its argument to load-path,
-will instead append, if the argument begins with `:'.
+will instead append, if the argument begins with `:' (or `;' on MS Windows;
+i.e., `path-separator').
* Changes in Emacs 24.4
@@ -160,10 +171,13 @@ monitor, use the new functions above. Similar notes also apply to
`x-display-pixel-width', `x-display-pixel-height', `display-mm-width',
`display-mm-height', `x-display-mm-width', and `x-display-mm-height'.
-** New macro `alternatives-define' can be used to define generic commands.
+** New macro `define-alternatives' can be used to define generic commands.
Generic commands are interactive functions whose implementation can be
selected among several alternatives, as a matter of user preference.
+** New hooks `focus-in-hook', `focus-out-hook'.
+These are normal hooks run when an Emacs frame gains or loses input focus.
+
** The blink cursor stops blinking after 10 blinks (default) on X and NS.
You can change the default by customizing the variable blink-cursor-blinks.
Also timers for blinking are stopped when no blinking is done, so Emacs does
@@ -189,6 +203,10 @@ Czech typography rules. To globally enable this feature, evaluate:
* Editing Changes in Emacs 24.4
+** `electric-indent-mode' is enabled by default.
+
+** Uniquify is enabled by default.
+
** Command `rectangle-mark-mode' bound to C-x SPC makes a rectangular region.
Most commands are still unaware of it, but kill/yank do work on the rectangle.
@@ -229,6 +247,8 @@ You can pick the name of the function and the variables with `C-x 4 a'.
* Changes in Specialized Modes and Packages in Emacs 24.4
+** The backtrace debugger can display local vars with `v'.
+
** prolog-use-smie has been removed, along with the non-SMIE indentation code.
** SMIE indentation can be customized via `smie-config'.
@@ -625,6 +645,22 @@ whether it is safe to use Bash's --noediting option. These days
+++
** There is a new macro `skip-unless' for skipping ERT tests. See the manual.
+** Imenu
+
+*** New option `imenu-generic-skip-comments-and-strings'.
+
+** Ruby mode
+
+*** New option `ruby-encoding-magic-comment-style'.
+
+*** New option `ruby-custom-encoding-magic-comment-template'.
+
+*** New mode menu.
+
+*** Improved syntax highlighting and indentation.
+
+*** Add more Ruby file types to `auto-mode-alist'.
+
* New Modes and Packages in Emacs 24.4
@@ -717,6 +753,8 @@ for something (not just adding elements to it), it ought not to affect you.
* Lisp Changes in Emacs 24.4
+** New function get-pos-property.
+
** New hook `pre-redisplay-function'.
+++
@@ -736,8 +774,8 @@ frame.
*** `bool-vector-set-difference'
*** `bool-vector-not'
*** `bool-vector-subsetp'
-*** `bool-vector-count-matches'
-*** `bool-vector-count-matches-at'
+*** `bool-vector-count-consecutive'
+*** `bool-vector-count-population'
** Comparison functions =, <, >, <=, >= now take many arguments.
@@ -755,6 +793,13 @@ frame.
** New library helpers.el for misc helper functions
*** `hash-table-keys'
*** `hash-table-values'
+*** `string-blank-p`
+*** `string-empty-p`
+*** `string-join`
+*** `string-reverse`
+*** `string-trim-left'
+*** `string-trim-right'
+*** `string-trim'
** Obsoleted functions:
*** `log10'
@@ -772,10 +817,15 @@ The few hooks that used with-wrapper-hook are replaced as follows:
*** `completion-in-region-function' obsoletes `completion-in-region-functions'.
*** `filter-buffer-substring-function' obsoletes `filter-buffer-substring-functions'.
+** `byte-compile-interactive-only-functions' is now obsolete.
+It has been replaced by the symbol property 'interactive-only.
+
** `split-string' now takes an optional argument TRIM.
The value, if non-nil, is a regexp that specifies what to trim from
the start and end of each substring.
+** New function `string-suffix-p'.
+
** `get-upcase-table' is obsoleted by the new `case-table-get-table'.
** Support for filesystem notifications.
@@ -1806,6 +1856,13 @@ reused.
*** New option `switch-to-buffer-preserve-window-point' to restore a
window's point when switching buffers.
+*** New display action function `display-buffer-no-window' to not
+display the buffer in a window.
+
+*** New display action alist entry `allow-no-window' to indicate the
+caller of `display-buffer' is ready to handle the case of not
+displaying the buffer in a window.
+
*** New display action alist entries `window-height' and `window-width'
specify the size of new windows created by `display-buffer'.
diff --git a/etc/TODO b/etc/TODO
index d798adb1436..87e8ed57d5c 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -203,7 +203,7 @@ http://lists.gnu.org/archive/html/emacs-devel/2008-08/msg00456.html
** "Emacs as word processor"
http://lists.gnu.org/archive/html/emacs-devel/2013-11/msg00515.html
rms writes:
- 25 years ago I hoped we would extend Emacs to do WYSIWG word
+ 25 years ago I hoped we would extend Emacs to do WYSIWYG word
processing. That is why we added text properties and variable
width fonts. However, more features are still needed to achieve this.
@@ -544,8 +544,8 @@ rather than interactively. This a trivial one-liner in easy-mode.el.
aim for completeness, but some may be worth documenting.
Here's a list which is probably not complete/correct: align, allout,
- artist, ansi-color, array, battery, calculator, cdl, cmuscheme,
- completion, cua, delim-col, dirtrack, double, echistory, elide-head,
+ artist, ansi-color, array, calculator, cdl, cmuscheme,
+ completion, delim-col, dirtrack, double, echistory, elide-head,
easymenu, expand, flow-ctrl, format [format-alist],
generic/generic-x [various modes], kermit, log-edit,
makesum, midnight [other than in Kill Buffer node],
@@ -554,7 +554,7 @@ rather than interactively. This a trivial one-liner in easy-mode.el.
the web page], talk, thingatpt [interactive functions?], type-break,
vcursor, xscheme, zone-mode [?], mlconvert [?], iso-cvt,
feedmail [?], uce, gametree, meese, page-ext,
- refbib, refer, scribe, sgml-mode, spell, texinfo, underline,
+ refbib, refer, scribe, spell [obsolete?], texinfo, underline,
cmacexp, hideif, mantemp [obsolete?], pcomplete, xml,
cvs-status (should be described in PCL-CVS manual); other progmodes,
probably in separate manual.
diff --git a/etc/enriched.doc b/etc/enriched.txt
index 4ce34dd26e1..21d8481dce8 100644
--- a/etc/enriched.doc
+++ b/etc/enriched.txt
@@ -10,10 +10,10 @@ Text-Width: 70
-<indent>Emacs now has the ability to edit <italic>enriched text</italic>, which is text
-containing faces, colors, indentation, and other properties. This
-document is a quick introduction to some of the new features, and
-is also an example file in the <italic>text/enriched </italic>format.</indent>
+<indent>Emacs has the ability to edit <italic>enriched text</italic>, which is text
+containing faces, colors, indentation, and other properties.
+This document is a quick introduction to some of the features,
+and is also an example file in the <italic>text/enriched </italic>format.</indent>
<x-bg-color><param>blue</param><x-color><param>white</param><bold>INSTALLATION and STARTUP</bold></x-color></x-bg-color>
@@ -71,7 +71,7 @@ the right margin, fully justified, centered, or left alone).</indent>
<x-bg-color><param>blue</param><x-color><param>white</param><bold>FACES and COLORS</bold></x-color></x-bg-color>
-<indent>You can add faces either with the menu or with <fixed>M-g.</fixed> The face is
+<indent>You can add faces either with the menu or with <fixed>M-o.</fixed> The face is
applied to the current region. If you are using
`transient-mark-mode' and the region is not active, then the face
applies to whatever you type next. Any face can have colors. If
@@ -175,16 +175,8 @@ all of the features of your document, but they will get as close
as possible.
-The MIME standard is defined in </indent>Internet<indent> RFC 1521; text/enriched
-is defined in RFC 1563. Details on obtaining these documents via
-FTP or email may be obtained by sending an email message to
-<fixed>rfc-info@isi.edu</fixed> with the message body:
-
-
-<fixed><indent>help: ways_to_get_rfcs</indent></fixed>
-
-
-<indent>See also the newsgroup <fixed>comp.mail.mime</fixed>.</indent></indent>
+The text/enriched standard is defined in </indent>Internet<indent> RFC 1896
+(<<http://www.ietf.org/rfc/rfc1896.txt>).</indent></indent>
<x-bg-color><param>blue</param><x-color><param>white</param><bold>CUSTOMIZATION</bold></x-color></x-bg-color><bold>
@@ -198,16 +190,15 @@ enriched-verbose.
</fixed></indent>-<indent> You can add annotations for your own text properties by making
additions to <fixed>enriched-translations</fixed>. Note that the standard
requires you to name your annotation starting<italic> "x-" </italic>(as in
-<italic>"x-read-only"</italic>). Please send me any such additions that you
-think might be of general interest so that I can include them
-in the distribution.</indent>
+<italic>"x-read-only"</italic>). Please report any such additions that you
+think might be of general interest using <fixed>M-x report-emacs-bug</fixed>.</indent>
</indent>
-<x-bg-color><param>blue</param><x-color><param>white</param><bold>TO-DO LIST</bold></x-color></x-bg-color>
+<x-bg-color><param>blue</param><x-color><param>white</param><bold>TODO LIST</bold></x-color></x-bg-color>
-<italic><indent>[Feel free to work on these and send me the results!]</indent></italic><indent>
+<italic><indent>[Feel free to work on these and send us the results!]</indent></italic><indent>
+ Conform to updated text/enriched spec in RFC 1896.
@@ -238,22 +229,15 @@ it.</indent>
+ Support more formats: RTF, HTML...
-+ Use Emacs 21 display features.
++ Use modern Emacs display features.
</indent>
-<x-bg-color><param>blue</param><x-color><param>white</param><bold>Final Notes:</bold></x-color></x-bg-color>
-
-
-<indent>This code and documentation is under development. Comments and
-bug reports are welcome.</indent>
+<x-bg-color><param>blue</param><x-color><param>white</param><bold>Original Author:</bold></x-color></x-bg-color>
<bold><x-color><param>white</param><x-bg-color><param>blue</param>Boris Goldowsky</x-bg-color></x-color><x-color><param>light blue</param> </x-color></bold><x-color><param>light blue</param><fixed><<boris@gnu.ai.mit.edu></fixed></x-color><x-color><param>blue</param>
-</x-color><x-bg-color><param>blue</param><x-color><param>white</param>April 1995; updated August 1997</x-color></x-bg-color>
-
-
Copyright (C) 1995, 1997, 2001-2013 Free Software Foundation, Inc.
diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex
index 0e19d32a1a7..3956ffaac90 100644
--- a/etc/refcards/orgcard.tex
+++ b/etc/refcards/orgcard.tex
@@ -1,5 +1,5 @@
% Reference Card for Org Mode
-\def\orgversionnumber{8.2.3}
+\def\orgversionnumber{8.2.4}
\def\versionyear{2013} % latest update
\input emacsver.tex
diff --git a/leim/ChangeLog b/leim/ChangeLog
index 6b16d71c215..31b9c376903 100644
--- a/leim/ChangeLog
+++ b/leim/ChangeLog
@@ -1,3 +1,37 @@
+2013-11-28 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (${leimdir}/leim-list.el):
+ * leim-ext.el: Change method for getting comments in the output
+ to one that does not fool lisp/compile-main's no-byte-compile test.
+
+2013-11-27 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (bootstrap-clean): No need to delete .elc,
+ lisp/ rules will do that.
+
+ * Makefile.in (extraclean): New.
+ (bootstrap-clean): Move ja-dic deletion to extraclean.
+
+ Move ja-dic, quail, leim-list.el to ../lisp/leim.
+ * Makefile.in (leimdir): New variable.
+ (TIT_GB, TIT_BIG5, MISC, changed.tit, changed.misc)
+ (${leimdir}/leim-list.el, ${leimdir}/ja-dic/ja-dic.el):
+ Generate in $leimdir.
+ (all): Remove compilation, add ja-dic.
+ (leim-list.el): Now PHONY.
+ (setwins, compile-targets, compile-main, clean, mostlyclean)
+ (extraclean): Remove.
+ (bootstrap-clean): Delete all generated files.
+ * README: Update for moved leim/ directory.
+ * leim-ext.el (ucs-input-activate, hangul-input-method-activate):
+ Remove manual autoloads; now in loaddefs.el.
+ Disable byte-compile, version-control, autoloads in the output.
+ * quail: Move to ../lisp/leim.
+
+2013-11-23 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (RUN_EMACS): Empty EMACSLOADPATH rather than unsetting.
+
2013-11-04 Eli Zaretskii <eliz@gnu.org>
* Makefile.in (RUN_EMACS): Don't set LC_ALL=C. (Bug#15260)
diff --git a/leim/Makefile.in b/leim/Makefile.in
index a5c05d567ec..383c521504f 100644
--- a/leim/Makefile.in
+++ b/leim/Makefile.in
@@ -26,58 +26,54 @@ SHELL = @SHELL@
# Here are the things that we expect ../configure to edit.
srcdir=@srcdir@
+# Where the generated files go.
+leimdir = ${srcdir}/../lisp/leim
+
# Which Emacs to use to convert TIT files to Emacs Lisp files,
-# byte-compile Emacs Lisp files, and generate the file leim-list.el.
+# and generate the file leim-list.el.
EMACS = ../src/emacs
# How to run Emacs.
# Prevent any setting of EMACSLOADPATH in user environment causing problems.
-RUN_EMACS = unset EMACSLOADPATH; "${EMACS}" -batch \
- --no-site-file --no-site-lisp
+RUN_EMACS = EMACSLOADPATH= "${EMACS}" -batch --no-site-file --no-site-lisp
MKDIR_P = @MKDIR_P@
# Files generated from TIT dictionaries for Chinese GB character set.
TIT_GB=\
- quail/CCDOSPY.el \
- quail/Punct.el \
- quail/QJ.el \
- quail/SW.el \
- quail/TONEPY.el
+ ${leimdir}/quail/CCDOSPY.el \
+ ${leimdir}/quail/Punct.el \
+ ${leimdir}/quail/QJ.el \
+ ${leimdir}/quail/SW.el \
+ ${leimdir}/quail/TONEPY.el
# Files generated from TIT dictionaries for Chinese BIG5 character set.
TIT_BIG5=\
- quail/4Corner.el \
- quail/ARRAY30.el \
- quail/ECDICT.el \
- quail/ETZY.el \
- quail/Punct-b5.el \
- quail/PY-b5.el \
- quail/QJ-b5.el \
- quail/ZOZY.el
+ ${leimdir}/quail/4Corner.el \
+ ${leimdir}/quail/ARRAY30.el \
+ ${leimdir}/quail/ECDICT.el \
+ ${leimdir}/quail/ETZY.el \
+ ${leimdir}/quail/Punct-b5.el \
+ ${leimdir}/quail/PY-b5.el \
+ ${leimdir}/quail/QJ-b5.el \
+ ${leimdir}/quail/ZOZY.el
CHINESE_TIT=${TIT_GB} ${TIT_BIG5}
MISC= \
- quail/tsang-b5.el \
- quail/quick-b5.el \
- quail/tsang-cns.el \
- quail/quick-cns.el \
- quail/PY.el \
- quail/ZIRANMA.el \
- quail/CTLau.el \
- quail/CTLau-b5.el
+ ${leimdir}/quail/tsang-b5.el \
+ ${leimdir}/quail/quick-b5.el \
+ ${leimdir}/quail/tsang-cns.el \
+ ${leimdir}/quail/quick-cns.el \
+ ${leimdir}/quail/PY.el \
+ ${leimdir}/quail/ZIRANMA.el \
+ ${leimdir}/quail/CTLau.el \
+ ${leimdir}/quail/CTLau-b5.el
## The generated .el files.
TIT_MISC=${CHINESE_TIT} ${MISC}
-.SUFFIXES: .elc .el
-
-.el.elc:
- @echo Compiling $<
- @${RUN_EMACS} -l international/quail -f batch-byte-compile $<
-
-all: leim-list.el compile-main
+all: ${leimdir}/leim-list.el ${leimdir}/ja-dic/ja-dic.el
.PHONY: all
TIT_SOURCES= \
@@ -107,10 +103,10 @@ ${CHINESE_TIT}: changed.tit
## quail/%.el: CXTERM-DIC/%.tit
## It doesn't seem possible to do this with VPATH and suffix rules.
changed.tit: ${TIT_SOURCES}
- @${MKDIR_P} quail
+ @${MKDIR_P} ${leimdir}/quail
${RUN_EMACS} -l titdic-cnv \
- -f batch-titdic-convert -dir quail ${srcdir}/CXTERM-DIC; \
- echo "changed" > $@
+ -f batch-titdic-convert -dir ${leimdir}/quail ${srcdir}/CXTERM-DIC
+ echo "changed" > $@
MISC_SOURCES= \
${srcdir}/MISC-DIC/CTLau-b5.html \
@@ -124,75 +120,41 @@ ${MISC}: changed.misc
@true
changed.misc: ${MISC_SOURCES}
- @${MKDIR_P} quail
+ @${MKDIR_P} ${leimdir}/quail
${RUN_EMACS} -l titdic-cnv \
- -f batch-miscdic-convert -dir quail ${srcdir}/MISC-DIC; \
- echo "changed" > $@
-
-leim-list.el: ${TIT_MISC} ${srcdir}/leim-ext.el
- rm -f leim-list.el
- if [ "`cd ${srcdir} && /bin/pwd`" = "`/bin/pwd`" ] ; then \
- ${RUN_EMACS} -l international/quail \
- --eval "(update-leim-list-file \".\")" ; \
- else \
- ${RUN_EMACS} -l international/quail \
- --eval "(update-leim-list-file \".\" (unmsys--file-name \"${srcdir}\"))" ; \
- fi
- sed -n '/^[^;]/ p' < ${srcdir}/leim-ext.el >> $@
-
-$(srcdir)/ja-dic/ja-dic.el: $(srcdir)/SKK-DIC/SKK-JISYO.L
- @$(MKDIR_P) $(srcdir)/ja-dic
+ -f batch-miscdic-convert -dir ${leimdir}/quail ${srcdir}/MISC-DIC
+ echo "changed" > $@
+
+.PHONY: leim-list.el
+leim-list.el: ${leimdir}/leim-list.el
+
+${leimdir}/leim-list.el: ${TIT_MISC} ${srcdir}/leim-ext.el
+ rm -f $@
+ ${RUN_EMACS} -l international/quail \
+ --eval "(update-leim-list-file (unmsys--file-name \"${leimdir}\"))"
+ sed -n -e '/^[^;]/p' -e 's/^;\(;*\)inc /;\1 /p' < ${srcdir}/leim-ext.el >> $@
+
+${leimdir}/ja-dic/ja-dic.el: $(srcdir)/SKK-DIC/SKK-JISYO.L
+ @$(MKDIR_P) $(leimdir)/ja-dic
$(RUN_EMACS) -batch -l ja-dic-cnv \
- -f batch-skkdic-convert -dir "$(srcdir)/ja-dic" \
+ -f batch-skkdic-convert -dir "$(leimdir)/ja-dic" \
"$(srcdir)/SKK-DIC/SKK-JISYO.L"
-## Following adapted from lisp/Makefile.in.
-setwins=wins="${srcdir}/ja-dic quail"; \
- [ "`cd ${srcdir} && /bin/pwd`" != "`/bin/pwd`" ] && \
- wins="$$wins ${srcdir}/quail"
-
-.PHONY: compile-targets
-# TARGETS is set dynamically in the recursive call from `compile-main'.
-compile-targets: $(TARGETS)
-
-# Compile all the Elisp files that need it. Beware: it approximates
-# `no-byte-compile', so watch out for false-positives!
-.PHONY: compile-main
-compile-main: ${TIT_MISC} $(srcdir)/ja-dic/ja-dic.el
- @($(setwins); \
- els=`echo "$$wins " | sed -e 's| |/*.el |g'`; \
- for el in $$els; do \
- test -f $$el || continue; \
- test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \
- echo "$${el}c"; \
- done | xargs echo) | \
- while read chunk; do \
- $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \
- done
-
-.PHONY: clean mostlyclean bootstrap-clean distclean maintainer-clean extraclean
-
-clean mostlyclean:
- rm -f ${TIT_MISC} ${TIT_MISC:.el=.elc} \
- leim-list.el changed.tit changed.misc
-
-# The following target is needed because the `clean' target only removes
-# TIT-generated files and doesn't touch compiled Quail packages. But
-# bootstrapping should not leave non-fresh .elc files behind.
-bootstrap-clean: clean
- $(setwins); for w in $$wins; do rm -f $$w/*.elc; done
-
-distclean: clean
- -[ "`cd ${srcdir} && /bin/pwd`" != "`/bin/pwd`" ] && rm -rf quail
+.PHONY: bootstrap-clean distclean maintainer-clean extraclean
+
+bootstrap-clean:
+ rm -f ${TIT_MISC} ${leimdir}/leim-list.el changed.tit changed.misc
+
+distclean:
rm -f Makefile
maintainer-clean: distclean bootstrap-clean
-extraclean: maintainer-clean
- -rm -f *~ \#* */*~ */\#*
-
-.PHONY: check-declare
+## We do not delete ja-dic, even in a bootstrap, because it rarely
+## changes and is slow to regenerate.
+## TODO? Could consider doing the same with TIT_MISC, though those
+## are much faster to generate.
+extraclean:
+ rm -rf ${leimdir}/ja-dic
-check-declare:
- $(RUN_EMACS) -l check-declare \
- --eval '(check-declare-directory (unmsys--file-name "$(srcdir)"))'
+### Makefile.in ends here
diff --git a/leim/README b/leim/README
index f1075872f77..c9c5447bd64 100644
--- a/leim/README
+++ b/leim/README
@@ -20,24 +20,22 @@ This directory contains various dictionaries for Chinese input
methods. These dictionaries are automatically converted to Quail
packages (Emacs Lisp source files) by `make'.
-quail:
-
-This directory contains Emacs Lisp source files for Quail packages.
-
SKK-DIC:
This directory contains source dictionary for Japanese input method
-distributed with SKK (Japanese input method run with Mule). But, you
-don't need this file because we distribute an Emacs Lisp source file
-ja-dic/ja-dic.el which has already been converted from the source
-dictionary (See below).
+distributed with SKK (Japanese input method run with Mule).
+
+
+The above source files are used to generate the following outputs:
+
+../lisp/leim/quail:
+
+This directory contains Emacs Lisp source files for Quail packages.
-ja-dic:
+../lisp/leim/ja-dic:
-This directory contains Emacs Lisp source file ja-dic.el which is
-generated from a source dictionary in SKK-DIC directory. The
-inclusion of this file is for users convenience because it takes
-rather long time to generate it.
+This directory contains Emacs Lisp source file ja-dic.el,
+generated from a source dictionary in SKK-DIC directory.
This file is part of GNU Emacs.
diff --git a/leim/leim-ext.el b/leim/leim-ext.el
index 8209026ddbd..0f92fd6c645 100644
--- a/leim/leim-ext.el
+++ b/leim/leim-ext.el
@@ -37,21 +37,9 @@
(eval-after-load "quail/Punct-b5"
'(quail-defrule " " ?  nil t))
-(autoload 'ucs-input-activate "quail/uni-input"
- "Activate UCS input method.
-With arg, activate UCS input method if and only if arg is positive.
-
-While this input method is active, the variable
-`input-method-function' is bound to the function `ucs-input-method'.")
-
(register-input-method "ucs" "UTF-8" 'ucs-input-activate "U+"
"Unicode input as hex in the form Uxxxx.")
-(autoload 'hangul-input-method-activate "quail/hangul"
- "Activate Hangul input method INPUT-METHOD.
-FUNC is a function to handle input key.
-HELP-TEXT is a text set in `hangul-input-method-help-text'.")
-
(register-input-method
"korean-hangul"
"UTF-8"
@@ -88,3 +76,17 @@ HELP-TEXT is a text set in `hangul-input-method-help-text'.")
'hangul390-input-method
"Input method: korean-hangul390 (mode line indicator:한390)\n\nHangul 3-Bulsik 390 input method.")
+;; Following lines are marked such that Makefile adds them to output.
+;; leim-list-header adds "coding: utf-8"; we could move that here,
+;; unless others are using that stuff to generate their own leim files.
+;; TODO? Better to add leim-list-footer?
+
+;;inc Local Variables:
+;;inc no-byte-compile: t
+;;inc version-control: never
+;;inc no-update-autoloads: t
+;;inc End:
+
+;;;inc leim-list.el ends here
+
+;;; leim-ext.el ends here
diff --git a/lib/getgroups.c b/lib/getgroups.c
index e71b5439c7e..482b24a788e 100644
--- a/lib/getgroups.c
+++ b/lib/getgroups.c
@@ -43,6 +43,21 @@ getgroups (int n _GL_UNUSED, GETGROUPS_T *groups _GL_UNUSED)
# define GETGROUPS_ZERO_BUG 0
# endif
+/* On OS X 10.6 and later, use the usual getgroups, not the one
+ supplied when _DARWIN_C_SOURCE is defined. _DARWIN_C_SOURCE is
+ normally defined, since it means "conform to POSIX, but add
+ non-POSIX extensions even if that violates the POSIX namespace
+ rules", which is what we normally want. But with getgroups there
+ is an inconsistency, and _DARWIN_C_SOURCE means "change getgroups()
+ so that it no longer works right". The BUGS section of compat(5)
+ says that the behavior is dubious if you compile different sections
+ of a program with different _DARWIN_C_SOURCE settings, so fix only
+ the offending symbol. */
+# ifdef __APPLE__
+int posix_getgroups (int, gid_t []) __asm ("_getgroups");
+# define getgroups posix_getgroups
+# endif
+
/* On at least Ultrix 4.3 and NextStep 3.2, getgroups (0, NULL) always
fails. On other systems, it returns the number of supplemental
groups for the process. This function handles that special case
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f0ea7a93526..5cac769f01b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,678 @@
+2013-12-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * net/shr.el (shr-tag-img): Don't bug out on <img src="">
+ data.
+
+2013-12-06 Michael Albinus <michael.albinus@gmx.de>
+
+ * progmodes/compile.el (compilation-start):
+ * progmodes/grep.el (rgrep): Revert change 2012-12-20T11:15:38Z!michael.albinus@gmx.de.
+
+ * net/tramp-sh.el (tramp-sh-handle-start-file-process):
+ Handle long command lines, lasting from "sh -c ...". (Bug#16045)
+
+2013-12-06 Dmitry Gutov <dgutov@yandex.ru>
+
+ * progmodes/ruby-mode.el (ruby-syntax-propertize-function): Touch
+ up the last change.
+
+2013-12-06 Leo Liu <sdl.web@gmail.com>
+
+ * progmodes/octave.el (inferior-octave-prompt): Use shy groups.
+ (inferior-octave-startup): Always use "octave> " for prompt.
+ (octave-goto-function-definition)
+ (octave-sync-function-file-names)
+ (octave-find-definition-default-filename): Remove redundant backquotes.
+
+2013-12-06 Dmitry Gutov <dgutov@yandex.ru>
+
+ * progmodes/ruby-mode.el (ruby-mode-syntax-table): Don't modify
+ syntax for `?'.
+ (ruby-expr-beg): Expect that `!' will have syntax class "symbol"
+ where appropriate already.
+ (ruby-syntax-propertize-function): Propertize `?' and `!' at the
+ end of method names (Bug#15874).
+
+2013-12-06 Juri Linkov <juri@jurta.org>
+
+ * isearch.el (isearch--saved-overriding-local-map):
+ New internal variable.
+ (isearch-mode): Set it to the initial value of
+ `overriding-terminal-local-map'.
+ (isearch-pre-command-hook): Compare `overriding-terminal-local-map'
+ with `isearch--saved-overriding-local-map'. (Bug#16035)
+
+2013-12-06 Dmitry Gutov <dgutov@yandex.ru>
+
+ * progmodes/octave.el (inferior-octave-completion-table): Turn
+ back into function, use `completion-table-with-cache'
+ (Bug#11906). Update all references.
+
+ * minibuffer.el (completion-table-with-cache): New function.
+
+2013-12-05 Cameron Desautels <camdez@gmail.com> (tiny change)
+
+ * emacs-lisp/regexp-opt.el (regexp-opt-charset): Fix ^ (bug#16046).
+
+2013-12-05 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * net/eww.el (eww-current-source): New variable to store page
+ source.
+ (eww-display-html, eww-mode, eww-save-history)
+ (eww-restore-history): Use it.
+ (eww-view-source): New command to view page source.
+ Opportunistically uses `html-mode' to highlight the buffer.
+ (eww-mode-map): Install it.
+
+2013-12-05 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/dbus.el (dbus-unregister-service)
+ (dbus-escape-as-identifier, dbus-unescape-from-identifier):
+ Fix docstring.
+ (dbus-unregister-service): Skip :serial entries in
+ `dbus-registered-objects-table'.
+ (dbus-byte-array-to-string): New optional arg MULTIBYTE.
+
+2013-12-04 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * emacs-lisp/lisp-mnt.el (lm-keywords-list): Trim whitespace
+ around keywords with extra `split-string' argument.
+
+2013-12-04 Martin Rudalics <rudalics@gmx.at>
+
+ * windmove.el (windmove-other-window-loc): Handle navigation
+ between windows (excluding the minibuffer window - Bug#16017).
+
+2013-12-04 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/dbus.el (dbus-byte-array-to-string): Accept also byte arrays
+ in D-Bus type syntax.
+ (dbus-unescape-from-identifier): Use `byte-to-string' in order to
+ preserve unibyte strings. (Bug#16048)
+
+2013-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/eldoc.el (eldoc-minibuffer-message):
+ Call force-mode-line-update is the proper buffer (bug#16042).
+
+2013-12-04 Dmitry Gutov <dgutov@yandex.ru>
+
+ * vc/log-edit.el (log-edit-add-new-comment): Rename to
+ `log-edit-remember-comment', make argument optional. Adjust all
+ callers.
+ (log-edit-mode): Add `log-edit-remember-comment' to
+ `kill-buffer-hook' locally.
+ (log-edit-kill-buffer): Don't remember comment explicitly since
+ the buffer is killed anyway.
+
+2013-12-04 Juri Linkov <juri@jurta.org>
+
+ * isearch.el (isearch-mode, isearch-done): Don't set arg LOCAL in
+ add-hook and remove-hook for multi-buffer search. (Bug#16035)
+
+2013-12-03 Tom Regner <tom@goochesa.de> (tiny change)
+
+ * notifications.el (notifications-close-notification): Call the
+ D-Bus method with ID being a `:uint32'. (Bug#16030)
+
+2013-12-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * net/eww.el (eww-render): Don't pass arg to eww-display-image.
+
+2013-12-03 Juri Linkov <juri@jurta.org>
+
+ * progmodes/compile.el (compilation-start): Rename window alist
+ entry `no-display-ok' to `allow-no-window'.
+
+ * simple.el (shell-command): Add window alist entry
+ `allow-no-window' to `display-buffer'.
+ (async-shell-command): Doc fix.
+
+ * window.el (display-buffer-no-window): New action function.
+ (display-buffer-alist, display-buffer): Doc fix. (Bug#13594)
+
+2013-12-02 Dmitry Gutov <dgutov@yandex.ru>
+
+ * vc/log-edit.el (log-edit-set-header): Extract from
+ `log-edit-toggle-header'.
+ (log-edit-extract-headers): Separate the summary, when extracted
+ from header, from the rest of the message with an empty line.
+
+ * vc/vc-git.el (vc-git-log-edit-toggle-amend): Move the summary
+ line, if present, to the Summary header.
+
+2013-12-02 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * epa-file.el (epa-file-insert-file-contents): Ensure we insert text
+ in current-buffer (bug#16029).
+
+2013-12-02 Helmut Eller <eller.helmut@gmail.com>
+
+ * emacs-lisp/debug.el (debugger-toggle-locals): New command.
+ (debugger-mode-map): Bind it.
+ (debugger--backtrace-base): New function.
+ (debugger-eval-expression): Use it.
+ (debugger-frame-number): Skip local vars when present.
+ (debugger--locals-visible-p, debugger--insert-locals)
+ (debugger--show-locals, debugger--hide-locals): New functions.
+
+2013-12-02 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-sh.el (tramp-remote-process-environment): Do not set
+ "LC_ALL".
+ (tramp-get-remote-locale): New defun.
+ (tramp-open-connection-setup-interactive-shell): Use it.
+
+2013-12-02 Leo Liu <sdl.web@gmail.com>
+
+ * subr.el (process-live-p): Return nil for non-process. (Bug#16023)
+
+ * progmodes/sh-script.el (sh-shell-process):
+ * progmodes/octave.el (inferior-octave-process-live-p):
+ * progmodes/gdb-mi.el (gdb-delchar-or-quit)
+ (gdb-inferior-io-sentinel):
+ * emacs-lock.el (emacs-lock-live-process-p): All uses changed.
+
+2013-12-02 Dmitry Gutov <dgutov@yandex.ru>
+
+ * vc/log-edit.el (log-edit-kill-buffer): Move the use of
+ `save-selected-window' to `log-edit-hide-buf'. This makes
+ `log-edit-show-files' idempotent.
+ (log-edit-show-files): Mark the new window as dedicated.
+
+2013-12-02 Dmitry Gutov <dgutov@yandex.ru>
+
+ * vc/log-edit.el (log-edit-mode-map): Add binding for
+ `log-edit-kill-biffer'.
+ (log-edit-hide-buf): Add a FIXME comment.
+ (log-edit-add-new-comment): New function, extracted from
+ `log-edit-done'.
+ (log-edit-done, log-edit-add-to-changelog): Use it.
+ (log-edit-kill-buffer): New command.
+
+2013-12-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * net/eww.el (eww-mode-map): Have `q' do a normal `quit-window'
+ instead of killing the buffer.
+
+2013-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * simple.el (newline): Mention `electric-indent-mode' (bug#16015).
+
+2013-12-01 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
+
+ * net/eww.el (eww-form-checkbox-selected-symbol)
+ (eww-form-checkbox-symbol): New customizable variable.
+ (eww-form-checkbox, eww-toggle-checkbox):
+ Use `eww-form-checkbox-selected-symbol' and `eww-form-checkbox-symbol'.
+
+ * net/shr.el (shr-prefer-media-type-alist): : New customizable variable.
+ (shr--get-media-pref, shr--extract-best-source): New function.
+ (shr-tag-video, shr-tag-audio): Use `shr--extract-best-source' when
+ no :src tag was specified.
+
+ * net/eww.el (eww-use-external-browser-for-content-type): New variable.
+ (eww-render): Handle `eww-use-external-browser-for-content-type'.
+ Use \\` to match beginning of string instead of ^.
+ (eww-browse-with-external-browser): Provide optional URL parameter.
+ (eww-render): Set `eww-current-title' back to "".
+
+ * net/shr.el (shr-tag-video): Display content for video if no
+ poster is available.
+ (shr-tag-audio): Add support for <audio> tag.
+
+ * net/eww.el (eww-text-input-types): : New const.
+ (eww-process-text-input): Treat input types in
+ `eww-text-input-types' as text.
+
+ * net/shr.el (shr-tag-table): Fix comment typo.
+
+2013-12-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * net/eww.el (eww-follow-link): New command to avoid reloading
+ pages when we follow #target links (bug#15243).
+ (eww-quit): Special mode buffers shouldn't query before exiting.
+
+2013-12-01 Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com>
+
+ * net/eww.el (eww-tag-select): Support <optgroup> tags in <select>
+ forms.
+
+2013-12-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * net/eww.el (eww-restore-history): Update the window title after
+ moving in the history.
+ (eww-current-dom): New variable used to save the current DOM.
+
+2013-12-01 Dmitry Gutov <dgutov@yandex.ru>
+
+ * vc/log-edit.el (log-edit-mode-map): Add binding for
+ `log-edit-beginning-of-line'.
+ (log-edit-setup-add-author): New user option.
+ (log-edit-beginning-of-line): New command.
+ (log-edit): Move major mode call above the contents setup so that
+ the local variable values are already applied.
+ (log-edit): Only insert "Author: " when
+ `log-edit-setup-add-author' is non-nil.
+ (log-edit): When SETUP is non-nil, position point after ": "
+ instead of point-min.
+
+2013-12-01 Glenn Morris <rgm@gnu.org>
+
+ * startup.el (command-line): Warn if ~/emacs.d is in load-path.
+
+2013-11-30 Eli Zaretskii <eliz@gnu.org>
+
+ * startup.el (fancy-splash-frame): On MS-Windows, trigger
+ redisplay to make sure the initial frame gets a chance to become
+ visible. (Bug#16014)
+
+2013-11-30 Martin Rudalics <rudalics@gmx.at>
+
+ Support resizing frames and windows pixelwise.
+ * cus-start.el (frame-resize-pixelwise)
+ (window-resize-pixelwise): New entries.
+ * emacs-lisp/debug.el (debug): Use window-total-height instead
+ of window-total-size.
+ * frame.el (tool-bar-lines-needed): Defalias to tool-bar-height.
+ * help.el (describe-bindings-internal): Call help-buffer
+ (temp-buffer-max-width): New option.
+ (resize-temp-buffer-window, help-window-setup)
+ (with-help-window): Rewrite.
+ * mouse.el (mouse-drag-line): Rewrite. Add key bindings for
+ dragging dividers.
+ * window.el (frame-char-size, window-min-pixel-height)
+ (window-safe-min-pixel-height, window-safe-min-pixel-width)
+ (window-min-pixel-width, window-safe-min-pixel-size)
+ (window-combination-p, window-safe-min-size)
+ (window-resizable-p, window--size-to-pixel)
+ (window--pixel-to-size, window--resize-apply-p): New functions.
+ (window-safe-min-height): Fix doc-string.
+ (window-size, window-min-size, window--min-size-1)
+ (window-sizable, window-sizable-p, window--min-delta-1)
+ (window-min-delta, window--max-delta-1, window-max-delta)
+ (window--resizable, window--resizable-p, window-resizable)
+ (window-full-height-p, window-full-width-p, window-at-side-p)
+ (window--in-direction-2, window-in-direction)
+ (window--resize-reset-1, window--resize-mini-window)
+ (window-resize, window-resize-no-error)
+ (window--resize-child-windows-normal)
+ (window--resize-child-windows, window--resize-siblings)
+ (window--resize-this-window, window--resize-root-window)
+ (window--resize-root-window-vertically)
+ (adjust-window-trailing-edge, enlarge-window, shrink-window)
+ (maximize-window, minimize-window, delete-window)
+ (quit-restore-window, window-split-min-size, split-window)
+ (balance-windows-2, balance-windows)
+ (balance-windows-area-adjust, balance-windows-area)
+ (window--state-get-1, window-state-get, window--state-put-1)
+ (window--state-put-2, window-state-put)
+ (display-buffer-record-window, window--display-buffer):
+ Make functions handle pixelwise sizing of windows.
+ (display-buffer--action-function-custom-type)
+ (display-buffer-fallback-action):
+ Add display-buffer-in-previous-window.
+ (display-buffer-use-some-window): Resize window to height it had
+ before.
+ (fit-window-to-buffer-horizontally): New option.
+ (fit-frame-to-buffer): Describe new values.
+ (fit-frame-to-buffer-bottom-margin): Replace with
+ fit-frame-to-buffer-margins.
+ (window--sanitize-margin): New function.
+ (fit-frame-to-buffer, fit-window-to-buffer): Rewrite completely
+ using window-text-pixel-size.
+
+2013-11-30 Glenn Morris <rgm@gnu.org>
+
+ * emacs-lisp/bytecomp.el (byte-compile-form):
+ Make the `interactive-only' warning like the `obsolete' one.
+ * comint.el (comint-run):
+ * files.el (insert-file-literally, insert-file):
+ * replace.el (replace-string, replace-regexp):
+ * simple.el (beginning-of-buffer, end-of-buffer, delete-backward-char)
+ (goto-line, insert-buffer, next-line, previous-line):
+ Tweak `interactive-only' spec.
+
+ Stop keeping (most) generated cedet grammar files in the repository.
+ * Makefile.in (semantic): New.
+ (compile-main): Depend on semantic.
+
+2013-11-29 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * net/newst-reader.el (newsticker-html-renderer): Default to SHR if
+ available. Suggested by Clément B. <barthele1u@etu.univ-lorraine.fr>.
+
+ * uniquify.el (uniquify-buffer-name-style): Change default.
+
+ * loadup.el: Preload "uniquify".
+
+ * time.el (display-time-update): Update all mode lines (bug#15999).
+
+ * electric.el (electric-indent-mode): Enable by default.
+ * loadup.el: Preload "electric".
+
+2013-11-29 Bozhidar Batsov <bozhidar@batsov.com>
+
+ * emacs-lisp/helpers.el (string-empty-p): New function.
+ (string-blank-p): New function.
+
+2013-11-29 Andreas Politz <politza@hochschule-trier.de>
+
+ * imenu.el (imenu--index-alist): Add missing dot to the docstring
+ (Bug#14029).
+
+2013-11-29 Andreas Politz <politza@fh-trier.de>
+ * imenu.el (imenu--subalist-p): Don't error on non-conses and
+ allow non-lambda lists as functions.
+ (imenu--in-alist): Don't recurse into non-subalists.
+ (imenu): Don't pass function itself as an argument (Bug#14029).
+
+2013-11-29 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/python.el (python-mode-map): Remove binding for ":".
+ (python-indent-electric-colon): Remove command.
+ (python-indent-post-self-insert-function): Integrate the previous code
+ of python-indent-electric-colon. Make it conditional on
+ electric-indent-mode.
+ (python-mode): Add ?: to electric-indent-chars.
+ Move python-indent-post-self-insert-function to the end of
+ post-self-insert-hook.
+
+2013-11-28 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * doc-view.el (doc-view-goto-page): Update mode-line.
+
+ * vc/vc-dispatcher.el (vc-log-edit): Setup the Summary&Author headers.
+
+2013-11-27 Glenn Morris <rgm@gnu.org>
+
+ * international/charprop.el, international/uni-bidi.el:
+ * international/uni-category.el, international/uni-combining.el:
+ * international/uni-comment.el, international/uni-decimal.el:
+ * international/uni-decomposition.el, international/uni-digit.el:
+ * international/uni-lowercase.el, international/uni-mirrored.el:
+ * international/uni-name.el, international/uni-numeric.el:
+ * international/uni-old-name.el, international/uni-titlecase.el:
+ * international/uni-uppercase.el:
+ Remove generated files from VCS repository.
+
+2013-11-27 Eli Zaretskii <eliz@gnu.org>
+
+ * filenotify.el (file-notify-add-watch): Don't special-case
+ w32notify when computing the directory to watch.
+
+2013-11-27 Glenn Morris <rgm@gnu.org>
+
+ Make bootstrap without generated uni-*.el files possible again.
+ * loadup.el: Update command-line-args checking for unidata-gen.
+ Add vc to load-path to allow loading vc-bzr when writing uni-*.el.
+ * composite.el, international/characters.el:
+ Handle unicode tables being undefined.
+
+ Move ja-dic, quail, leim-list.el from ../leim to a leim subdirectory.
+ * Makefile.in (setwins_for_subdirs): Skip leim/ directory.
+ (compile-main): Depend on leim rule.
+ (leim): New rule.
+ * loadup.el: Move leim-list.el to leim/ subdirectory.
+ * startup.el (normal-top-level): No more leim directory.
+ * international/ja-dic-cnv.el (skkdic-convert):
+ Disable version-control and autoloads in output files.
+ * international/titdic-cnv.el (titdic-convert, miscdic-convert):
+ Disable version-control and autoloads in output files.
+ * leim/quail: Move here from ../leim.
+ * leim/quail/hangul.el (hangul-input-method-activate):
+ Add autoload cookie.
+ (generated-autoload-load-name): Set file-local value.
+ * leim/quail/uni-input.el (ucs-input-activate): Add autoload cookie.
+ (generated-autoload-load-name): Set file-local value.
+
+2013-11-26 Kenjiro NAKAYAMA <knakayam@redhat.com> (tiny change)
+
+ * net/eww.el (eww-bookmark-browse): Use 'eww-browse-url'.
+ (eww-add-bookmark): ask confirmation when add to bookmarks
+ (eww-quit): ask confirmation before quitting eww
+
+2013-11-26 Eli Zaretskii <eliz@gnu.org>
+
+ * vc/vc.el (vc-diff-internal): Use *-dos coding-system when
+ reading output from Diff on MS-Windows and MS-DOS.
+
+2013-11-26 Bozhidar Batsov <bozhidar@batsov.com>
+
+ * emacs-lisp/helpers.el (string-reverse): New function.
+
+2013-11-26 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-file-name-regexp-unified): Support IPv6 host
+ names on MS Windows, like "/[::1]:".
+
+ * net/tramp-sh.el (tramp-sh-handle-insert-directory): Accept nil
+ SWITCHES.
+
+2013-11-26 Glenn Morris <rgm@gnu.org>
+
+ * progmodes/python.el (python-indent-guess-indent-offset):
+ Avoid corner-case error. (Bug#15975)
+
+ Preload leim-list.el. (Bug#4789)
+ * loadup.el: Load leim-list.el when found.
+ * startup.el (normal-top-level): Skip re-loading leim/leim-list.el.
+
+2013-11-25 Bozhidar Batsov <bozhidar@batsov.com>
+
+ * emacs-lisp/bytecomp.el (byte-compile-form): Fix a typo.
+
+ * emacs-lisp/helpers.el (string-join): New function.
+
+2013-11-25 Sebastian Wiesner <lunaryorn@gmail.com> (tiny change)
+
+ * emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions):
+ Mark as obsolete and replace it with a symbol property.
+ (byte-compile-form): Use new 'interactive-only property.
+ * comint.el, files.el, replace.el, simple.el:
+ Apply new 'interactive-only properly.
+
+2013-11-25 Martin Rudalics <rudalics@gmx.at>
+
+ * window.el (display-buffer-at-bottom): Make sure that
+ split-window-sensibly creates the new window on bottom
+ (Bug#15961).
+
+2013-11-23 David Kastrup <dak@gnu.org>
+
+ * vc/smerge-mode.el (smerge-ediff): Choose default buffer names based
+ on the conflict markers when available.
+ (smerge--get-marker): New function.
+ (smerge-end-re, smerge-base-re): Add subgroup.
+
+2013-11-25 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * frame.el (handle-focus-in, handle-focus-out): Add missing
+ interactive spec.
+
+2013-11-25 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-cmds.el (tramp-cleanup-connection): Clean up
+ `tramp-current-connection' only when KEEP-PASSWORD is non-nil.
+
+2013-11-25 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * play/gomoku.el: Don't use intangible property. Use lexical-binding.
+ (gomoku--last-pos): New var.
+ (gomoku--intangible-chars): New const.
+ (gomoku--intangible): New function.
+ (gomoku-mode): Use it. Derive from special-mode.
+ (gomoku-move-up): Adjust line count.
+ (gomoku-click, gomoku-point-y, gomoku-point-square, gomoku-goto-xy)
+ (gomoku-plot-square, gomoku-init-display, gomoku-cross-qtuple):
+ Simplify accordingly.
+
+ * frame.el (handle-focus-in, handle-focus-out): Move from frame.c.
+ Remove blink-cursor code.
+ (blink-cursor-timer-function, blink-cursor-suspend):
+ Don't special-case GUIs.
+ (blink-cursor-mode): Use focus-in/out-hook.
+
+2013-11-25 Dmitry Gutov <dgutov@yandex.ru>
+
+ * vc/vc-git.el (vc-git-annotate-extract-revision-at-line): Make it
+ work when annotation is invisible (Bug#13886).
+
+2013-11-24 Simon Schubert <2@0x2c.org> (tiny change)
+
+ * json.el (json-alist-p): Only return non-nil if the alist has
+ simple keys (Bug#13518).
+
+2013-11-24 Mihir Rege <mihirrege@gmail.com> (tiny change)
+
+ * progmodes/js.el (js--ctrl-statement-indentation): Fix indent
+ when control-statement is the first statement in a buffer (Bug#15956).
+
+2013-11-24 Dmitry Gutov <dgutov@yandex.ru>
+
+ * imenu.el (imenu-generic-skip-comments-and-strings):
+ New option (Bug#15560).
+ (imenu--generic-function): Use it.
+
+2013-11-24 Jorgen Schaefer <contact@jorgenschaefer.de>
+
+ * minibuffer.el (completion--in-region-1): Scroll the correct
+ window. (Bug#13898)
+
+2013-11-24 Bozhidar Batsov <bozhidar@batsov.com>
+
+ * emacs-lisp/helpers.el: Add some string helpers.
+ (string-trim-left): Removes leading whitespace.
+ (string-trim-right): Removes trailing whitespace.
+ (string-trim): Removes leading and trailing whitespace.
+
+ * subr.el (string-suffix-p): New function.
+
+2013-11-23 Glenn Morris <rgm@gnu.org>
+
+ * progmodes/python.el (python-shell-send-file):
+ Add option to delete file when done. (Bug#15647)
+ (python-shell-send-string, python-shell-send-region): Use it.
+
+2013-11-23 Ivan Shmakov <ivan@siamics.net> (tiny change)
+
+ * vc/diff-mode.el (diff-mode): Only allow diff-default-read-only
+ to set buffer-read-only to t, never to nil. (Bug#15938)
+
+ * textmodes/tex-mode.el (latex-noindent-environments):
+ Add safe-local-variable property. (Bug#15936)
+
+2013-11-23 Glenn Morris <rgm@gnu.org>
+
+ * textmodes/enriched.el (enriched-mode): Doc fix.
+ * emacs-lisp/authors.el (authors-renamed-files-alist):
+ Add enriched.doc -> enriched.txt.
+
+ * Makefile.in (emacs): Empty EMACSLOADPATH rather than unsetting.
+
+2013-11-22 Leo Liu <sdl.web@gmail.com>
+
+ * progmodes/octave.el (inferior-octave-startup): Spit out error
+ message.
+
+2013-11-22 Bozhidar Batsov <bozhidar@batsov.com>
+
+ * progmodes/ruby-mode.el (ruby-custom-encoding-magic-comment-template):
+ Improve docstring.
+ Add :version.
+ (ruby-encoding-magic-comment-style): Add :version.
+
+2013-11-22 Leo Liu <sdl.web@gmail.com>
+
+ * progmodes/octave.el (octave-operator-regexp): Exclude newline.
+ (Bug#15076)
+ (octave-help-mode): Adapt to change to help-mode-finish to use
+ derived-mode-p on 2013-09-17.
+ (inferior-octave-prompt): Also match octave-gui.
+ (octave-kill-process): Don't ask twice. (Bug#10564)
+
+2013-11-22 Leo Liu <sdl.web@gmail.com>
+
+ * progmodes/octave.el (inferior-octave-process-live-p): New helper.
+ (inferior-octave-startup, inferior-octave-check-process)
+ (inferior-octave-track-window-width-change)
+ (octave-completion-at-point, octave-eldoc-function): Use it.
+ (octave-kill-process): Provide confirmation. (Bug#10564)
+
+2013-11-21 Leo Liu <sdl.web@gmail.com>
+
+ * progmodes/octave.el (octave-mode, inferior-octave-mode):
+ Fix obsolete variable comment-use-global-state.
+
+2013-11-21 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
+
+ * progmodes/octave.el (octave-mode-map, octave-mode-menu):
+ Add `octave-source-file'.
+ (octave-source-file): New function. (Bug#15935)
+
+2013-11-21 Kenjiro Nakayama <nakayamakenjiro@gmail.com> (tiny change)
+
+ * net/eww.el (eww-local-regex): New variable.
+ (eww): Use it to detect localhost and similar.
+
+2013-11-21 Leo Liu <sdl.web@gmail.com>
+
+ Add completion for command `ag'.
+ * pcmpl-x.el (pcmpl-x-ag-options): New variable.
+ (pcomplete/ag): New function.
+ (pcmpl-x-ag-options): New function. Handle `[no]' in long options.
+
+2013-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/byte-run.el (eval-when-compile): Fix edebug spec
+ (bug#14646).
+ (make-obsolete): Remove interactive spec.
+
+2013-11-21 Glenn Morris <rgm@gnu.org>
+
+ * startup.el (command-line-1): Use path-separator with -L.
+
+2013-11-20 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * emacs-lisp/package.el (describe-package-1): Add package archive
+ to shown fields.
+
+2013-11-20 Bozhidar Batsov <bozhidar@batsov.com>
+
+ * progmodes/ruby-mode.el (ruby-custom-encoding-magic-comment-template):
+ Change default to "# encoding: %s" to differentiate it from the
+ default Ruby encoding comment template.
+
+2013-11-20 era eriksson <era+emacsbugs@iki.fi>
+
+ * ses.el (ses-mode): Doc fix. (Bug#14748)
+
+2013-11-20 Leo Liu <sdl.web@gmail.com>
+
+ * window.el (display-buffer-alist): Doc fix. (Bug#13594)
+
+2013-11-19 Dan Nicolaescu <dann@gnu.org>
+
+ * vc/vc-git.el (vc-git-dir-extra-headers): Add headers
+ when rebase or bisect are in progress.
+
+2013-11-19 Xue Fuqiao <xfq.free@gmail.com>
+
+ * filenotify.el (file-notify-add-watch): Doc fix.
+
+2013-11-19 Leo Liu <sdl.web@gmail.com>
+
+ * obsolete/rcompile.el: Mark obsolete.
+
+ * progmodes/compile.el (compilation-start)
+ (compilation-goto-locus, compilation-find-file):
+ Pass no-display-ok and handle nil value from display-buffer.
+ (Bug#13594)
+
+ * window.el (display-buffer-alist, display-buffer): Document the
+ new parameter no-display-ok. Return either a window or nil
+ but never a non-window value.
+
2013-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
* electric.el (electric-indent-mode-map): Remove.
@@ -84,9 +759,13 @@
* subr.el (version-regexp-alist):
Recognize hg, svn and darcs versions as snapshot versions.
- * progmodes/ruby-mode.el (ruby-mode-set-encoding):
- Add the ability to always insert an utf-8 encoding comment.
- Fix and simplify coding comment update logic.
+ * progmodes/ruby-mode.el (ruby--detect-encoding): Make aware of
+ 'always-utf8 value of `ruby-insert-encoding-magic-comment'.
+ (ruby--encoding-comment-required-p): Extract from
+ `ruby-mode-set-encoding'.
+ (ruby-mode-set-encoding): Add the ability to always insert an
+ utf-8 encoding comment. Fix and simplify coding comment update
+ logic.
2013-11-14 Michael Albinus <michael.albinus@gmx.de>
@@ -232,9 +911,13 @@
2013-11-08 Bozhidar Batsov <bozhidar@batsov.com>
- * progmodes/ruby-mode.el (ruby-mode-set-encoding):
- Use `ruby-encoding-magic-comment-style' to control the
- style of the auto-inserted encoding comment.
+ * progmodes/ruby-mode.el: Improve encoding comment handling.
+ (ruby-encoding-magic-comment-style): New option.
+ (ruby-custom-encoding-magic-comment-template): New option.
+ (ruby--insert-coding-comment, ruby--detect-encoding):
+ New functions extracted from `ruby-mode-set-encoding'.
+ (ruby-mode-set-encoding): Use `ruby-encoding-magic-comment-style'
+ to control the style of the auto-inserted encoding comment.
2013-11-08 Dmitry Gutov <dgutov@yandex.ru>
@@ -1419,7 +2102,7 @@
of GIF DLLs for versions before and after 5.0.0 of giflib.
(Bug#15531)
-2013-10-10 João Távora <joaotavora@gmail.com>
+2013-10-10 João Távora <joaotavora@gmail.com>
* vc/vc.el (vc-diff-build-argument-list-internal): If the file is
not locked, use last revision and current source as
diff --git a/lisp/ChangeLog.16 b/lisp/ChangeLog.16
index ebdab33e5ea..fb2ce5ecd7e 100644
--- a/lisp/ChangeLog.16
+++ b/lisp/ChangeLog.16
@@ -3730,7 +3730,8 @@
2012-11-19 Daniel Colascione <dancol@dancol.org>
* term/w32-win.el (cygwin-convert-path-from-windows):
- Accomodate rename of cygwin_convert_path* to cygwin_convert_file_name*.
+ Accommodate rename of cygwin_convert_path* to
+ cygwin_convert_file_name*.
2012-11-18 Chong Yidong <cyd@gnu.org>
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index d00330c3a9b..9c9eacfd386 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -106,7 +106,7 @@ COMPILE_FIRST = \
# The actual Emacs command run in the targets below.
# Prevent any setting of EMACSLOADPATH in user environment causing problems.
-emacs = unset EMACSLOADPATH; "$(EMACS)" $(EMACSOPT)
+emacs = EMACSLOADPATH= "$(EMACS)" $(EMACSOPT)
# Common command to find subdirectories
setwins=for file in `find . -type d -print`; do \
@@ -118,14 +118,15 @@ setwins=for file in `find . -type d -print`; do \
# Find all subdirectories except `obsolete' and `term'.
setwins_almost=for file in `find ${srcdir} -type d -print`; do \
case $$file in ${srcdir}*/obsolete | ${srcdir}*/term ) ;; \
- *) wins="$$wins$${wins:+ }$$file" ;; \
+ *) wins="$$wins$${wins:+ }$$file" ;; \
esac; \
done
# Find all subdirectories in which we might want to create subdirs.el.
setwins_for_subdirs=for file in `find ${srcdir} -type d -print`; do \
- case $$file in ${srcdir}*/cedet* ) ;; \
- *) wins="$$wins$${wins:+ }$$file" ;; \
+ case $$file in \
+ ${srcdir}*/cedet* | ${srcdir}*/leim* ) ;; \
+ *) wins="$$wins$${wins:+ }$$file" ;; \
esac; \
done
@@ -172,6 +173,10 @@ finder-data: doit
# The chmod +w is to handle env var CVSREAD=1.
# Use expand-file-name rather than $abs_scrdir so that Emacs does not
# get confused when it compares file-names for equality.
+#
+# Note that we set no-update-autoloads in _generated_ leim files.
+# If you want to allow autoloads in such files, remove that,
+# and make this depend on leim.
autoloads: $(LOADDEFS) doit
cd $(lisp) && chmod +w $(AUTOGEN_VCS)
$(setwins_almost); \
@@ -291,7 +296,7 @@ compile-targets: $(TARGETS)
# Compile all the Elisp files that need it. Beware: it approximates
# `no-byte-compile', so watch out for false-positives!
-compile-main: compile-clean
+compile-main: leim semantic compile-clean
@(cd $(lisp) && $(setwins); \
els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
for el in $$els; do \
@@ -315,6 +320,18 @@ compile-clean:
fi \
done
+.PHONY: leim semantic
+leim:
+ cd ../leim && $(MAKE) $(MFLAGS) all EMACS="$(EMACS)"
+
+# FIXME. Yuck.
+semantic:
+ case ${EMACS} in \
+ .*) EMACS="../${EMACS}" ;; \
+ *) EMACS="${EMACS}" ;; \
+ esac; \
+ cd ../admin/grammars && $(MAKE) $(MFLAGS) all EMACS="$${EMACS}"
+
# Compile all Lisp files, but don't recompile those that are up to
# date. Some .el files don't get compiled because they set the
# local variable no-byte-compile.
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index ecdebe0363c..1a4a6580007 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,3 +1,25 @@
+2013-11-30 Glenn Morris <rgm@gnu.org>
+
+ Stop keeping (most) generated cedet grammar files in the repository.
+ * semantic/bovine/grammar.el (bovine--make-parser-1):
+ New function, split from bovine-make-parsers.
+ (bovine-make-parsers): Use bovine--make-parser-1.
+ (bovine-batch-make-parser): New function.
+ * semantic/wisent/grammar.el (wisent--make-parser-1):
+ New function, split from wisent-make-parsers.
+ (wisent-make-parsers): Use wisent--make-parser-1.
+ (wisent-batch-make-parser): New function.
+ * semantic/db.el (semanticdb-save-all-db):
+ Avoid prompting in batch mode.
+ * semantic/grammar.el (semantic-grammar-footer-template):
+ Disable version-control and autoloads in the output.
+ (semantic-grammar-create-package):
+ Add option to return nil if output is up-to-date.
+ * semantic/bovine/c-by.el, semantic/bovine/make-by.el:
+ * semantic/bovine/scm-by.el, semantic/wisent/javat-wy.el:
+ * semantic/wisent/js-wy.el, semantic/wisent/python-wy.el:
+ * srecode/srt-wy.el: Remove generated files from repository.
+
2013-11-16 Barry O'Reilly <gundaetiapo@gmail.com>
* semantic/fw.el (semantic-exit-on-input)
diff --git a/lisp/cedet/semantic/bovine/c-by.el b/lisp/cedet/semantic/bovine/c-by.el
deleted file mode 100644
index af3724a32c8..00000000000
--- a/lisp/cedet/semantic/bovine/c-by.el
+++ /dev/null
@@ -1,2224 +0,0 @@
-;;; semantic/bovine/c-by.el --- Generated parser support file
-
-;; Copyright (C) 1999-2013 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/>.
-
-;;; Commentary:
-;;
-;; This file was generated from admin/grammars/c.by.
-
-;;; Code:
-
-(require 'semantic/lex)
-(eval-when-compile (require 'semantic/bovine))
-
-;;; Prologue
-;;
-(declare-function semantic-c-reconstitute-token "semantic/bovine/c"
- (tokenpart declmods typedecl))
-(declare-function semantic-c-reconstitute-template "semantic/bovine/c"
- (tag specifier))
-(declare-function semantic-expand-c-tag "semantic/bovine/c" (tag))
-(declare-function semantic-parse-region "semantic"
- (start end &optional nonterminal depth returnonerror))
-
-;;; Declarations
-;;
-(defconst semantic-c-by--keyword-table
- (semantic-lex-make-keyword-table
- '(("extern" . EXTERN)
- ("static" . STATIC)
- ("const" . CONST)
- ("volatile" . VOLATILE)
- ("register" . REGISTER)
- ("signed" . SIGNED)
- ("unsigned" . UNSIGNED)
- ("inline" . INLINE)
- ("virtual" . VIRTUAL)
- ("mutable" . MUTABLE)
- ("explicit" . EXPLICIT)
- ("struct" . STRUCT)
- ("union" . UNION)
- ("enum" . ENUM)
- ("typedef" . TYPEDEF)
- ("class" . CLASS)
- ("typename" . TYPENAME)
- ("namespace" . NAMESPACE)
- ("using" . USING)
- ("new" . NEW)
- ("delete" . DELETE)
- ("template" . TEMPLATE)
- ("throw" . THROW)
- ("reentrant" . REENTRANT)
- ("try" . TRY)
- ("catch" . CATCH)
- ("operator" . OPERATOR)
- ("public" . PUBLIC)
- ("private" . PRIVATE)
- ("protected" . PROTECTED)
- ("friend" . FRIEND)
- ("if" . IF)
- ("else" . ELSE)
- ("do" . DO)
- ("while" . WHILE)
- ("for" . FOR)
- ("switch" . SWITCH)
- ("case" . CASE)
- ("default" . DEFAULT)
- ("return" . RETURN)
- ("break" . BREAK)
- ("continue" . CONTINUE)
- ("sizeof" . SIZEOF)
- ("void" . VOID)
- ("char" . CHAR)
- ("wchar_t" . WCHAR)
- ("short" . SHORT)
- ("int" . INT)
- ("long" . LONG)
- ("float" . FLOAT)
- ("double" . DOUBLE)
- ("bool" . BOOL)
- ("_P" . UNDERP)
- ("__P" . UNDERUNDERP))
- '(("__P" summary "Common macro to eliminate prototype compatibility on some compilers")
- ("_P" summary "Common macro to eliminate prototype compatibility on some compilers")
- ("bool" summary "Primitive boolean type")
- ("double" summary "Primitive floating-point type (double-precision 64-bit IEEE 754)")
- ("float" summary "Primitive floating-point type (single-precision 32-bit IEEE 754)")
- ("long" summary "Integral primitive type (-9223372036854775808 to 9223372036854775807)")
- ("int" summary "Integral Primitive Type: (-2147483648 to 2147483647)")
- ("short" summary "Integral Primitive Type: (-32768 to 32767)")
- ("wchar_t" summary "Wide Character Type")
- ("char" summary "Integral Character Type: (0 to 256)")
- ("void" summary "Built in typeless type: void")
- ("sizeof" summary "Compile time macro: sizeof(<type or variable>) // size in bytes")
- ("continue" summary "Non-local continue within a loop (for, do/while): continue;")
- ("break" summary "Non-local exit within a loop or switch (for, do/while, switch): break;")
- ("return" summary "return <value>;")
- ("default" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
- ("case" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
- ("switch" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
- ("for" summary "for(<init>; <condition>; <increment>) { code }")
- ("while" summary "do { code } while (<condition>); or while (<condition>) { code };")
- ("do" summary " do { code } while (<condition>);")
- ("else" summary "if (<condition>) { code } [ else { code } ]")
- ("if" summary "if (<condition>) { code } [ else { code } ]")
- ("friend" summary "friend class <CLASSNAME>")
- ("catch" summary "try { <body> } catch { <catch code> }")
- ("try" summary "try { <body> } catch { <catch code> }")
- ("reentrant" summary "<type> <methoddef> (<method args>) reentrant ...")
- ("throw" summary "<type> <methoddef> (<method args>) throw (<exception>) ...")
- ("template" summary "template <class TYPE ...> TYPE_OR_FUNCTION")
- ("delete" summary "delete <object>;")
- ("new" summary "new <classname>();")
- ("using" summary "using <namespace>;")
- ("namespace" summary "Namespace Declaration: namespace <name> { ... };")
- ("typename" summary "typename is used to handle a qualified name as a typename;")
- ("class" summary "Class Declaration: class <name>[:parents] { ... };")
- ("typedef" summary "Arbitrary Type Declaration: typedef <typedeclaration> <name>;")
- ("enum" summary "Enumeration Type Declaration: enum [name] { ... };")
- ("union" summary "Union Type Declaration: union [name] { ... };")
- ("struct" summary "Structure Type Declaration: struct [name] { ... };")
- ("explicit" summary "Forbids implicit type conversion: explicit <constructor>")
- ("mutable" summary "Member Declaration Modifier: mutable <type> <name> ...")
- ("virtual" summary "Method Modifier: virtual <type> <name>(...) ...")
- ("inline" summary "Function Modifier: inline <return type> <name>(...) {...};")
- ("unsigned" summary "Numeric Type Modifier: unsigned <numeric type> <name> ...")
- ("signed" summary "Numeric Type Modifier: signed <numeric type> <name> ...")
- ("register" summary "Declaration Modifier: register <type> <name> ...")
- ("volatile" summary "Declaration Modifier: volatile <type> <name> ...")
- ("const" summary "Declaration Modifier: const <type> <name> ...")
- ("static" summary "Declaration Modifier: static <type> <name> ...")
- ("extern" summary "Declaration Modifier: extern <type> <name> ...")))
- "Table of language keywords.")
-
-(defconst semantic-c-by--token-table
- (semantic-lex-make-type-table
- '(("semantic-list"
- (BRACKETS . "\\[\\]")
- (PARENS . "()")
- (VOID_BLCK . "^(void)$")
- (BRACE_BLCK . "^{")
- (PAREN_BLCK . "^(")
- (BRACK_BLCK . "\\[.*\\]$"))
- ("close-paren"
- (RBRACE . "}")
- (RPAREN . ")"))
- ("open-paren"
- (LBRACE . "{")
- (LPAREN . "("))
- ("symbol"
- (RESTRICT . "\\<\\(__\\)?restrict\\>"))
- ("number"
- (ZERO . "^0$"))
- ("string"
- (CPP . "\"C\\+\\+\"")
- (C . "\"C\""))
- ("punctuation"
- (OR . "\\`[|]\\'")
- (HAT . "\\`\\^\\'")
- (MOD . "\\`[%]\\'")
- (TILDE . "\\`[~]\\'")
- (COMA . "\\`[,]\\'")
- (GREATER . "\\`[>]\\'")
- (LESS . "\\`[<]\\'")
- (EQUAL . "\\`[=]\\'")
- (BANG . "\\`[!]\\'")
- (MINUS . "\\`[-]\\'")
- (PLUS . "\\`[+]\\'")
- (DIVIDE . "\\`[/]\\'")
- (AMPERSAND . "\\`[&]\\'")
- (STAR . "\\`[*]\\'")
- (SEMICOLON . "\\`[;]\\'")
- (COLON . "\\`[:]\\'")
- (PERIOD . "\\`[.]\\'")
- (HASH . "\\`[#]\\'")))
- 'nil)
- "Table of lexical tokens.")
-
-(defconst semantic-c-by--parse-table
- `(
- (bovine-toplevel
- (declaration)
- ) ;; end bovine-toplevel
-
- (bovine-inner-scope
- (codeblock)
- ) ;; end bovine-inner-scope
-
- (declaration
- (macro)
- (type)
- (define)
- (var-or-fun)
- (extern-c)
- (template)
- (using)
- ) ;; end declaration
-
- (codeblock
- (define)
- (codeblock-var-or-fun)
- (type)
- (using)
- ) ;; end codeblock
-
- (extern-c-contents
- (open-paren
- ,(semantic-lambda
- (list nil))
- )
- (declaration)
- (close-paren
- ,(semantic-lambda
- (list nil))
- )
- ) ;; end extern-c-contents
-
- (extern-c
- (EXTERN
- string
- "\"C\""
- semantic-list
- ,(semantic-lambda
- (semantic-tag
- "C"
- 'extern :members
- (semantic-parse-region
- (car
- (nth 2 vals))
- (cdr
- (nth 2 vals))
- 'extern-c-contents
- 1)))
- )
- (EXTERN
- string
- "\"C\\+\\+\""
- semantic-list
- ,(semantic-lambda
- (semantic-tag
- "C"
- 'extern :members
- (semantic-parse-region
- (car
- (nth 2 vals))
- (cdr
- (nth 2 vals))
- 'extern-c-contents
- 1)))
- )
- (EXTERN
- string
- "\"C\""
- ,(semantic-lambda
- (list nil))
- )
- (EXTERN
- string
- "\"C\\+\\+\""
- ,(semantic-lambda
- (list nil))
- )
- ) ;; end extern-c
-
- (macro
- (spp-macro-def
- ,(semantic-lambda
- (semantic-tag-new-variable
- (nth 0 vals) nil nil :constant-flag t))
- )
- (spp-system-include
- ,(semantic-lambda
- (semantic-tag-new-include
- (nth 0 vals) t))
- )
- (spp-include
- ,(semantic-lambda
- (semantic-tag-new-include
- (nth 0 vals) nil))
- )
- ) ;; end macro
-
- (define
- (spp-macro-def
- ,(semantic-lambda
- (semantic-tag-new-variable
- (nth 0 vals) nil nil :constant-flag t))
- )
- (spp-macro-undef
- ,(semantic-lambda
- (list nil))
- )
- ) ;; end define
-
- (unionparts
- (semantic-list
- ,(semantic-lambda
- (semantic-parse-region
- (car
- (nth 0 vals))
- (cdr
- (nth 0 vals))
- 'classsubparts
- 1))
- )
- ) ;; end unionparts
-
- (opt-symbol
- (symbol)
- ( ;;EMPTY
- )
- ) ;; end opt-symbol
-
- (classsubparts
- (open-paren
- "{"
- ,(semantic-lambda
- (list nil))
- )
- (close-paren
- "}"
- ,(semantic-lambda
- (list nil))
- )
- (class-protection
- opt-symbol
- punctuation
- "\\`[:]\\'"
- ,(semantic-lambda
- (semantic-tag
- (car
- (nth 0 vals))
- 'label))
- )
- (var-or-fun)
- (FRIEND
- func-decl
- ,(semantic-lambda
- (semantic-tag
- (car
- (nth 1 vals))
- 'friend))
- )
- (FRIEND
- CLASS
- symbol
- ,(semantic-lambda
- (semantic-tag
- (nth 2 vals)
- 'friend))
- )
- (type)
- (define)
- (template)
- ( ;;EMPTY
- )
- ) ;; end classsubparts
-
- (opt-class-parents
- (punctuation
- "\\`[:]\\'"
- class-parents
- opt-template-specifier
- ,(semantic-lambda
- (list
- (nth 1 vals)))
- )
- ( ;;EMPTY
- ,(semantic-lambda)
- )
- ) ;; end opt-class-parents
-
- (one-class-parent
- (opt-class-protection
- opt-class-declmods
- namespace-symbol
- ,(semantic-lambda
- (semantic-tag-new-type
- (car
- (nth 2 vals))
- "class" nil nil :protection
- (car
- (nth 0 vals))))
- )
- (opt-class-declmods
- opt-class-protection
- namespace-symbol
- ,(semantic-lambda
- (semantic-tag-new-type
- (car
- (nth 2 vals))
- "class" nil nil :protection
- (car
- (nth 1 vals))))
- )
- ) ;; end one-class-parent
-
- (class-parents
- (one-class-parent
- punctuation
- "\\`[,]\\'"
- class-parents
- ,(semantic-lambda
- (cons
- (nth 0 vals)
- (nth 2 vals)))
- )
- (one-class-parent
- ,(semantic-lambda
- (list
- (nth 0 vals)))
- )
- ) ;; end class-parents
-
- (opt-class-declmods
- (class-declmods
- opt-class-declmods
- ,(semantic-lambda
- (list nil))
- )
- ( ;;EMPTY
- )
- ) ;; end opt-class-declmods
-
- (class-declmods
- (VIRTUAL)
- ) ;; end class-declmods
-
- (class-protection
- (PUBLIC)
- (PRIVATE)
- (PROTECTED)
- ) ;; end class-protection
-
- (opt-class-protection
- (class-protection
- ,(semantic-lambda
- (nth 0 vals))
- )
- ( ;;EMPTY
- ,(semantic-lambda
- (list
- "unspecified"))
- )
- ) ;; end opt-class-protection
-
- (namespaceparts
- (semantic-list
- ,(semantic-lambda
- (semantic-parse-region
- (car
- (nth 0 vals))
- (cdr
- (nth 0 vals))
- 'namespacesubparts
- 1))
- )
- ) ;; end namespaceparts
-
- (namespacesubparts
- (open-paren
- "{"
- ,(semantic-lambda
- (list nil))
- )
- (close-paren
- "}"
- ,(semantic-lambda
- (list nil))
- )
- (type)
- (var-or-fun)
- (define)
- (class-protection
- punctuation
- "\\`[:]\\'"
- ,(semantic-lambda
- (semantic-tag
- (car
- (nth 0 vals))
- 'label))
- )
- (template)
- (using)
- (spp-include
- ,(semantic-lambda
- (semantic-tag
- (nth 0 vals)
- 'include :inside-ns t))
- )
- ( ;;EMPTY
- )
- ) ;; end namespacesubparts
-
- (enumparts
- (semantic-list
- ,(semantic-lambda
- (semantic-parse-region
- (car
- (nth 0 vals))
- (cdr
- (nth 0 vals))
- 'enumsubparts
- 1))
- )
- ) ;; end enumparts
-
- (enumsubparts
- (symbol
- opt-assign
- ,(semantic-lambda
- (semantic-tag-new-variable
- (nth 0 vals)
- "int"
- (car
- (nth 1 vals)) :constant-flag t))
- )
- (open-paren
- "{"
- ,(semantic-lambda
- (list nil))
- )
- (close-paren
- "}"
- ,(semantic-lambda
- (list nil))
- )
- (punctuation
- "\\`[,]\\'"
- ,(semantic-lambda
- (list nil))
- )
- ) ;; end enumsubparts
-
- (opt-name
- (symbol)
- ( ;;EMPTY
- ,(semantic-lambda
- (list
- ""))
- )
- ) ;; end opt-name
-
- (typesimple
- (struct-or-class
- opt-class
- opt-name
- opt-template-specifier
- opt-class-parents
- semantic-list
- ,(semantic-lambda
- (semantic-tag-new-type
- (car
- (nth 2 vals))
- (car
- (nth 0 vals))
- (let
- (
- (semantic-c-classname
- (cons
- (car
- (nth 2 vals))
- (car
- (nth 0 vals)))))
- (semantic-parse-region
- (car
- (nth 5 vals))
- (cdr
- (nth 5 vals))
- 'classsubparts
- 1))
- (nth 4 vals) :template-specifier
- (nth 3 vals) :parent
- (car
- (nth 1 vals))))
- )
- (struct-or-class
- opt-class
- opt-name
- opt-template-specifier
- opt-class-parents
- ,(semantic-lambda
- (semantic-tag-new-type
- (car
- (nth 2 vals))
- (car
- (nth 0 vals)) nil
- (nth 4 vals) :template-specifier
- (nth 3 vals) :prototype t :parent
- (car
- (nth 1 vals))))
- )
- (UNION
- opt-class
- opt-name
- unionparts
- ,(semantic-lambda
- (semantic-tag-new-type
- (car
- (nth 2 vals))
- (nth 0 vals)
- (nth 3 vals) nil :parent
- (car
- (nth 1 vals))))
- )
- (ENUM
- opt-class
- opt-name
- enumparts
- ,(semantic-lambda
- (semantic-tag-new-type
- (car
- (nth 2 vals))
- (nth 0 vals)
- (nth 3 vals) nil :parent
- (car
- (nth 1 vals))))
- )
- (TYPEDEF
- declmods
- typeformbase
- cv-declmods
- typedef-symbol-list
- ,(semantic-lambda
- (semantic-tag-new-type
- (nth 4 vals)
- (nth 0 vals) nil
- (list
- (nth 2 vals))))
- )
- ) ;; end typesimple
-
- (typedef-symbol-list
- (typedefname
- punctuation
- "\\`[,]\\'"
- typedef-symbol-list
- ,(semantic-lambda
- (cons
- (nth 0 vals)
- (nth 2 vals)))
- )
- (typedefname
- ,(semantic-lambda
- (list
- (nth 0 vals)))
- )
- ) ;; end typedef-symbol-list
-
- (typedefname
- (opt-stars
- symbol
- opt-bits
- opt-array
- ,(semantic-lambda
- (list
- (nth 0 vals)
- (nth 1 vals)))
- )
- ) ;; end typedefname
-
- (struct-or-class
- (STRUCT)
- (CLASS)
- ) ;; end struct-or-class
-
- (type
- (typesimple
- punctuation
- "\\`[;]\\'"
- ,(semantic-lambda
- (nth 0 vals))
- )
- (NAMESPACE
- symbol
- namespaceparts
- ,(semantic-lambda
- (semantic-tag-new-type
- (nth 1 vals)
- (nth 0 vals)
- (nth 2 vals) nil))
- )
- (NAMESPACE
- namespaceparts
- ,(semantic-lambda
- (semantic-tag-new-type
- "unnamed"
- (nth 0 vals)
- (nth 1 vals) nil))
- )
- (NAMESPACE
- symbol
- punctuation
- "\\`[=]\\'"
- typeformbase
- punctuation
- "\\`[;]\\'"
- ,(semantic-lambda
- (semantic-tag-new-type
- (nth 1 vals)
- (nth 0 vals)
- (list
- (semantic-tag-new-type
- (car
- (nth 3 vals))
- (nth 0 vals) nil nil)) nil :kind
- 'alias))
- )
- ) ;; end type
-
- (using
- (USING
- usingname
- punctuation
- "\\`[;]\\'"
- ,(semantic-lambda
- (semantic-tag
- (car
- (nth 1 vals))
- 'using :type
- (nth 1 vals)))
- )
- ) ;; end using
-
- (usingname
- (typeformbase
- ,(semantic-lambda
- (semantic-tag-new-type
- (car
- (nth 0 vals))
- "class" nil nil :prototype t))
- )
- (NAMESPACE
- typeformbase
- ,(semantic-lambda
- (semantic-tag-new-type
- (car
- (nth 1 vals))
- "namespace" nil nil :prototype t))
- )
- ) ;; end usingname
-
- (template
- (TEMPLATE
- template-specifier
- opt-friend
- template-definition
- ,(semantic-lambda
- (semantic-c-reconstitute-template
- (nth 3 vals)
- (nth 1 vals)))
- )
- ) ;; end template
-
- (opt-friend
- (FRIEND)
- ( ;;EMPTY
- )
- ) ;; end opt-friend
-
- (opt-template-specifier
- (template-specifier
- ,(semantic-lambda
- (nth 0 vals))
- )
- ( ;;EMPTY
- ,(semantic-lambda)
- )
- ) ;; end opt-template-specifier
-
- (template-specifier
- (punctuation
- "\\`[<]\\'"
- template-specifier-types
- punctuation
- "\\`[>]\\'"
- ,(semantic-lambda
- (nth 1 vals))
- )
- ) ;; end template-specifier
-
- (template-specifier-types
- (template-var
- template-specifier-type-list
- ,(semantic-lambda
- (cons
- (nth 0 vals)
- (nth 1 vals)))
- )
- ( ;;EMPTY
- )
- ) ;; end template-specifier-types
-
- (template-specifier-type-list
- (punctuation
- "\\`[,]\\'"
- template-specifier-types
- ,(semantic-lambda
- (nth 1 vals))
- )
- ( ;;EMPTY
- ,(semantic-lambda)
- )
- ) ;; end template-specifier-type-list
-
- (template-var
- (template-type
- opt-template-equal
- ,(semantic-lambda
- (cons
- (car
- (nth 0 vals))
- (cdr
- (nth 0 vals))))
- )
- (string
- ,(semantic-lambda
- (list
- (nth 0 vals)))
- )
- (number
- ,(semantic-lambda
- (list
- (nth 0 vals)))
- )
- (opt-stars
- opt-ref
- namespace-symbol
- ,(semantic-lambda
- (nth 2 vals))
- )
- (semantic-list
- ,(semantic-lambda
- (list
- (nth 0 vals)))
- )
- (SIZEOF
- semantic-list
- ,(semantic-lambda
- (list
- (nth 1 vals)))
- )
- ) ;; end template-var
-
- (opt-template-equal
- (punctuation
- "\\`[=]\\'"
- symbol
- punctuation
- "\\`[<]\\'"
- template-specifier-types
- punctuation
- "\\`[>]\\'"
- ,(semantic-lambda
- (list
- (nth 1 vals)))
- )
- (punctuation
- "\\`[=]\\'"
- symbol
- ,(semantic-lambda
- (list
- (nth 1 vals)))
- )
- ( ;;EMPTY
- ,(semantic-lambda)
- )
- ) ;; end opt-template-equal
-
- (template-type
- (CLASS
- symbol
- ,(semantic-lambda
- (semantic-tag-new-type
- (nth 1 vals)
- "class" nil nil))
- )
- (STRUCT
- symbol
- ,(semantic-lambda
- (semantic-tag-new-type
- (nth 1 vals)
- "struct" nil nil))
- )
- (TYPENAME
- symbol
- ,(semantic-lambda
- (semantic-tag-new-type
- (nth 1 vals)
- "class" nil nil))
- )
- (declmods
- typeformbase
- cv-declmods
- opt-stars
- opt-ref
- variablearg-opt-name
- ,(semantic-lambda
- (semantic-tag-new-type
- (car
- (nth 1 vals)) nil nil nil :constant-flag
- (if
- (member
- "const"
- (append
- (nth 0 vals)
- (nth 2 vals))) t nil) :typemodifiers
- (delete
- "const"
- (append
- (nth 0 vals)
- (nth 2 vals))) :reference
- (car
- (nth 4 vals)) :pointer
- (car
- (nth 3 vals))))
- )
- ) ;; end template-type
-
- (template-definition
- (type
- ,(semantic-lambda
- (nth 0 vals))
- )
- (var-or-fun
- ,(semantic-lambda
- (nth 0 vals))
- )
- ) ;; end template-definition
-
- (opt-stars
- (punctuation
- "\\`[*]\\'"
- opt-starmod
- opt-stars
- ,(semantic-lambda
- (list
- (1+
- (car
- (nth 2 vals)))))
- )
- ( ;;EMPTY
- ,(semantic-lambda
- (list
- 0))
- )
- ) ;; end opt-stars
-
- (opt-starmod
- (STARMOD
- opt-starmod
- ,(semantic-lambda
- (cons
- (car
- (nth 0 vals))
- (nth 1 vals)))
- )
- ( ;;EMPTY
- ,(semantic-lambda)
- )
- ) ;; end opt-starmod
-
- (STARMOD
- (CONST)
- ) ;; end STARMOD
-
- (declmods
- (DECLMOD
- declmods
- ,(semantic-lambda
- (cons
- (car
- (nth 0 vals))
- (nth 1 vals)))
- )
- (DECLMOD
- ,(semantic-lambda
- (nth 0 vals))
- )
- ( ;;EMPTY
- ,(semantic-lambda)
- )
- ) ;; end declmods
-
- (DECLMOD
- (EXTERN)
- (STATIC)
- (CVDECLMOD)
- (INLINE)
- (REGISTER)
- (FRIEND)
- (TYPENAME)
- (METADECLMOD)
- (VIRTUAL)
- ) ;; end DECLMOD
-
- (metadeclmod
- (METADECLMOD
- ,(semantic-lambda)
- )
- ( ;;EMPTY
- ,(semantic-lambda)
- )
- ) ;; end metadeclmod
-
- (CVDECLMOD
- (CONST)
- (VOLATILE)
- ) ;; end CVDECLMOD
-
- (cv-declmods
- (CVDECLMOD
- cv-declmods
- ,(semantic-lambda
- (cons
- (car
- (nth 0 vals))
- (nth 1 vals)))
- )
- (CVDECLMOD
- ,(semantic-lambda
- (nth 0 vals))
- )
- ( ;;EMPTY
- ,(semantic-lambda)
- )
- ) ;; end cv-declmods
-
- (METADECLMOD
- (VIRTUAL)
- (MUTABLE)
- ) ;; end METADECLMOD
-
- (opt-ref
- (punctuation
- "\\`[&]\\'"
- ,(semantic-lambda
- (list
- 1))
- )
- ( ;;EMPTY
- ,(semantic-lambda
- (list
- 0))
- )
- ) ;; end opt-ref
-
- (typeformbase
- (typesimple
- ,(semantic-lambda
- (nth 0 vals))
- )
- (STRUCT
- symbol
- ,(semantic-lambda
- (semantic-tag-new-type
- (nth 1 vals)
- (nth 0 vals) nil nil))
- )
- (UNION
- symbol
- ,(semantic-lambda
- (semantic-tag-new-type
- (nth 1 vals)
- (nth 0 vals) nil nil))
- )
- (ENUM
- symbol
- ,(semantic-lambda
- (semantic-tag-new-type
- (nth 1 vals)
- (nth 0 vals) nil nil))
- )
- (builtintype
- ,(semantic-lambda
- (nth 0 vals))
- )
- (symbol
- template-specifier
- ,(semantic-lambda
- (semantic-tag-new-type
- (nth 0 vals)
- "class" nil nil :template-specifier
- (nth 1 vals)))
- )
- (namespace-symbol-for-typeformbase
- opt-template-specifier
- ,(semantic-lambda
- (semantic-tag-new-type
- (car
- (nth 0 vals))
- "class" nil nil :template-specifier
- (nth 1 vals)))
- )
- (symbol
- ,(semantic-lambda
- (list
- (nth 0 vals)))
- )
- ) ;; end typeformbase
-
- (signedmod
- (UNSIGNED)
- (SIGNED)
- ) ;; end signedmod
-
- (builtintype-types
- (VOID)
- (CHAR)
- (WCHAR)
- (SHORT
- INT
- ,(semantic-lambda
- (list
- (concat
- (nth 0 vals)
- " "
- (nth 1 vals))))
- )
- (SHORT)
- (INT)
- (LONG
- INT
- ,(semantic-lambda
- (list
- (concat
- (nth 0 vals)
- " "
- (nth 1 vals))))
- )
- (FLOAT)
- (DOUBLE)
- (BOOL)
- (LONG
- DOUBLE
- ,(semantic-lambda
- (list
- (concat
- (nth 0 vals)
- " "
- (nth 1 vals))))
- )
- (LONG
- LONG
- ,(semantic-lambda
- (list
- (concat
- (nth 0 vals)
- " "
- (nth 1 vals))))
- )
- (LONG)
- ) ;; end builtintype-types
-
- (builtintype
- (signedmod
- builtintype-types
- ,(semantic-lambda
- (list
- (concat
- (car
- (nth 0 vals))
- " "
- (car
- (nth 1 vals)))))
- )
- (builtintype-types
- ,(semantic-lambda
- (nth 0 vals))
- )
- (signedmod
- ,(semantic-lambda
- (list
- (concat
- (car
- (nth 0 vals))
- " int")))
- )
- ) ;; end builtintype
-
- (codeblock-var-or-fun
- (declmods
- typeformbase
- declmods
- opt-ref
- var-or-func-decl
- ,(semantic-lambda
- (semantic-c-reconstitute-token
- (nth 4 vals)
- (nth 0 vals)
- (nth 1 vals)))
- )
- ) ;; end codeblock-var-or-fun
-
- (var-or-fun
- (codeblock-var-or-fun
- ,(semantic-lambda
- (nth 0 vals))
- )
- (declmods
- var-or-func-decl
- ,(semantic-lambda
- (semantic-c-reconstitute-token
- (nth 1 vals)
- (nth 0 vals) nil))
- )
- ) ;; end var-or-fun
-
- (var-or-func-decl
- (func-decl
- ,(semantic-lambda
- (nth 0 vals))
- )
- (var-decl
- ,(semantic-lambda
- (nth 0 vals))
- )
- ) ;; end var-or-func-decl
-
- (func-decl
- (opt-stars
- opt-class
- opt-destructor
- functionname
- opt-template-specifier
- opt-under-p
- arg-list
- opt-post-fcn-modifiers
- opt-throw
- opt-initializers
- fun-or-proto-end
- ,(semantic-lambda
- (nth 3 vals)
- (list
- 'function
- (nth 1 vals)
- (nth 2 vals)
- (nth 6 vals)
- (nth 8 vals)
- (nth 7 vals))
- (nth 0 vals)
- (nth 10 vals)
- (list
- (nth 4 vals))
- (nth 9 vals))
- )
- (opt-stars
- opt-class
- opt-destructor
- functionname
- opt-template-specifier
- opt-under-p
- opt-post-fcn-modifiers
- opt-throw
- opt-initializers
- fun-try-end
- ,(semantic-lambda
- (nth 3 vals)
- (list
- 'function
- (nth 1 vals)
- (nth 2 vals) nil
- (nth 7 vals)
- (nth 6 vals))
- (nth 0 vals)
- (nth 9 vals)
- (list
- (nth 4 vals))
- (nth 8 vals))
- )
- ) ;; end func-decl
-
- (var-decl
- (varnamelist
- punctuation
- "\\`[;]\\'"
- ,(semantic-lambda
- (list
- (nth 0 vals)
- 'variable))
- )
- ) ;; end var-decl
-
- (opt-under-p
- (UNDERP
- ,(semantic-lambda
- (list nil))
- )
- (UNDERUNDERP
- ,(semantic-lambda
- (list nil))
- )
- ( ;;EMPTY
- )
- ) ;; end opt-under-p
-
- (opt-initializers
- (punctuation
- "\\`[:]\\'"
- namespace-symbol
- semantic-list
- opt-initializers)
- (punctuation
- "\\`[,]\\'"
- namespace-symbol
- semantic-list
- opt-initializers)
- ( ;;EMPTY
- )
- ) ;; end opt-initializers
-
- (opt-post-fcn-modifiers
- (post-fcn-modifiers
- opt-post-fcn-modifiers
- ,(semantic-lambda
- (cons
- (nth 0 vals)
- (nth 1 vals)))
- )
- ( ;;EMPTY
- ,(semantic-lambda
- (list nil))
- )
- ) ;; end opt-post-fcn-modifiers
-
- (post-fcn-modifiers
- (REENTRANT)
- (CONST)
- ) ;; end post-fcn-modifiers
-
- (opt-throw
- (THROW
- semantic-list
- ,(lambda (vals start end)
- (semantic-bovinate-from-nonterminal
- (car
- (nth 1 vals))
- (cdr
- (nth 1 vals))
- 'throw-exception-list))
- )
- ( ;;EMPTY
- )
- ) ;; end opt-throw
-
- (throw-exception-list
- (namespace-symbol
- punctuation
- "\\`[,]\\'"
- throw-exception-list
- ,(semantic-lambda
- (cons
- (car
- (nth 0 vals))
- (nth 2 vals)))
- )
- (namespace-symbol
- close-paren
- ")"
- ,(semantic-lambda
- (nth 0 vals))
- )
- (symbol
- close-paren
- ")"
- ,(semantic-lambda
- (list
- (nth 0 vals)))
- )
- (open-paren
- "("
- throw-exception-list
- ,(semantic-lambda
- (nth 1 vals))
- )
- (close-paren
- ")"
- ,(semantic-lambda)
- )
- ) ;; end throw-exception-list
-
- (opt-bits
- (punctuation
- "\\`[:]\\'"
- number
- ,(semantic-lambda
- (list
- (nth 1 vals)))
- )
- ( ;;EMPTY
- ,(semantic-lambda
- (list nil))
- )
- ) ;; end opt-bits
-
- (opt-array
- (semantic-list
- "\\[.*\\]$"
- opt-array
- ,(semantic-lambda
- (list
- (cons
- 1
- (car
- (nth 1 vals)))))
- )
- ( ;;EMPTY
- ,(semantic-lambda
- (list nil))
- )
- ) ;; end opt-array
-
- (opt-assign
- (punctuation
- "\\`[=]\\'"
- expression
- ,(semantic-lambda
- (list
- (nth 1 vals)))
- )
- ( ;;EMPTY
- ,(semantic-lambda
- (list nil))
- )
- ) ;; end opt-assign
-
- (opt-restrict
- (symbol
- "\\<\\(__\\)?restrict\\>")
- ( ;;EMPTY
- )
- ) ;; end opt-restrict
-
- (varname
- (opt-stars
- opt-restrict
- namespace-symbol
- opt-bits
- opt-array
- ,(semantic-lambda
- (nth 2 vals)
- (nth 0 vals)
- (nth 3 vals)
- (nth 4 vals))
- )
- ) ;; end varname
-
- (variablearg
- (declmods
- typeformbase
- cv-declmods
- opt-ref
- variablearg-opt-name
- ,(semantic-lambda
- (semantic-tag-new-variable
- (list
- (nth 4 vals))
- (nth 1 vals) nil :constant-flag
- (if
- (member
- "const"
- (append
- (nth 0 vals)
- (nth 2 vals))) t nil) :typemodifiers
- (delete
- "const"
- (append
- (nth 0 vals)
- (nth 2 vals))) :reference
- (car
- (nth 3 vals))))
- )
- ) ;; end variablearg
-
- (variablearg-opt-name
- (varname
- ,(semantic-lambda
- (nth 0 vals))
- )
- (opt-stars
- ,(semantic-lambda
- (list
- "")
- (nth 0 vals)
- (list nil nil nil))
- )
- ) ;; end variablearg-opt-name
-
- (varname-opt-initializer
- (semantic-list)
- (opt-assign)
- ( ;;EMPTY
- )
- ) ;; end varname-opt-initializer
-
- (varnamelist
- (opt-ref
- varname
- varname-opt-initializer
- punctuation
- "\\`[,]\\'"
- varnamelist
- ,(semantic-lambda
- (cons
- (nth 1 vals)
- (nth 4 vals)))
- )
- (opt-ref
- varname
- varname-opt-initializer
- ,(semantic-lambda
- (list
- (nth 1 vals)))
- )
- ) ;; end varnamelist
-
- (namespace-symbol
- (symbol
- opt-template-specifier
- punctuation
- "\\`[:]\\'"
- punctuation
- "\\`[:]\\'"
- namespace-symbol
- ,(semantic-lambda
- (list
- (concat
- (nth 0 vals)
- "::"
- (car
- (nth 4 vals)))))
- )
- (symbol
- opt-template-specifier
- ,(semantic-lambda
- (list
- (nth 0 vals)))
- )
- ) ;; end namespace-symbol
-
- (namespace-symbol-for-typeformbase
- (symbol
- opt-template-specifier
- punctuation
- "\\`[:]\\'"
- punctuation
- "\\`[:]\\'"
- namespace-symbol-for-typeformbase
- ,(semantic-lambda
- (list
- (concat
- (nth 0 vals)
- "::"
- (car
- (nth 4 vals)))))
- )
- (symbol
- ,(semantic-lambda
- (list
- (nth 0 vals)))
- )
- ) ;; end namespace-symbol-for-typeformbase
-
- (namespace-opt-class
- (symbol
- punctuation
- "\\`[:]\\'"
- punctuation
- "\\`[:]\\'"
- namespace-opt-class
- ,(semantic-lambda
- (list
- (concat
- (nth 0 vals)
- "::"
- (car
- (nth 3 vals)))))
- )
- (symbol
- opt-template-specifier
- punctuation
- "\\`[:]\\'"
- punctuation
- "\\`[:]\\'"
- ,(semantic-lambda
- (list
- (nth 0 vals)))
- )
- ) ;; end namespace-opt-class
-
- (opt-class
- (namespace-opt-class
- ,(semantic-lambda
- (nth 0 vals))
- )
- ( ;;EMPTY
- ,(semantic-lambda
- (list nil))
- )
- ) ;; end opt-class
-
- (opt-destructor
- (punctuation
- "\\`[~]\\'"
- ,(semantic-lambda
- (list t))
- )
- ( ;;EMPTY
- ,(semantic-lambda
- (list nil))
- )
- ) ;; end opt-destructor
-
- (arg-list
- (semantic-list
- "^("
- knr-arguments
- ,(semantic-lambda
- (nth 1 vals))
- )
- (semantic-list
- "^("
- ,(semantic-lambda
- (semantic-parse-region
- (car
- (nth 0 vals))
- (cdr
- (nth 0 vals))
- 'arg-sub-list
- 1))
- )
- (semantic-list
- "^(void)$"
- ,(semantic-lambda)
- )
- ) ;; end arg-list
-
- (knr-varnamelist
- (varname
- punctuation
- "\\`[,]\\'"
- knr-varnamelist
- ,(semantic-lambda
- (cons
- (nth 0 vals)
- (nth 2 vals)))
- )
- (varname
- ,(semantic-lambda
- (list
- (nth 0 vals)))
- )
- ) ;; end knr-varnamelist
-
- (knr-one-variable-decl
- (declmods
- typeformbase
- cv-declmods
- knr-varnamelist
- ,(semantic-lambda
- (semantic-tag-new-variable
- (nreverse
- (nth 3 vals))
- (nth 1 vals) nil :constant-flag
- (if
- (member
- "const"
- (append
- (nth 2 vals))) t nil) :typemodifiers
- (delete
- "const"
- (nth 2 vals))))
- )
- ) ;; end knr-one-variable-decl
-
- (knr-arguments
- (knr-one-variable-decl
- punctuation
- "\\`[;]\\'"
- knr-arguments
- ,(semantic-lambda
- (append
- (semantic-expand-c-tag
- (nth 0 vals))
- (nth 2 vals)))
- )
- (knr-one-variable-decl
- punctuation
- "\\`[;]\\'"
- ,(semantic-lambda
- (semantic-expand-c-tag
- (nth 0 vals)))
- )
- ) ;; end knr-arguments
-
- (arg-sub-list
- (variablearg
- ,(semantic-lambda
- (nth 0 vals))
- )
- (punctuation
- "\\`[.]\\'"
- punctuation
- "\\`[.]\\'"
- punctuation
- "\\`[.]\\'"
- close-paren
- ")"
- ,(semantic-lambda
- (semantic-tag-new-variable
- "..."
- "vararg" nil))
- )
- (punctuation
- "\\`[,]\\'"
- ,(semantic-lambda
- (list nil))
- )
- (open-paren
- "("
- ,(semantic-lambda
- (list nil))
- )
- (close-paren
- ")"
- ,(semantic-lambda
- (list nil))
- )
- ) ;; end arg-sub-list
-
- (operatorsym
- (punctuation
- "\\`[<]\\'"
- punctuation
- "\\`[<]\\'"
- punctuation
- "\\`[=]\\'"
- ,(semantic-lambda
- (list
- "<<="))
- )
- (punctuation
- "\\`[>]\\'"
- punctuation
- "\\`[>]\\'"
- punctuation
- "\\`[=]\\'"
- ,(semantic-lambda
- (list
- ">>="))
- )
- (punctuation
- "\\`[<]\\'"
- punctuation
- "\\`[<]\\'"
- ,(semantic-lambda
- (list
- "<<"))
- )
- (punctuation
- "\\`[>]\\'"
- punctuation
- "\\`[>]\\'"
- ,(semantic-lambda
- (list
- ">>"))
- )
- (punctuation
- "\\`[=]\\'"
- punctuation
- "\\`[=]\\'"
- ,(semantic-lambda
- (list
- "=="))
- )
- (punctuation
- "\\`[<]\\'"
- punctuation
- "\\`[=]\\'"
- ,(semantic-lambda
- (list
- "<="))
- )
- (punctuation
- "\\`[>]\\'"
- punctuation
- "\\`[=]\\'"
- ,(semantic-lambda
- (list
- ">="))
- )
- (punctuation
- "\\`[!]\\'"
- punctuation
- "\\`[=]\\'"
- ,(semantic-lambda
- (list
- "!="))
- )
- (punctuation
- "\\`[+]\\'"
- punctuation
- "\\`[=]\\'"
- ,(semantic-lambda
- (list
- "+="))
- )
- (punctuation
- "\\`[-]\\'"
- punctuation
- "\\`[=]\\'"
- ,(semantic-lambda
- (list
- "-="))
- )
- (punctuation
- "\\`[*]\\'"
- punctuation
- "\\`[=]\\'"
- ,(semantic-lambda
- (list
- "*="))
- )
- (punctuation
- "\\`[/]\\'"
- punctuation
- "\\`[=]\\'"
- ,(semantic-lambda
- (list
- "/="))
- )
- (punctuation
- "\\`[%]\\'"
- punctuation
- "\\`[=]\\'"
- ,(semantic-lambda
- (list
- "%="))
- )
- (punctuation
- "\\`[&]\\'"
- punctuation
- "\\`[=]\\'"
- ,(semantic-lambda
- (list
- "&="))
- )
- (punctuation
- "\\`[|]\\'"
- punctuation
- "\\`[=]\\'"
- ,(semantic-lambda
- (list
- "|="))
- )
- (punctuation
- "\\`[-]\\'"
- punctuation
- "\\`[>]\\'"
- punctuation
- "\\`[*]\\'"
- ,(semantic-lambda
- (list
- "->*"))
- )
- (punctuation
- "\\`[-]\\'"
- punctuation
- "\\`[>]\\'"
- ,(semantic-lambda
- (list
- "->"))
- )
- (semantic-list
- "()"
- ,(semantic-lambda
- (list
- "()"))
- )
- (semantic-list
- "\\[\\]"
- ,(semantic-lambda
- (list
- "[]"))
- )
- (punctuation
- "\\`[<]\\'")
- (punctuation
- "\\`[>]\\'")
- (punctuation
- "\\`[*]\\'")
- (punctuation
- "\\`[+]\\'"
- punctuation
- "\\`[+]\\'"
- ,(semantic-lambda
- (list
- "++"))
- )
- (punctuation
- "\\`[+]\\'")
- (punctuation
- "\\`[-]\\'"
- punctuation
- "\\`[-]\\'"
- ,(semantic-lambda
- (list
- "--"))
- )
- (punctuation
- "\\`[-]\\'")
- (punctuation
- "\\`[&]\\'"
- punctuation
- "\\`[&]\\'"
- ,(semantic-lambda
- (list
- "&&"))
- )
- (punctuation
- "\\`[&]\\'")
- (punctuation
- "\\`[|]\\'"
- punctuation
- "\\`[|]\\'"
- ,(semantic-lambda
- (list
- "||"))
- )
- (punctuation
- "\\`[|]\\'")
- (punctuation
- "\\`[/]\\'")
- (punctuation
- "\\`[=]\\'")
- (punctuation
- "\\`[!]\\'")
- (punctuation
- "\\`[~]\\'")
- (punctuation
- "\\`[%]\\'")
- (punctuation
- "\\`[,]\\'")
- (punctuation
- "\\`\\^\\'"
- punctuation
- "\\`[=]\\'"
- ,(semantic-lambda
- (list
- "^="))
- )
- (punctuation
- "\\`\\^\\'")
- ) ;; end operatorsym
-
- (functionname
- (OPERATOR
- operatorsym
- ,(semantic-lambda
- (nth 1 vals))
- )
- (semantic-list
- ,(lambda (vals start end)
- (semantic-bovinate-from-nonterminal
- (car
- (nth 0 vals))
- (cdr
- (nth 0 vals))
- 'function-pointer))
- )
- (symbol
- ,(semantic-lambda
- (list
- (nth 0 vals)))
- )
- ) ;; end functionname
-
- (function-pointer
- (open-paren
- "("
- punctuation
- "\\`[*]\\'"
- symbol
- close-paren
- ")"
- ,(semantic-lambda
- (list
- (concat
- "*"
- (nth 2 vals))))
- )
- (open-paren
- "("
- symbol
- close-paren
- ")"
- ,(semantic-lambda
- (list
- (nth 1 vals)))
- )
- ) ;; end function-pointer
-
- (fun-or-proto-end
- (punctuation
- "\\`[;]\\'"
- ,(semantic-lambda
- (list t))
- )
- (semantic-list
- ,(semantic-lambda
- (list nil))
- )
- (punctuation
- "\\`[=]\\'"
- number
- "^0$"
- punctuation
- "\\`[;]\\'"
- ,(semantic-lambda
- (list ':pure-virtual-flag))
- )
- (fun-try-end
- ,(semantic-lambda
- (list nil))
- )
- ) ;; end fun-or-proto-end
-
- (fun-try-end
- (TRY
- opt-initializers
- semantic-list
- "^{"
- fun-try-several-catches
- ,(semantic-lambda
- (list nil))
- )
- ) ;; end fun-try-end
-
- (fun-try-several-catches
- (CATCH
- semantic-list
- "^("
- semantic-list
- "^{"
- fun-try-several-catches
- ,(semantic-lambda)
- )
- (CATCH
- semantic-list
- "^{"
- fun-try-several-catches
- ,(semantic-lambda)
- )
- ( ;;EMPTY
- ,(semantic-lambda)
- )
- ) ;; end fun-try-several-catches
-
- (type-cast
- (semantic-list
- ,(lambda (vals start end)
- (semantic-bovinate-from-nonterminal
- (car
- (nth 0 vals))
- (cdr
- (nth 0 vals))
- 'type-cast-list))
- )
- ) ;; end type-cast
-
- (type-cast-list
- (open-paren
- typeformbase
- close-paren)
- ) ;; end type-cast-list
-
- (opt-stuff-after-symbol
- (semantic-list
- "^(")
- (semantic-list
- "\\[.*\\]$")
- ( ;;EMPTY
- )
- ) ;; end opt-stuff-after-symbol
-
- (multi-stage-dereference
- (namespace-symbol
- opt-stuff-after-symbol
- punctuation
- "\\`[.]\\'"
- multi-stage-dereference)
- (namespace-symbol
- opt-stuff-after-symbol
- punctuation
- "\\`[-]\\'"
- punctuation
- "\\`[>]\\'"
- multi-stage-dereference)
- (namespace-symbol
- opt-stuff-after-symbol)
- ) ;; end multi-stage-dereference
-
- (string-seq
- (string
- string-seq
- ,(semantic-lambda
- (list
- (concat
- (nth 0 vals)
- (car
- (nth 1 vals)))))
- )
- (string
- ,(semantic-lambda
- (list
- (nth 0 vals)))
- )
- ) ;; end string-seq
-
- (expr-start
- (punctuation
- "\\`[-]\\'")
- (punctuation
- "\\`[+]\\'")
- (punctuation
- "\\`[*]\\'")
- (punctuation
- "\\`[&]\\'")
- ) ;; end expr-start
-
- (expr-binop
- (punctuation
- "\\`[-]\\'")
- (punctuation
- "\\`[+]\\'")
- (punctuation
- "\\`[*]\\'")
- (punctuation
- "\\`[/]\\'")
- (punctuation
- "\\`[&]\\'"
- punctuation
- "\\`[&]\\'")
- (punctuation
- "\\`[&]\\'")
- (punctuation
- "\\`[|]\\'"
- punctuation
- "\\`[|]\\'")
- (punctuation
- "\\`[|]\\'")
- ) ;; end expr-binop
-
- (expression
- (unaryexpression
- expr-binop
- unaryexpression
- ,(semantic-lambda
- (list
- (identity start)
- (identity end)))
- )
- (unaryexpression
- ,(semantic-lambda
- (list
- (identity start)
- (identity end)))
- )
- ) ;; end expression
-
- (unaryexpression
- (number)
- (multi-stage-dereference)
- (NEW
- multi-stage-dereference)
- (NEW
- builtintype-types
- semantic-list)
- (namespace-symbol)
- (string-seq)
- (type-cast
- expression)
- (semantic-list
- expression)
- (semantic-list)
- (expr-start
- expression)
- ) ;; end unaryexpression
- )
- "Parser table.")
-
-(defun semantic-c-by--install-parser ()
- "Setup the Semantic Parser."
- (setq semantic--parse-table semantic-c-by--parse-table
- semantic-debug-parser-source "c.by"
- semantic-debug-parser-class 'semantic-bovine-debug-parser
- semantic-flex-keywords-obarray semantic-c-by--keyword-table
- semantic-equivalent-major-modes '(c-mode c++-mode)
- ))
-
-
-;;; Analyzers
-;;
-
-;;; Epilogue
-;;
-
-(provide 'semantic/bovine/c-by)
-
-;;; semantic/bovine/c-by.el ends here
diff --git a/lisp/cedet/semantic/bovine/grammar.el b/lisp/cedet/semantic/bovine/grammar.el
index 0133ee72b18..8a87fa9170e 100644
--- a/lisp/cedet/semantic/bovine/grammar.el
+++ b/lisp/cedet/semantic/bovine/grammar.el
@@ -443,34 +443,39 @@ Menu items are appended to the common grammar menu.")
)
"Semantic grammar macros used in bovine grammars.")
-(defun bovine-make-parsers ()
- "Generate Emacs' built-in Bovine-based parser files."
- (interactive)
- (semantic-mode 1)
- ;; Loop through each .by file in current directory, and run
- ;; `semantic-grammar-batch-build-one-package' to build the grammar.
- (dolist (f (directory-files default-directory nil "\\.by\\'"))
- (let ((packagename
- (condition-case err
- (with-current-buffer (find-file-noselect f)
- (semantic-grammar-create-package))
- (error (message "%s" (error-message-string err)) nil)))
- lang filename copyright-end)
- (when (and packagename
- (string-match "^.*/\\(.*\\)-by\\.el\\'" packagename))
- (setq lang (match-string 1 packagename))
- (setq filename (concat lang "-by.el"))
- (with-temp-buffer
- (insert-file-contents filename)
- (setq buffer-file-name (expand-file-name filename))
- ;; Fix copyright header:
- (goto-char (point-min))
- (re-search-forward "^;; Author:")
- (setq copyright-end (match-beginning 0))
- (re-search-forward "^;;; Code:\n")
- (delete-region copyright-end (match-end 0))
- (goto-char copyright-end)
- (insert ";; This file is part of GNU Emacs.
+(defun bovine--make-parser-1 (infile &optional outdir)
+ (if outdir (setq outdir (file-name-directory (expand-file-name outdir))))
+ ;; It would be nicer to use a temp-buffer rather than find-file-noselect.
+ ;; The only thing stopping us is bovine-grammar-setupcode-builder's
+ ;; use of (buffer-name). Perhaps that could be changed to
+ ;; (file-name-nondirectory (buffer-file-name)) ?
+;; (with-temp-buffer
+;; (insert-file-contents infile)
+;; (bovine-grammar-mode)
+;; (setq buffer-file-name (expand-file-name infile))
+;; (if outdir (setq default-directory outdir))
+ (let ((packagename
+ ;; This is with-demoted-errors.
+ (condition-case err
+ (with-current-buffer (find-file-noselect infile)
+ (if outdir (setq default-directory outdir))
+ (semantic-grammar-create-package nil t))
+ (error (message "%s" (error-message-string err)) nil)))
+ lang filename copyright-end)
+ (when (and packagename
+ (string-match "^.*/\\(.*\\)-by\\.el\\'" packagename))
+ (setq lang (match-string 1 packagename))
+ (setq filename (expand-file-name (concat lang "-by.el") outdir))
+ (with-temp-file filename
+ (insert-file-contents filename)
+ ;; Fix copyright header:
+ (goto-char (point-min))
+ (re-search-forward "^;; Author:")
+ (setq copyright-end (match-beginning 0))
+ (re-search-forward "^;;; Code:\n")
+ (delete-region copyright-end (match-end 0))
+ (goto-char copyright-end)
+ (insert ";; 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
@@ -488,18 +493,50 @@ Menu items are appended to the common grammar menu.")
;;; Commentary:
;;
;; This file was generated from admin/grammars/"
- lang ".by.
+ lang ".by.
;;; Code:
")
- (goto-char (point-min))
- (delete-region (point-min) (line-end-position))
- (insert ";;; " packagename
- " --- Generated parser support file")
- (delete-trailing-whitespace)
- (re-search-forward ";;; \\(.*\\) ends here")
- (replace-match packagename nil nil nil 1)
- (save-buffer))))))
+ (goto-char (point-min))
+ (delete-region (point-min) (line-end-position))
+ (insert ";;; " packagename
+ " --- Generated parser support file")
+ (delete-trailing-whitespace)
+ (re-search-forward ";;; \\(.*\\) ends here")
+ (replace-match packagename nil nil nil 1)))))
+
+(defun bovine-make-parsers ()
+ "Generate Emacs's built-in Bovine-based parser files."
+ (interactive)
+ (semantic-mode 1)
+ ;; Loop through each .by file in current directory, and run
+ ;; `semantic-grammar-batch-build-one-package' to build the grammar.
+ (dolist (f (directory-files default-directory nil "\\.by\\'"))
+ (bovine--make-parser-1 f)))
+
+
+(defun bovine-batch-make-parser (&optional infile outdir)
+ "Generate a Bovine parser from input INFILE, writing to OUTDIR.
+This is mainly intended for use in batch mode:
+
+emacs -batch -l semantic/bovine/grammar -f bovine-make-parser-batch \\
+ [-dir output-dir | -o output-file] file.by
+
+If -o is supplied, only the directory part is used."
+ (semantic-mode 1)
+ (when (and noninteractive (not infile))
+ (let (arg)
+ (while command-line-args-left
+ (setq arg (pop command-line-args-left))
+ (cond ((string-equal arg "-dir")
+ (setq outdir (pop command-line-args-left)))
+ ((string-equal arg "-o")
+ (setq outdir (file-name-directory (pop command-line-args-left))))
+ (t (setq infile arg))))))
+ (or infile (error "No input file specified"))
+ (or (file-readable-p infile)
+ (error "Input file `%s' not readable" infile))
+ (bovine--make-parser-1 infile outdir))
(provide 'semantic/bovine/grammar)
diff --git a/lisp/cedet/semantic/bovine/make-by.el b/lisp/cedet/semantic/bovine/make-by.el
deleted file mode 100644
index b94cfa44aac..00000000000
--- a/lisp/cedet/semantic/bovine/make-by.el
+++ /dev/null
@@ -1,391 +0,0 @@
-;;; semantic/bovine/make-by.el --- Generated parser support file
-
-;; Copyright (C) 1999-2004, 2008-2013 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/>.
-
-;;; Commentary:
-;;
-;; This file was generated from admin/grammars/make.by.
-
-;;; Code:
-
-(require 'semantic/lex)
-(eval-when-compile (require 'semantic/bovine))
-
-;;; Prologue
-;;
-
-;;; Declarations
-;;
-(defconst semantic-make-by--keyword-table
- (semantic-lex-make-keyword-table
- '(("if" . IF)
- ("ifdef" . IFDEF)
- ("ifndef" . IFNDEF)
- ("ifeq" . IFEQ)
- ("ifneq" . IFNEQ)
- ("else" . ELSE)
- ("endif" . ENDIF)
- ("include" . INCLUDE))
- '(("include" summary "Macro: include filename1 filename2 ...")
- ("ifneq" summary "Conditional: ifneq (expression) ... else ... endif")
- ("ifeq" summary "Conditional: ifeq (expression) ... else ... endif")
- ("ifndef" summary "Conditional: ifndef (expression) ... else ... endif")
- ("ifdef" summary "Conditional: ifdef (expression) ... else ... endif")
- ("endif" summary "Conditional: if (expression) ... else ... endif")
- ("else" summary "Conditional: if (expression) ... else ... endif")
- ("if" summary "Conditional: if (expression) ... else ... endif")))
- "Table of language keywords.")
-
-(defconst semantic-make-by--token-table
- (semantic-lex-make-type-table
- '(("punctuation"
- (BACKSLASH . "\\`[\\]\\'")
- (DOLLAR . "\\`[$]\\'")
- (EQUAL . "\\`[=]\\'")
- (PLUS . "\\`[+]\\'")
- (COLON . "\\`[:]\\'")))
- 'nil)
- "Table of lexical tokens.")
-
-(defconst semantic-make-by--parse-table
- `(
- (bovine-toplevel
- (Makefile)
- ) ;; end bovine-toplevel
-
- (Makefile
- (bol
- newline
- ,(semantic-lambda
- (list nil))
- )
- (bol
- variable
- ,(semantic-lambda
- (nth 1 vals))
- )
- (bol
- rule
- ,(semantic-lambda
- (nth 1 vals))
- )
- (bol
- conditional
- ,(semantic-lambda
- (nth 1 vals))
- )
- (bol
- include
- ,(semantic-lambda
- (nth 1 vals))
- )
- (whitespace
- ,(semantic-lambda
- (list nil))
- )
- (newline
- ,(semantic-lambda
- (list nil))
- )
- ) ;; end Makefile
-
- (variable
- (symbol
- opt-whitespace
- equals
- opt-whitespace
- element-list
- ,(semantic-lambda
- (semantic-tag-new-variable
- (nth 0 vals) nil
- (nth 4 vals)))
- )
- ) ;; end variable
-
- (rule
- (targets
- opt-whitespace
- colons
- opt-whitespace
- element-list
- commands
- ,(semantic-lambda
- (semantic-tag-new-function
- (nth 0 vals) nil
- (nth 4 vals)))
- )
- ) ;; end rule
-
- (targets
- (target
- opt-whitespace
- targets
- ,(semantic-lambda
- (list
- (car
- (nth 0 vals))
- (car
- (nth 2 vals))))
- )
- (target
- ,(semantic-lambda
- (list
- (car
- (nth 0 vals))))
- )
- ) ;; end targets
-
- (target
- (sub-target
- target
- ,(semantic-lambda
- (list
- (concat
- (car
- (nth 0 vals))
- (car
- (nth 2 vals)))))
- )
- (sub-target
- ,(semantic-lambda
- (list
- (car
- (nth 0 vals))))
- )
- ) ;; end target
-
- (sub-target
- (symbol)
- (string)
- (varref)
- ) ;; end sub-target
-
- (conditional
- (IF
- some-whitespace
- symbol
- newline
- ,(semantic-lambda
- (list nil))
- )
- (IFDEF
- some-whitespace
- symbol
- newline
- ,(semantic-lambda
- (list nil))
- )
- (IFNDEF
- some-whitespace
- symbol
- newline
- ,(semantic-lambda
- (list nil))
- )
- (IFEQ
- some-whitespace
- expression
- newline
- ,(semantic-lambda
- (list nil))
- )
- (IFNEQ
- some-whitespace
- expression
- newline
- ,(semantic-lambda
- (list nil))
- )
- (ELSE
- newline
- ,(semantic-lambda
- (list nil))
- )
- (ENDIF
- newline
- ,(semantic-lambda
- (list nil))
- )
- ) ;; end conditional
-
- (expression
- (semantic-list)
- ) ;; end expression
-
- (include
- (INCLUDE
- some-whitespace
- element-list
- ,(semantic-lambda
- (semantic-tag-new-include
- (nth 2 vals) nil))
- )
- ) ;; end include
-
- (equals
- (punctuation
- "\\`[:]\\'"
- punctuation
- "\\`[=]\\'"
- ,(semantic-lambda)
- )
- (punctuation
- "\\`[+]\\'"
- punctuation
- "\\`[=]\\'"
- ,(semantic-lambda)
- )
- (punctuation
- "\\`[=]\\'"
- ,(semantic-lambda)
- )
- ) ;; end equals
-
- (colons
- (punctuation
- "\\`[:]\\'"
- punctuation
- "\\`[:]\\'"
- ,(semantic-lambda)
- )
- (punctuation
- "\\`[:]\\'"
- ,(semantic-lambda)
- )
- ) ;; end colons
-
- (element-list
- (elements
- newline
- ,(semantic-lambda
- (nth 0 vals))
- )
- ) ;; end element-list
-
- (elements
- (element
- some-whitespace
- elements
- ,(semantic-lambda
- (nth 0 vals)
- (nth 2 vals))
- )
- (element
- ,(semantic-lambda
- (nth 0 vals))
- )
- ( ;;EMPTY
- )
- ) ;; end elements
-
- (element
- (sub-element
- element
- ,(semantic-lambda
- (list
- (concat
- (car
- (nth 0 vals))
- (car
- (nth 1 vals)))))
- )
- ( ;;EMPTY
- )
- ) ;; end element
-
- (sub-element
- (symbol)
- (string)
- (punctuation)
- (semantic-list
- ,(semantic-lambda
- (list
- (buffer-substring-no-properties
- (identity start)
- (identity end))))
- )
- ) ;; end sub-element
-
- (varref
- (punctuation
- "\\`[$]\\'"
- semantic-list
- ,(semantic-lambda
- (list
- (buffer-substring-no-properties
- (identity start)
- (identity end))))
- )
- ) ;; end varref
-
- (commands
- (bol
- shell-command
- newline
- commands
- ,(semantic-lambda
- (list
- (nth 0 vals))
- (nth 1 vals))
- )
- ( ;;EMPTY
- ,(semantic-lambda)
- )
- ) ;; end commands
-
- (opt-whitespace
- (some-whitespace
- ,(semantic-lambda
- (list nil))
- )
- ( ;;EMPTY
- )
- ) ;; end opt-whitespace
-
- (some-whitespace
- (whitespace
- some-whitespace
- ,(semantic-lambda
- (list nil))
- )
- (whitespace
- ,(semantic-lambda
- (list nil))
- )
- ) ;; end some-whitespace
- )
- "Parser table.")
-
-(defun semantic-make-by--install-parser ()
- "Setup the Semantic Parser."
- (setq semantic--parse-table semantic-make-by--parse-table
- semantic-debug-parser-source "make.by"
- semantic-debug-parser-class 'semantic-bovine-debug-parser
- semantic-flex-keywords-obarray semantic-make-by--keyword-table
- ))
-
-
-;;; Analyzers
-;;
-
-;;; Epilogue
-;;
-
-(provide 'semantic/bovine/make-by)
-
-;;; semantic/bovine/make-by.el ends here
diff --git a/lisp/cedet/semantic/bovine/scm-by.el b/lisp/cedet/semantic/bovine/scm-by.el
deleted file mode 100644
index 261607c84d1..00000000000
--- a/lisp/cedet/semantic/bovine/scm-by.el
+++ /dev/null
@@ -1,196 +0,0 @@
-;;; semantic/bovine/scm-by.el --- Generated parser support file
-
-;; Copyright (C) 2001, 2003, 2009-2013 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/>.
-
-;;; Commentary:
-;;
-;; This file was generated from admin/grammars/scm.by.
-
-;;; Code:
-
-(require 'semantic/lex)
-(eval-when-compile (require 'semantic/bovine))
-
-;;; Prologue
-;;
-
-;;; Declarations
-;;
-(defconst semantic-scm-by--keyword-table
- (semantic-lex-make-keyword-table
- '(("define" . DEFINE)
- ("define-module" . DEFINE-MODULE)
- ("load" . LOAD))
- '(("load" summary "Function: (load \"filename\")")
- ("define-module" summary "Function: (define-module (name arg1 ...)) ")
- ("define" summary "Function: (define symbol expression)")))
- "Table of language keywords.")
-
-(defconst semantic-scm-by--token-table
- (semantic-lex-make-type-table
- '(("close-paren"
- (CLOSEPAREN . ")"))
- ("open-paren"
- (OPENPAREN . "(")))
- 'nil)
- "Table of lexical tokens.")
-
-(defconst semantic-scm-by--parse-table
- `(
- (bovine-toplevel
- (scheme)
- ) ;; end bovine-toplevel
-
- (scheme
- (semantic-list
- ,(lambda (vals start end)
- (semantic-bovinate-from-nonterminal
- (car
- (nth 0 vals))
- (cdr
- (nth 0 vals))
- 'scheme-list))
- )
- ) ;; end scheme
-
- (scheme-list
- (open-paren
- "("
- scheme-in-list
- close-paren
- ")"
- ,(semantic-lambda
- (nth 1 vals))
- )
- ) ;; end scheme-list
-
- (scheme-in-list
- (DEFINE
- symbol
- expression
- ,(semantic-lambda
- (semantic-tag-new-variable
- (nth 1 vals) nil
- (nth 2 vals)))
- )
- (DEFINE
- name-args
- opt-doc
- sequence
- ,(semantic-lambda
- (semantic-tag-new-function
- (car
- (nth 1 vals)) nil
- (cdr
- (nth 1 vals))))
- )
- (DEFINE-MODULE
- name-args
- ,(semantic-lambda
- (semantic-tag-new-package
- (nth
- (length
- (nth 1 vals))
- (nth 1 vals)) nil))
- )
- (LOAD
- string
- ,(semantic-lambda
- (semantic-tag-new-include
- (file-name-nondirectory
- (read
- (nth 1 vals)))
- (read
- (nth 1 vals))))
- )
- (symbol
- ,(semantic-lambda
- (semantic-tag-new-code
- (nth 0 vals) nil))
- )
- ) ;; end scheme-in-list
-
- (name-args
- (semantic-list
- ,(lambda (vals start end)
- (semantic-bovinate-from-nonterminal
- (car
- (nth 0 vals))
- (cdr
- (nth 0 vals))
- 'name-arg-expand))
- )
- ) ;; end name-args
-
- (name-arg-expand
- (open-paren
- name-arg-expand
- ,(semantic-lambda
- (nth 1 vals))
- )
- (symbol
- name-arg-expand
- ,(semantic-lambda
- (cons
- (nth 0 vals)
- (nth 1 vals)))
- )
- ( ;;EMPTY
- ,(semantic-lambda)
- )
- ) ;; end name-arg-expand
-
- (opt-doc
- (string)
- ( ;;EMPTY
- )
- ) ;; end opt-doc
-
- (sequence
- (expression
- sequence)
- (expression)
- ) ;; end sequence
-
- (expression
- (symbol)
- (semantic-list)
- (string)
- (number)
- ) ;; end expression
- )
- "Parser table.")
-
-(defun semantic-scm-by--install-parser ()
- "Setup the Semantic Parser."
- (setq semantic--parse-table semantic-scm-by--parse-table
- semantic-debug-parser-source "scheme.by"
- semantic-debug-parser-class 'semantic-bovine-debug-parser
- semantic-flex-keywords-obarray semantic-scm-by--keyword-table
- ))
-
-
-;;; Analyzers
-;;
-
-;;; Epilogue
-;;
-
-(provide 'semantic/bovine/scm-by)
-
-;;; semantic/bovine/scm-by.el ends here
diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el
index 8d9cfcccd7d..614ce706b0c 100644
--- a/lisp/cedet/semantic/db.el
+++ b/lisp/cedet/semantic/db.el
@@ -697,7 +697,7 @@ form."
(interactive)
(unless noninteractive
(message "Saving tag summaries..."))
- (let ((semanticdb--inhibit-make-directory nil))
+ (let ((semanticdb--inhibit-make-directory noninteractive))
(mapc 'semanticdb-save-db semanticdb-database-list))
(unless noninteractive
(message "Saving tag summaries...done")))
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el
index a545fcaee46..ca36829df82 100644
--- a/lisp/cedet/semantic/grammar.el
+++ b/lisp/cedet/semantic/grammar.el
@@ -33,6 +33,8 @@
(require 'semantic/wisent)
(require 'semantic/ctxt)
(require 'semantic/format)
+;; FIXME this is a generated file, but we need to load this file to
+;; generate it!
(require 'semantic/grammar-wy)
(require 'semantic/idle)
(require 'help-fns)
@@ -605,6 +607,11 @@ The symbols in the template are local variables in
\(provide '" libr ")
+;; Local Variables:
+;; version-control: never
+;; no-update-autoloads: t
+;; End:
+
;;; " file " ends here
")
"Generated footer template.
@@ -822,9 +829,10 @@ Block definitions are read from the current table of lexical types."
(noninteractive)
noninteractive))
-(defun semantic-grammar-create-package (&optional force)
+(defun semantic-grammar-create-package (&optional force uptodate)
"Create package Lisp code from grammar in current buffer.
-Does nothing if the Lisp code seems up to date.
+If the Lisp code seems up to date, do nothing (if UPTODATE
+is non-nil, return nil in such cases).
If optional argument FORCE is non-nil, unconditionally re-generate the
Lisp code."
(interactive "P")
@@ -854,7 +862,12 @@ Lisp code."
(file-newer-than-file-p
(buffer-file-name semantic--grammar-output-buffer)
(buffer-file-name semantic--grammar-input-buffer)))
- (message "Package `%s' is up to date." semantic--grammar-package)
+ (progn
+ (message "Package `%s' is up to date." semantic--grammar-package)
+ ;; It would be better if this were always the case, IMO,
+ ;; but the (unspecified) return value of this function is
+ ;; assumed to be non-nil in some places, it seems.
+ (if uptodate (setq output nil)))
;; Create the package
(set-buffer semantic--grammar-output-buffer)
;; Use Unix EOLs, so that the file is portable to all platforms.
@@ -1914,6 +1927,7 @@ Optional argument COLOR determines if color is added to the text."
(provide 'semantic/grammar)
+
;; Local variables:
;; generated-autoload-load-name: "semantic/grammar"
;; End:
diff --git a/lisp/cedet/semantic/wisent/grammar.el b/lisp/cedet/semantic/wisent/grammar.el
index 109d5ae7dfb..f61b05fa2e6 100644
--- a/lisp/cedet/semantic/wisent/grammar.el
+++ b/lisp/cedet/semantic/wisent/grammar.el
@@ -473,6 +473,54 @@ Menu items are appended to the common grammar menu.")
\;; 2009, 2010 Python Software Foundation; All Rights Reserved"
,wisent-make-parsers--python-license)))
+;; Cf bovine--make-parser-1.
+(defun wisent--make-parser-1 (infile &optional outdir)
+ (if outdir (setq outdir (file-name-directory (expand-file-name outdir))))
+ (let ((packagename
+ ;; This is with-demoted-errors.
+ (condition-case err
+ (with-current-buffer (find-file-noselect infile)
+ (if outdir (setq default-directory outdir))
+ (semantic-grammar-create-package nil t))
+ (error (message "%s" (error-message-string err)) nil)))
+ output-data)
+ (when (setq output-data (assoc packagename wisent-make-parsers--parser-file-name))
+ (let ((additional-copyright (nth 1 output-data))
+ (additional-license (nth 2 output-data))
+ (filename (expand-file-name
+ (progn (string-match ".*/\\(.*\\)" packagename)
+ (match-string 1 packagename))
+ outdir))
+ copyright-end)
+ ;; Touch up the generated parsers for Emacs integration.
+ (with-temp-file filename
+ (insert-file-contents filename)
+ ;; Fix copyright header:
+ (goto-char (point-min))
+ (when additional-copyright
+ (re-search-forward "Copyright (C).*$")
+ (insert "\n;; " additional-copyright))
+ (re-search-forward "^;; Author:")
+ (setq copyright-end (match-beginning 0))
+ (re-search-forward "^;;; Code:\n")
+ (delete-region copyright-end (match-end 0))
+ (goto-char copyright-end)
+ (insert wisent-make-parsers--emacs-license)
+ (insert "\n\n;;; Commentary:
+;;
+;; This file was generated from admin/grammars/"
+ (file-name-nondirectory infile) ".")
+ (when additional-license
+ (insert "\n" additional-license))
+ (insert "\n\n;;; Code:\n")
+ (goto-char (point-min))
+ (delete-region (point-min) (line-end-position))
+ (insert ";;; " packagename
+ " --- Generated parser support file")
+ (re-search-forward ";;; \\(.*\\) ends here")
+ (replace-match packagename nil nil nil 1)
+ (delete-trailing-whitespace))))))
+
(defun wisent-make-parsers ()
"Generate Emacs' built-in Wisent-based parser files."
(interactive)
@@ -480,46 +528,32 @@ Menu items are appended to the common grammar menu.")
;; Loop through each .wy file in current directory, and run
;; `semantic-grammar-batch-build-one-package' to build the grammar.
(dolist (f (directory-files default-directory nil "\\.wy\\'"))
- (let ((packagename
- (condition-case err
- (with-current-buffer (find-file-noselect f)
- (semantic-grammar-create-package))
- (error (message "%s" (error-message-string err)) nil)))
- output-data)
- (when (setq output-data (assoc packagename wisent-make-parsers--parser-file-name))
- (let ((additional-copyright (nth 1 output-data))
- (additional-license (nth 2 output-data))
- (filename (progn (string-match ".*/\\(.*\\)" packagename) (match-string 1 packagename)))
- copyright-end)
- ;; Touch up the generated parsers for Emacs integration.
- (with-temp-buffer
- (insert-file-contents filename)
- ;; Fix copyright header:
- (goto-char (point-min))
- (when additional-copyright
- (re-search-forward "Copyright (C).*$")
- (insert "\n;; " additional-copyright))
- (re-search-forward "^;; Author:")
- (setq copyright-end (match-beginning 0))
- (re-search-forward "^;;; Code:\n")
- (delete-region copyright-end (match-end 0))
- (goto-char copyright-end)
- (insert wisent-make-parsers--emacs-license)
- (insert "\n\n;;; Commentary:
-;;
-;; This file was generated from admin/grammars/"
- f ".")
- (when additional-license
- (insert "\n" additional-license))
- (insert "\n\n;;; Code:\n")
- (goto-char (point-min))
- (delete-region (point-min) (line-end-position))
- (insert ";;; " packagename
- " --- Generated parser support file")
- (re-search-forward ";;; \\(.*\\) ends here")
- (replace-match packagename nil nil nil 1)
- (delete-trailing-whitespace)
- (write-region nil nil (expand-file-name filename))))))))
+ (wisent--make-parser-1 f)))
+
+
+(defun wisent-batch-make-parser (&optional infile outdir)
+ "Generate a Wisent parser from input INFILE, writing to OUTDIR.
+This is mainly intended for use in batch mode:
+
+emacs -batch -l semantic/wisent/grammar -f wisent-make-parser-batch \\
+ [-dir output-dir | -o output-file] file.by
+
+If -o is supplied, only the directory part is used."
+ (semantic-mode 1)
+ (when (and noninteractive (not infile))
+ (let (arg)
+ (while command-line-args-left
+ (setq arg (pop command-line-args-left))
+ (cond ((string-equal arg "-dir")
+ (setq outdir (pop command-line-args-left)))
+ ((string-equal arg "-o")
+ (setq outdir (file-name-directory (pop command-line-args-left))))
+ (t (setq infile arg))))))
+ (or infile (error "No input file specified"))
+ (or (file-readable-p infile)
+ (error "Input file `%s' not readable" infile))
+ (wisent--make-parser-1 infile outdir))
+
(provide 'semantic/wisent/grammar)
diff --git a/lisp/cedet/semantic/wisent/javat-wy.el b/lisp/cedet/semantic/wisent/javat-wy.el
deleted file mode 100644
index 1156cb5792c..00000000000
--- a/lisp/cedet/semantic/wisent/javat-wy.el
+++ /dev/null
@@ -1,688 +0,0 @@
-;;; semantic/wisent/javat-wy.el --- Generated parser support file
-
-;; Copyright (C) 2002-2013 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/>.
-
-;;; Commentary:
-;;
-;; This file was generated from admin/grammars/java-tags.wy.
-
-;;; Code:
-
-(require 'semantic/lex)
-(eval-when-compile (require 'semantic/bovine))
-
-;;; Prologue
-;;
-(declare-function semantic-parse-region "semantic"
- (start end &optional nonterminal depth returnonerror))
-
-;;; Declarations
-;;
-(defconst wisent-java-tags-wy--keyword-table
- (semantic-lex-make-keyword-table
- '(("abstract" . ABSTRACT)
- ("boolean" . BOOLEAN)
- ("break" . BREAK)
- ("byte" . BYTE)
- ("case" . CASE)
- ("catch" . CATCH)
- ("char" . CHAR)
- ("class" . CLASS)
- ("const" . CONST)
- ("continue" . CONTINUE)
- ("default" . DEFAULT)
- ("do" . DO)
- ("double" . DOUBLE)
- ("else" . ELSE)
- ("extends" . EXTENDS)
- ("final" . FINAL)
- ("finally" . FINALLY)
- ("float" . FLOAT)
- ("for" . FOR)
- ("goto" . GOTO)
- ("if" . IF)
- ("implements" . IMPLEMENTS)
- ("import" . IMPORT)
- ("instanceof" . INSTANCEOF)
- ("int" . INT)
- ("interface" . INTERFACE)
- ("long" . LONG)
- ("native" . NATIVE)
- ("new" . NEW)
- ("package" . PACKAGE)
- ("private" . PRIVATE)
- ("protected" . PROTECTED)
- ("public" . PUBLIC)
- ("return" . RETURN)
- ("short" . SHORT)
- ("static" . STATIC)
- ("strictfp" . STRICTFP)
- ("super" . SUPER)
- ("switch" . SWITCH)
- ("synchronized" . SYNCHRONIZED)
- ("this" . THIS)
- ("throw" . THROW)
- ("throws" . THROWS)
- ("transient" . TRANSIENT)
- ("try" . TRY)
- ("void" . VOID)
- ("volatile" . VOLATILE)
- ("while" . WHILE)
- ("@author" . _AUTHOR)
- ("@version" . _VERSION)
- ("@param" . _PARAM)
- ("@return" . _RETURN)
- ("@exception" . _EXCEPTION)
- ("@throws" . _THROWS)
- ("@see" . _SEE)
- ("@since" . _SINCE)
- ("@serial" . _SERIAL)
- ("@serialData" . _SERIALDATA)
- ("@serialField" . _SERIALFIELD)
- ("@deprecated" . _DEPRECATED))
- '(("@deprecated" javadoc
- (seq 12 usage
- (type function variable)
- opt t))
- ("@serialField" javadoc
- (seq 11 usage
- (variable)
- opt t))
- ("@serialData" javadoc
- (seq 10 usage
- (function)
- opt t))
- ("@serial" javadoc
- (seq 9 usage
- (variable)
- opt t))
- ("@since" javadoc
- (seq 8 usage
- (type function variable)
- opt t))
- ("@see" javadoc
- (seq 7 usage
- (type function variable)
- opt t with-ref t))
- ("@throws" javadoc
- (seq 6 usage
- (function)
- with-name t))
- ("@exception" javadoc
- (seq 5 usage
- (function)
- with-name t))
- ("@return" javadoc
- (seq 4 usage
- (function)))
- ("@param" javadoc
- (seq 3 usage
- (function)
- with-name t))
- ("@version" javadoc
- (seq 2 usage
- (type)))
- ("@author" javadoc
- (seq 1 usage
- (type)))
- ("while" summary "while (<expr>) <stmt> | do <stmt> while (<expr>);")
- ("volatile" summary "Field declaration modifier: volatile <type> <name> ...")
- ("void" summary "Method return type: void <name> ...")
- ("try" summary "try {<stmts>} [catch(<parm>) {<stmts>} ...] [finally {<stmts>}]")
- ("transient" summary "Field declaration modifier: transient <type> <name> ...")
- ("throws" summary "Method|Constructor declaration: throws <classType>, ...")
- ("throw" summary "throw <expr> ;")
- ("synchronized" summary "synchronized (<expr>) ... | Method decl. modifier: synchronized <type> <name> ...")
- ("switch" summary "switch(<expr>) {[case <const-expr>: <stmts> ...] [default: <stmts>]}")
- ("strictfp" summary "Declaration modifier: strictfp {class|interface|<type>} <name> ...")
- ("static" summary "Declaration modifier: static {class|interface|<type>} <name> ...")
- ("short" summary "Integral primitive type (-32768 to 32767)")
- ("return" summary "return [<expr>] ;")
- ("public" summary "Access level modifier: public {class|interface|<type>} <name> ...")
- ("protected" summary "Access level modifier: protected {class|interface|<type>} <name> ...")
- ("private" summary "Access level modifier: private {class|interface|<type>} <name> ...")
- ("package" summary "Package declaration: package <name>")
- ("native" summary "Method declaration modifier: native <type> <name> ...")
- ("long" summary "Integral primitive type (-9223372036854775808 to 9223372036854775807)")
- ("interface" summary "Interface declaration: interface <name>")
- ("int" summary "Integral primitive type (-2147483648 to 2147483647)")
- ("import" summary "Import package declarations: import <package>")
- ("implements" summary "Class SuperInterfaces declaration: implements <name> [, ...]")
- ("if" summary "if (<expr>) <stmt> [else <stmt>]")
- ("goto" summary "Unused reserved word")
- ("for" summary "for ([<init-expr>]; [<expr>]; [<update-expr>]) <stmt>")
- ("float" summary "Primitive floating-point type (single-precision 32-bit IEEE 754)")
- ("finally" summary "try {<stmts>} ... finally {<stmts>}")
- ("final" summary "Class|Member declaration modifier: final {class|<type>} <name> ...")
- ("extends" summary "SuperClass|SuperInterfaces declaration: extends <name> [, ...]")
- ("else" summary "if (<expr>) <stmt> else <stmt>")
- ("double" summary "Primitive floating-point type (double-precision 64-bit IEEE 754)")
- ("do" summary "do <stmt> while (<expr>);")
- ("default" summary "switch(<expr>) { ... default: <stmts>}")
- ("continue" summary "continue [<label>] ;")
- ("const" summary "Unused reserved word")
- ("class" summary "Class declaration: class <name>")
- ("char" summary "Integral primitive type (0 to 65535)")
- ("catch" summary "try {<stmts>} catch(<parm>) {<stmts>} ... ")
- ("case" summary "switch(<expr>) {case <const-expr>: <stmts> ... }")
- ("byte" summary "Integral primitive type (-128 to 127)")
- ("break" summary "break [<label>] ;")
- ("boolean" summary "Primitive logical quantity type (true or false)")
- ("abstract" summary "Class|Method declaration modifier: abstract {class|<type>} <name> ...")))
- "Table of language keywords.")
-
-(defconst wisent-java-tags-wy--token-table
- (semantic-lex-make-type-table
- '(("unicode"
- (unicodecharacter))
- ("number"
- (NUMBER_LITERAL))
- ("string"
- (STRING_LITERAL))
- ("symbol"
- (IDENTIFIER))
- ("punctuation"
- (COMP . "~")
- (OROR . "||")
- (OREQ . "|=")
- (OR . "|")
- (XOREQ . "^=")
- (XOR . "^")
- (QUESTION . "?")
- (URSHIFTEQ . ">>>=")
- (URSHIFT . ">>>")
- (RSHIFTEQ . ">>=")
- (RSHIFT . ">>")
- (GTEQ . ">=")
- (GT . ">")
- (EQEQ . "==")
- (EQ . "=")
- (LTEQ . "<=")
- (LSHIFTEQ . "<<=")
- (LSHIFT . "<<")
- (LT . "<")
- (SEMICOLON . ";")
- (COLON . ":")
- (DIVEQ . "/=")
- (DIV . "/")
- (DOT . ".")
- (MINUSEQ . "-=")
- (MINUSMINUS . "--")
- (MINUS . "-")
- (COMMA . ",")
- (PLUSEQ . "+=")
- (PLUSPLUS . "++")
- (PLUS . "+")
- (MULTEQ . "*=")
- (MULT . "*")
- (ANDEQ . "&=")
- (ANDAND . "&&")
- (AND . "&")
- (MODEQ . "%=")
- (MOD . "%")
- (NOTEQ . "!=")
- (NOT . "!"))
- ("close-paren"
- (RBRACK . "]")
- (RBRACE . "}")
- (RPAREN . ")"))
- ("open-paren"
- (LBRACK . "[")
- (LBRACE . "{")
- (LPAREN . "("))
- ("block"
- (BRACK_BLOCK . "(LBRACK RBRACK)")
- (BRACE_BLOCK . "(LBRACE RBRACE)")
- (PAREN_BLOCK . "(LPAREN RPAREN)")))
- '(("keyword" :declared t)
- ("unicode" syntax "\\\\u[0-9a-f][0-9a-f][0-9a-f][0-9a-f]")
- ("unicode" :declared t)
- ("number" :declared t)
- ("string" :declared t)
- ("symbol" :declared t)
- ("punctuation" :declared t)
- ("block" :declared t)))
- "Table of lexical tokens.")
-
-(defconst wisent-java-tags-wy--parse-table
- (progn
- (eval-when-compile
- (require 'semantic/wisent/comp))
- (wisent-compile-grammar
- '((PAREN_BLOCK BRACE_BLOCK BRACK_BLOCK LPAREN RPAREN LBRACE RBRACE LBRACK RBRACK NOT NOTEQ MOD MODEQ AND ANDAND ANDEQ MULT MULTEQ PLUS PLUSPLUS PLUSEQ COMMA MINUS MINUSMINUS MINUSEQ DOT DIV DIVEQ COLON SEMICOLON LT LSHIFT LSHIFTEQ LTEQ EQ EQEQ GT GTEQ RSHIFT RSHIFTEQ URSHIFT URSHIFTEQ QUESTION XOR XOREQ OR OREQ OROR COMP IDENTIFIER STRING_LITERAL NUMBER_LITERAL unicodecharacter ABSTRACT BOOLEAN BREAK BYTE CASE CATCH CHAR CLASS CONST CONTINUE DEFAULT DO DOUBLE ELSE EXTENDS FINAL FINALLY FLOAT FOR GOTO IF IMPLEMENTS IMPORT INSTANCEOF INT INTERFACE LONG NATIVE NEW PACKAGE PRIVATE PROTECTED PUBLIC RETURN SHORT STATIC STRICTFP SUPER SWITCH SYNCHRONIZED THIS THROW THROWS TRANSIENT TRY VOID VOLATILE WHILE _AUTHOR _VERSION _PARAM _RETURN _EXCEPTION _THROWS _SEE _SINCE _SERIAL _SERIALDATA _SERIALFIELD _DEPRECATED)
- nil
- (compilation_unit
- ((package_declaration))
- ((import_declaration))
- ((type_declaration)))
- (package_declaration
- ((PACKAGE qualified_name SEMICOLON)
- (wisent-raw-tag
- (semantic-tag-new-package $2 nil))))
- (import_declaration
- ((IMPORT qualified_name SEMICOLON)
- (wisent-raw-tag
- (semantic-tag-new-include $2 nil)))
- ((IMPORT qualified_name DOT MULT SEMICOLON)
- (wisent-raw-tag
- (semantic-tag-new-include
- (concat $2 $3 $4)
- nil))))
- (type_declaration
- ((SEMICOLON)
- nil)
- ((class_declaration))
- ((interface_declaration)))
- (class_declaration
- ((modifiers_opt CLASS qualified_name superc_opt interfaces_opt class_body)
- (wisent-raw-tag
- (semantic-tag-new-type $3 $2 $6
- (if
- (or $4 $5)
- (cons $4 $5))
- :typemodifiers $1))))
- (superc_opt
- (nil)
- ((EXTENDS qualified_name)
- (identity $2)))
- (interfaces_opt
- (nil)
- ((IMPLEMENTS qualified_name_list)
- (nreverse $2)))
- (class_body
- ((BRACE_BLOCK)
- (semantic-parse-region
- (car $region1)
- (cdr $region1)
- 'class_member_declaration 1)))
- (class_member_declaration
- ((LBRACE)
- nil)
- ((RBRACE)
- nil)
- ((block)
- nil)
- ((static_initializer)
- nil)
- ((constructor_declaration))
- ((interface_declaration))
- ((class_declaration))
- ((method_declaration))
- ((field_declaration)))
- (interface_declaration
- ((modifiers_opt INTERFACE qualified_name extends_interfaces_opt interface_body)
- (wisent-raw-tag
- (semantic-tag-new-type $3 $2 $5
- (if $4
- (cons nil $4))
- :typemodifiers $1))))
- (extends_interfaces_opt
- (nil)
- ((EXTENDS qualified_name_list)
- (identity $2)))
- (interface_body
- ((BRACE_BLOCK)
- (semantic-parse-region
- (car $region1)
- (cdr $region1)
- 'interface_member_declaration 1)))
- (interface_member_declaration
- ((LBRACE)
- nil)
- ((RBRACE)
- nil)
- ((interface_declaration))
- ((class_declaration))
- ((method_declaration))
- ((field_declaration)))
- (static_initializer
- ((STATIC block)))
- (constructor_declaration
- ((modifiers_opt constructor_declarator throwsc_opt constructor_body)
- (wisent-raw-tag
- (semantic-tag-new-function
- (car $2)
- nil
- (cdr $2)
- :typemodifiers $1 :throws $3 :constructor-flag t))))
- (constructor_declarator
- ((IDENTIFIER formal_parameter_list)
- (cons $1 $2)))
- (constructor_body
- ((block)))
- (method_declaration
- ((modifiers_opt VOID method_declarator throwsc_opt method_body)
- (wisent-raw-tag
- (semantic-tag-new-function
- (car $3)
- $2
- (cdr $3)
- :typemodifiers $1 :throws $4)))
- ((modifiers_opt type method_declarator throwsc_opt method_body)
- (wisent-raw-tag
- (semantic-tag-new-function
- (car $3)
- $2
- (cdr $3)
- :typemodifiers $1 :throws $4))))
- (method_declarator
- ((IDENTIFIER formal_parameter_list dims_opt)
- (cons
- (concat $1 $3)
- $2)))
- (throwsc_opt
- (nil)
- ((THROWS qualified_name_list)
- (nreverse $2)))
- (qualified_name_list
- ((qualified_name_list COMMA qualified_name)
- (cons $3 $1))
- ((qualified_name)
- (list $1)))
- (method_body
- ((SEMICOLON))
- ((block)))
- (block
- ((BRACE_BLOCK)))
- (formal_parameter_list
- ((PAREN_BLOCK)
- (semantic-parse-region
- (car $region1)
- (cdr $region1)
- 'formal_parameters 1)))
- (formal_parameters
- ((LPAREN)
- nil)
- ((RPAREN)
- nil)
- ((formal_parameter COMMA))
- ((formal_parameter RPAREN)))
- (formal_parameter
- ((formal_parameter_modifier_opt type opt_variable_declarator_id)
- (wisent-raw-tag
- (semantic-tag-new-variable $3 $2 nil :typemodifiers $1))))
- (formal_parameter_modifier_opt
- (nil)
- ((FINAL)
- (list $1)))
- (field_declaration
- ((modifiers_opt type variable_declarators SEMICOLON)
- (wisent-raw-tag
- (semantic-tag-new-variable $3 $2 nil :typemodifiers $1))))
- (variable_declarators
- ((variable_declarators COMMA variable_declarator)
- (progn
- (setcdr
- (cdr
- (car $1))
- (cdr $region2))
- (cons $3 $1)))
- ((variable_declarator)
- (list $1)))
- (variable_declarator
- ((variable_declarator_id EQ variable_initializer)
- (cons $1 $region))
- ((variable_declarator_id)
- (cons $1 $region)))
- (opt_variable_declarator_id
- (nil
- (identity ""))
- ((variable_declarator_id)
- (identity $1)))
- (variable_declarator_id
- ((IDENTIFIER dims_opt)
- (concat $1 $2)))
- (variable_initializer
- ((expression)))
- (expression
- ((expression term))
- ((term)))
- (term
- ((literal))
- ((operator))
- ((primitive_type))
- ((IDENTIFIER))
- ((BRACK_BLOCK))
- ((PAREN_BLOCK))
- ((BRACE_BLOCK))
- ((NEW))
- ((CLASS))
- ((THIS))
- ((SUPER)))
- (literal
- ((STRING_LITERAL))
- ((NUMBER_LITERAL)))
- (operator
- ((NOT))
- ((PLUS))
- ((PLUSPLUS))
- ((MINUS))
- ((MINUSMINUS))
- ((NOTEQ))
- ((MOD))
- ((MODEQ))
- ((AND))
- ((ANDAND))
- ((ANDEQ))
- ((MULT))
- ((MULTEQ))
- ((PLUSEQ))
- ((MINUSEQ))
- ((DOT))
- ((DIV))
- ((DIVEQ))
- ((COLON))
- ((LT))
- ((LSHIFT))
- ((LSHIFTEQ))
- ((LTEQ))
- ((EQ))
- ((EQEQ))
- ((GT))
- ((GTEQ))
- ((RSHIFT))
- ((RSHIFTEQ))
- ((URSHIFT))
- ((URSHIFTEQ))
- ((QUESTION))
- ((XOR))
- ((XOREQ))
- ((OR))
- ((OREQ))
- ((OROR))
- ((COMP))
- ((INSTANCEOF)))
- (primitive_type
- ((BOOLEAN))
- ((CHAR))
- ((LONG))
- ((INT))
- ((SHORT))
- ((BYTE))
- ((DOUBLE))
- ((FLOAT)))
- (modifiers_opt
- (nil)
- ((modifiers)
- (nreverse $1)))
- (modifiers
- ((modifiers modifier)
- (cons $2 $1))
- ((modifier)
- (list $1)))
- (modifier
- ((STRICTFP))
- ((VOLATILE))
- ((TRANSIENT))
- ((SYNCHRONIZED))
- ((NATIVE))
- ((FINAL))
- ((ABSTRACT))
- ((STATIC))
- ((PRIVATE))
- ((PROTECTED))
- ((PUBLIC)))
- (type
- ((qualified_name dims_opt)
- (concat $1 $2))
- ((primitive_type dims_opt)
- (concat $1 $2)))
- (qualified_name
- ((qualified_name DOT IDENTIFIER)
- (concat $1 $2 $3))
- ((IDENTIFIER)))
- (dims_opt
- (nil
- (identity ""))
- ((dims)))
- (dims
- ((dims BRACK_BLOCK)
- (concat $1 "[]"))
- ((BRACK_BLOCK)
- (identity "[]"))))
- '(compilation_unit package_declaration import_declaration class_declaration field_declaration method_declaration formal_parameter constructor_declaration interface_declaration class_member_declaration interface_member_declaration formal_parameters)))
- "Parser table.")
-
-(defun wisent-java-tags-wy--install-parser ()
- "Setup the Semantic Parser."
- (semantic-install-function-overrides
- '((parse-stream . wisent-parse-stream)))
- (setq semantic-parser-name "LALR"
- semantic--parse-table wisent-java-tags-wy--parse-table
- semantic-debug-parser-source "java-tags.wy"
- semantic-flex-keywords-obarray wisent-java-tags-wy--keyword-table
- semantic-lex-types-obarray wisent-java-tags-wy--token-table)
- ;; Collect unmatched syntax lexical tokens
- (semantic-make-local-hook 'wisent-discarding-token-functions)
- (add-hook 'wisent-discarding-token-functions
- 'wisent-collect-unmatched-syntax nil t))
-
-
-;;; Analyzers
-;;
-(define-lex-block-type-analyzer wisent-java-tags-wy--<block>-block-analyzer
- "block analyzer for <block> tokens."
- "\\s(\\|\\s)"
- '((("(" LPAREN PAREN_BLOCK)
- ("{" LBRACE BRACE_BLOCK)
- ("[" LBRACK BRACK_BLOCK))
- (")" RPAREN)
- ("}" RBRACE)
- ("]" RBRACK))
- )
-
-(define-lex-string-type-analyzer wisent-java-tags-wy--<punctuation>-string-analyzer
- "string analyzer for <punctuation> tokens."
- "\\(\\s.\\|\\s$\\|\\s'\\)+"
- '((COMP . "~")
- (OROR . "||")
- (OREQ . "|=")
- (OR . "|")
- (XOREQ . "^=")
- (XOR . "^")
- (QUESTION . "?")
- (URSHIFTEQ . ">>>=")
- (URSHIFT . ">>>")
- (RSHIFTEQ . ">>=")
- (RSHIFT . ">>")
- (GTEQ . ">=")
- (GT . ">")
- (EQEQ . "==")
- (EQ . "=")
- (LTEQ . "<=")
- (LSHIFTEQ . "<<=")
- (LSHIFT . "<<")
- (LT . "<")
- (SEMICOLON . ";")
- (COLON . ":")
- (DIVEQ . "/=")
- (DIV . "/")
- (DOT . ".")
- (MINUSEQ . "-=")
- (MINUSMINUS . "--")
- (MINUS . "-")
- (COMMA . ",")
- (PLUSEQ . "+=")
- (PLUSPLUS . "++")
- (PLUS . "+")
- (MULTEQ . "*=")
- (MULT . "*")
- (ANDEQ . "&=")
- (ANDAND . "&&")
- (AND . "&")
- (MODEQ . "%=")
- (MOD . "%")
- (NOTEQ . "!=")
- (NOT . "!"))
- 'punctuation)
-
-(define-lex-regex-type-analyzer wisent-java-tags-wy--<symbol>-regexp-analyzer
- "regexp analyzer for <symbol> tokens."
- "\\(\\sw\\|\\s_\\)+"
- nil
- 'IDENTIFIER)
-
-(define-lex-regex-type-analyzer wisent-java-tags-wy--<unicode>-regexp-analyzer
- "regexp analyzer for <unicode> tokens."
- "\\\\u[0-9a-f][0-9a-f][0-9a-f][0-9a-f]"
- nil
- 'unicodecharacter)
-
-(define-lex-regex-type-analyzer wisent-java-tags-wy--<number>-regexp-analyzer
- "regexp analyzer for <number> tokens."
- semantic-lex-number-expression
- nil
- 'NUMBER_LITERAL)
-
-(define-lex-sexp-type-analyzer wisent-java-tags-wy--<string>-sexp-analyzer
- "sexp analyzer for <string> tokens."
- "\\s\""
- 'STRING_LITERAL)
-
-(define-lex-keyword-type-analyzer wisent-java-tags-wy--<keyword>-keyword-analyzer
- "keyword analyzer for <keyword> tokens."
- "\\(\\sw\\|\\s_\\)+")
-
-
-;;; Epilogue
-;;
-;; Define the lexer for this grammar
-(define-lex wisent-java-tags-lexer
- "Lexical analyzer that handles Java buffers.
-It ignores whitespaces, newlines and comments."
- semantic-lex-ignore-whitespace
- semantic-lex-ignore-newline
- semantic-lex-ignore-comments
- ;;;; Auto-generated analyzers.
- wisent-java-tags-wy--<number>-regexp-analyzer
- wisent-java-tags-wy--<string>-sexp-analyzer
- ;; Must detect keywords before other symbols
- wisent-java-tags-wy--<keyword>-keyword-analyzer
- wisent-java-tags-wy--<symbol>-regexp-analyzer
- wisent-java-tags-wy--<punctuation>-string-analyzer
- wisent-java-tags-wy--<block>-block-analyzer
- ;; In theory, Unicode chars should be turned into normal chars
- ;; and then combined into regular ascii keywords and text. This
- ;; analyzer just keeps these things from making the lexer go boom.
- wisent-java-tags-wy--<unicode>-regexp-analyzer
- ;;;;
- semantic-lex-default-action)
-
-(provide 'semantic/wisent/javat-wy)
-
-;;; semantic/wisent/javat-wy.el ends here
diff --git a/lisp/cedet/semantic/wisent/js-wy.el b/lisp/cedet/semantic/wisent/js-wy.el
deleted file mode 100644
index 2e331b1c4d9..00000000000
--- a/lisp/cedet/semantic/wisent/js-wy.el
+++ /dev/null
@@ -1,530 +0,0 @@
-;;; semantic/wisent/js-wy.el --- Generated parser support file
-
-;; Copyright (C) 2005, 2009-2013 Free Software Foundation, Inc.
-;; Copyright (C) 1998-2011 Ecma International.
-
-;; 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 file was generated from admin/grammars/js.wy.
-
-;; It is derived from the grammar in the ECMAScript Language
-;; Specification published at
-;;
-;; http://www.ecma-international.org/publications/standards/Ecma-262.htm
-;;
-;; and redistributed under the following license:
-;;
-;; Redistribution and use in source and binary forms, with or without
-;; modification, are permitted provided that the following conditions
-;; are met:
-;;
-;; 1. Redistributions of source code must retain the above copyright
-;; notice, this list of conditions and the following disclaimer.
-;;
-;; 2. Redistributions in binary form must reproduce the above
-;; copyright notice, this list of conditions and the following
-;; disclaimer in the documentation and/or other materials provided
-;; with the distribution.
-;;
-;; 3. Neither the name of the authors nor Ecma International may be
-;; used to endorse or promote products derived from this software
-;; without specific prior written permission. THIS SOFTWARE IS
-;; PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR
-;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-;; ARE DISCLAIMED. IN NO EVENT SHALL ECMA INTERNATIONAL BE LIABLE FOR
-;; ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-;; OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
-;; USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-;; DAMAGE.
-
-;;; Code:
-
-(require 'semantic/lex)
-(eval-when-compile (require 'semantic/bovine))
-
-;;; Prologue
-;;
-(declare-function semantic-parse-region "semantic"
- (start end &optional nonterminal depth returnonerror))
-
-;;; Declarations
-;;
-(defconst wisent-javascript-jv-wy--keyword-table
- (semantic-lex-make-keyword-table
- '(("if" . IF)
- ("break" . BREAK)
- ("continue" . CONTINUE)
- ("else" . ELSE)
- ("for" . FOR)
- ("function" . FUNCTION)
- ("this" . THIS)
- ("return" . RETURN)
- ("while" . WHILE)
- ("void" . VOID_SYMBOL)
- ("new" . NEW)
- ("delete" . DELETE)
- ("var" . VAR)
- ("with" . WITH)
- ("typeof" . TYPEOF)
- ("in" . IN))
- '(("in" summary "in something")
- ("typeof" summary "typeof ")
- ("with" summary "with ")
- ("var" summary "var <variablename> [= value];")
- ("delete" summary "delete(<objectreference>) - Deletes the object.")
- ("new" summary "new <objecttype> - Creates a new object.")
- ("void" summary "Method return type: void <name> ...")
- ("while" summary "while (<expr>) <stmt> | do <stmt> while (<expr>);")
- ("return" summary "return [<expr>] ;")
- ("this" summary "this")
- ("function" summary "function declaration blah blah")
- ("for" summary "for ([<init-expr>]; [<expr>]; [<update-expr>]) <stmt>")
- ("else" summary "if (<expr>) <stmt> else <stmt>")
- ("continue" summary "continue [<label>] ;")
- ("break" summary "break [<label>] ;")
- ("if" summary "if (<expr>) <stmt> [else <stmt>] (jv)")))
- "Table of language keywords.")
-
-(defconst wisent-javascript-jv-wy--token-table
- (semantic-lex-make-type-table
- '(("<no-type>"
- (NULL_TOKEN)
- (QUERY)
- (TRUE)
- (FALSE))
- ("number"
- (NUMBER))
- ("string"
- (STRING))
- ("symbol"
- (VARIABLE))
- ("close-paren"
- (CLOSE_SQ_BRACKETS . "]")
- (END_BLOCK . "}")
- (CLOSE_PARENTHESIS . ")"))
- ("open-paren"
- (OPEN_SQ_BRACKETS . "[")
- (START_BLOCK . "{")
- (OPEN_PARENTHESIS . "("))
- ("block"
- (BRACK_BLOCK . "(OPEN_SQ_BRACKETS CLOSE_SQ_BRACKETS)")
- (BRACE_BLOCK . "(START_BLOCK END_BLOCK)")
- (PAREN_BLOCK . "(OPEN_PARENTHESIS CLOSE_PARENTHESIS)"))
- ("punctuation"
- (ONES_COMPLIMENT . "~")
- (SEMICOLON . ";")
- (LINE_TERMINATOR . "\n")
- (LESS_THAN . "<")
- (DOT . ".")
- (COMMA . ",")
- (COLON . ":")
- (DIV . "/")
- (DECREMENT . "--")
- (INCREMENT . "++")
- (PLUS_EQUALS . "+=")
- (PLUS . "+")
- (MULTIPLY_EQUALS . "*=")
- (MULTIPLY . "*")
- (MOD_EQUALS . "%=")
- (MOD . "%")
- (MINUS_EQUALS . "-=")
- (MINUS . "-")
- (LS_EQUAL . "<=")
- (LOGICAL_NOT . "!!")
- (LOGICAL_OR . "||")
- (LOGICAL_AND . "&&")
- (GT_EQUAL . ">=")
- (GREATER_THAN . ">")
- (EQUALS . "==")
- (DIV_EQUALS . "/=")
- (NOT_EQUAL . "!=")
- (BITWISE_SHIFT_RIGHT_ZERO_FILL_EQUALS . ">>>=")
- (BITWISE_SHIFT_RIGHT_ZERO_FILL . ">>>")
- (BITWISE_SHIFT_RIGHT_EQUALS . ">>=")
- (BITWISE_SHIFT_RIGHT . ">>")
- (BITWISE_SHIFT_LEFT_EQUALS . "<<=")
- (BITWISE_SHIFT_LEFT . "<<")
- (BITWISE_OR_EQUALS . "|=")
- (BITWISE_OR . "|")
- (BITWISE_EXCLUSIVE_OR_EQUALS . "^=")
- (BITWISE_EXCLUSIVE_OR . "^")
- (BITWISE_AND_EQUALS . "&=")
- (BITWISE_AND . "&")
- (ASSIGN_SYMBOL . "=")))
- '(("number" :declared t)
- ("string" :declared t)
- ("symbol" :declared t)
- ("keyword" :declared t)
- ("block" :declared t)
- ("punctuation" :declared t)))
- "Table of lexical tokens.")
-
-(defconst wisent-javascript-jv-wy--parse-table
- (progn
- (eval-when-compile
- (require 'semantic/wisent/comp))
- (wisent-compile-grammar
- '((ASSIGN_SYMBOL BITWISE_AND BITWISE_AND_EQUALS BITWISE_EXCLUSIVE_OR BITWISE_EXCLUSIVE_OR_EQUALS BITWISE_OR BITWISE_OR_EQUALS BITWISE_SHIFT_LEFT BITWISE_SHIFT_LEFT_EQUALS BITWISE_SHIFT_RIGHT BITWISE_SHIFT_RIGHT_EQUALS BITWISE_SHIFT_RIGHT_ZERO_FILL BITWISE_SHIFT_RIGHT_ZERO_FILL_EQUALS NOT_EQUAL DIV_EQUALS EQUALS GREATER_THAN GT_EQUAL LOGICAL_AND LOGICAL_OR LOGICAL_NOT LS_EQUAL MINUS MINUS_EQUALS MOD MOD_EQUALS MULTIPLY MULTIPLY_EQUALS PLUS PLUS_EQUALS INCREMENT DECREMENT DIV COLON COMMA DOT LESS_THAN LINE_TERMINATOR SEMICOLON ONES_COMPLIMENT PAREN_BLOCK BRACE_BLOCK BRACK_BLOCK OPEN_PARENTHESIS CLOSE_PARENTHESIS START_BLOCK END_BLOCK OPEN_SQ_BRACKETS CLOSE_SQ_BRACKETS IF BREAK CONTINUE ELSE FOR FUNCTION THIS RETURN WHILE VOID_SYMBOL NEW DELETE VAR WITH TYPEOF IN VARIABLE STRING NUMBER FALSE TRUE QUERY NULL_TOKEN)
- ((left PLUS MINUS)
- (left MULTIPLY DIV MOD)
- (nonassoc FALSE)
- (nonassoc HIGHER_THAN_FALSE)
- (nonassoc ELSE)
- (nonassoc LOWER_THAN_CLOSE_PARENTHESIS)
- (nonassoc CLOSE_PARENTHESIS))
- (Program
- ((SourceElement)))
- (SourceElement
- ((Statement))
- ((FunctionDeclaration)))
- (Statement
- ((Block))
- ((VariableStatement))
- ((EmptyStatement))
- ((ExpressionStatement))
- ((IfStatement))
- ((IterationExpression))
- ((ContinueStatement))
- ((BreakStatement))
- ((ReturnStatement))
- ((WithStatement)))
- (FunctionDeclaration
- ((FUNCTION VARIABLE FormalParameterListBlock Block)
- (wisent-raw-tag
- (semantic-tag-new-function $2 nil $3))))
- (FormalParameterListBlock
- ((PAREN_BLOCK)
- (semantic-parse-region
- (car $region1)
- (cdr $region1)
- 'FormalParameterList 1)))
- (FormalParameterList
- ((OPEN_PARENTHESIS)
- nil)
- ((VARIABLE)
- (wisent-raw-tag
- (semantic-tag-new-variable $1 nil nil)))
- ((CLOSE_PARENTHESIS)
- nil)
- ((COMMA)
- nil))
- (StatementList
- ((Statement))
- ((StatementList Statement)))
- (Block
- ((BRACE_BLOCK)))
- (BlockExpand
- ((START_BLOCK StatementList END_BLOCK))
- ((START_BLOCK END_BLOCK)))
- (VariableStatement
- ((VAR VariableDeclarationList SEMICOLON)
- (wisent-raw-tag
- (semantic-tag-new-variable $2 nil nil))))
- (VariableDeclarationList
- ((VariableDeclaration)
- (list $1))
- ((VariableDeclarationList COMMA VariableDeclaration)
- (append $1
- (list $3))))
- (VariableDeclaration
- ((VARIABLE)
- (append
- (list $1 nil)
- $region))
- ((VARIABLE Initializer)
- (append
- (cons $1 $2)
- $region)))
- (Initializer
- ((ASSIGN_SYMBOL AssignmentExpression)
- (list $2)))
- (EmptyStatement
- ((SEMICOLON)))
- (ExpressionStatement
- ((Expression SEMICOLON)))
- (IfStatement
- ((IF OPEN_PARENTHESIS Expression CLOSE_PARENTHESIS Statement)
- [HIGHER_THAN_FALSE])
- ((IF OPEN_PARENTHESIS Expression CLOSE_PARENTHESIS Statement ELSE Statement))
- ((IF OPEN_PARENTHESIS FALSE CLOSE_PARENTHESIS Statement))
- ((IF OPEN_PARENTHESIS LeftHandSideExpression AssignmentOperator AssignmentExpression CLOSE_PARENTHESIS Statement)))
- (IterationExpression
- ((WHILE OPEN_PARENTHESIS Expression CLOSE_PARENTHESIS Statement)
- [HIGHER_THAN_FALSE])
- ((WHILE OPEN_PARENTHESIS FALSE CLOSE_PARENTHESIS Statement))
- ((WHILE OPEN_PARENTHESIS LeftHandSideExpression AssignmentOperator AssignmentExpression CLOSE_PARENTHESIS Statement))
- ((FOR OPEN_PARENTHESIS OptionalExpression SEMICOLON OptionalExpression SEMICOLON OptionalExpression CLOSE_PARENTHESIS Statement))
- ((FOR OPEN_PARENTHESIS VAR VariableDeclarationList SEMICOLON OptionalExpression SEMICOLON OptionalExpression CLOSE_PARENTHESIS Statement))
- ((FOR OPEN_PARENTHESIS LeftHandSideExpression IN Expression CLOSE_PARENTHESIS Statement))
- ((FOR OPEN_PARENTHESIS VAR VARIABLE OptionalInitializer IN Expression CLOSE_PARENTHESIS Statement)))
- (ContinueStatement
- ((CONTINUE SEMICOLON)))
- (BreakStatement
- ((BREAK SEMICOLON)))
- (ReturnStatement
- ((RETURN Expression SEMICOLON))
- ((RETURN SEMICOLON)))
- (WithStatement
- ((WITH OPEN_PARENTHESIS Expression CLOSE_PARENTHESIS Statement)))
- (OptionalInitializer
- ((Initializer))
- (nil))
- (PrimaryExpression
- ((THIS))
- ((VARIABLE))
- ((NUMBER))
- ((STRING))
- ((NULL_TOKEN))
- ((TRUE))
- ((FALSE))
- ((OPEN_PARENTHESIS Expression CLOSE_PARENTHESIS)))
- (MemberExpression
- ((PrimaryExpression))
- ((MemberExpression OPEN_SQ_BRACKETS Expression CLOSE_SQ_BRACKETS))
- ((MemberExpression DOT VARIABLE))
- ((NEW MemberExpression Arguments)))
- (NewExpression
- ((MemberExpression))
- ((NEW NewExpression)))
- (CallExpression
- ((MemberExpression Arguments))
- ((CallExpression Arguments))
- ((CallExpression OPEN_SQ_BRACKETS Expression CLOSE_SQ_BRACKETS))
- ((CallExpression DOT VARIABLE)))
- (Arguments
- ((OPEN_PARENTHESIS CLOSE_PARENTHESIS))
- ((OPEN_PARENTHESIS ArgumentList CLOSE_PARENTHESIS)))
- (ArgumentList
- ((AssignmentExpression))
- ((ArgumentList COMMA AssignmentExpression)))
- (LeftHandSideExpression
- ((NewExpression))
- ((CallExpression)))
- (PostfixExpression
- ((LeftHandSideExpression))
- ((LeftHandSideExpression INCREMENT))
- ((LeftHandSideExpression DECREMENT)))
- (UnaryExpression
- ((PostfixExpression))
- ((DELETE UnaryExpression))
- ((VOID_SYMBOL UnaryExpression))
- ((TYPEOF UnaryExpression))
- ((INCREMENT UnaryExpression))
- ((DECREMENT UnaryExpression))
- ((PLUS UnaryExpression))
- ((MINUS UnaryExpression))
- ((ONES_COMPLIMENT UnaryExpression))
- ((LOGICAL_NOT UnaryExpression)))
- (MultiplicativeExpression
- ((UnaryExpression))
- ((MultiplicativeExpression MULTIPLY UnaryExpression))
- ((MultiplicativeExpression DIV UnaryExpression))
- ((MultiplicativeExpression MOD UnaryExpression)))
- (AdditiveExpression
- ((MultiplicativeExpression))
- ((AdditiveExpression PLUS MultiplicativeExpression))
- ((AdditiveExpression MINUS MultiplicativeExpression)))
- (ShiftExpression
- ((AdditiveExpression))
- ((ShiftExpression BITWISE_SHIFT_LEFT AdditiveExpression))
- ((ShiftExpression BITWISE_SHIFT_RIGHT AdditiveExpression))
- ((ShiftExpression BITWISE_SHIFT_RIGHT_ZERO_FILL AdditiveExpression)))
- (RelationalExpression
- ((ShiftExpression))
- ((RelationalExpression LESS_THAN ShiftExpression))
- ((RelationalExpression GREATER_THAN ShiftExpression))
- ((RelationalExpression LS_EQUAL ShiftExpression))
- ((RelationalExpression GT_EQUAL ShiftExpression)))
- (EqualityExpression
- ((RelationalExpression))
- ((EqualityExpression EQUALS RelationalExpression))
- ((EqualityExpression NOT_EQUAL RelationalExpression)))
- (BitwiseANDExpression
- ((EqualityExpression))
- ((BitwiseANDExpression BITWISE_AND EqualityExpression)))
- (BitwiseXORExpression
- ((BitwiseANDExpression))
- ((BitwiseXORExpression BITWISE_EXCLUSIVE_OR BitwiseANDExpression)))
- (BitwiseORExpression
- ((BitwiseXORExpression))
- ((BitwiseORExpression BITWISE_OR BitwiseXORExpression)))
- (LogicalANDExpression
- ((BitwiseORExpression))
- ((LogicalANDExpression LOGICAL_AND BitwiseORExpression)))
- (LogicalORExpression
- ((LogicalANDExpression))
- ((LogicalORExpression LOGICAL_OR LogicalANDExpression)))
- (ConditionalExpression
- ((LogicalORExpression))
- ((LogicalORExpression QUERY AssignmentExpression COLON AssignmentExpression)))
- (AssignmentExpression
- ((ConditionalExpression))
- ((LeftHandSideExpression AssignmentOperator AssignmentExpression)
- [LOWER_THAN_CLOSE_PARENTHESIS]))
- (AssignmentOperator
- ((ASSIGN_SYMBOL))
- ((MULTIPLY_EQUALS))
- ((DIV_EQUALS))
- ((MOD_EQUALS))
- ((PLUS_EQUALS))
- ((MINUS_EQUALS))
- ((BITWISE_SHIFT_LEFT_EQUALS))
- ((BITWISE_SHIFT_RIGHT_EQUALS))
- ((BITWISE_SHIFT_RIGHT_ZERO_FILL_EQUALS))
- ((BITWISE_AND_EQUALS))
- ((BITWISE_EXCLUSIVE_OR_EQUALS))
- ((BITWISE_OR_EQUALS)))
- (Expression
- ((AssignmentExpression))
- ((Expression COMMA AssignmentExpression)))
- (OptionalExpression
- ((Expression))
- (nil)))
- '(Program FormalParameterList)))
- "Parser table.")
-
-(defun wisent-javascript-jv-wy--install-parser ()
- "Setup the Semantic Parser."
- (semantic-install-function-overrides
- '((parse-stream . wisent-parse-stream)))
- (setq semantic-parser-name "LALR"
- semantic--parse-table wisent-javascript-jv-wy--parse-table
- semantic-debug-parser-source "js.wy"
- semantic-flex-keywords-obarray wisent-javascript-jv-wy--keyword-table
- semantic-lex-types-obarray wisent-javascript-jv-wy--token-table)
- ;; Collect unmatched syntax lexical tokens
- (semantic-make-local-hook 'wisent-discarding-token-functions)
- (add-hook 'wisent-discarding-token-functions
- 'wisent-collect-unmatched-syntax nil t))
-
-
-;;; Analyzers
-;;
-(define-lex-block-type-analyzer wisent-javascript-jv-wy--<block>-block-analyzer
- "block analyzer for <block> tokens."
- "\\s(\\|\\s)"
- '((("(" OPEN_PARENTHESIS PAREN_BLOCK)
- ("{" START_BLOCK BRACE_BLOCK)
- ("[" OPEN_SQ_BRACKETS BRACK_BLOCK))
- (")" CLOSE_PARENTHESIS)
- ("}" END_BLOCK)
- ("]" CLOSE_SQ_BRACKETS))
- )
-
-(define-lex-regex-type-analyzer wisent-javascript-jv-wy--<symbol>-regexp-analyzer
- "regexp analyzer for <symbol> tokens."
- "\\(\\sw\\|\\s_\\)+"
- nil
- 'VARIABLE)
-
-(define-lex-regex-type-analyzer wisent-javascript-jv-wy--<number>-regexp-analyzer
- "regexp analyzer for <number> tokens."
- semantic-lex-number-expression
- nil
- 'NUMBER)
-
-(define-lex-string-type-analyzer wisent-javascript-jv-wy--<punctuation>-string-analyzer
- "string analyzer for <punctuation> tokens."
- "\\(\\s.\\|\\s$\\|\\s'\\)+"
- '((ONES_COMPLIMENT . "~")
- (SEMICOLON . ";")
- (LINE_TERMINATOR . "\n")
- (LESS_THAN . "<")
- (DOT . ".")
- (COMMA . ",")
- (COLON . ":")
- (DIV . "/")
- (DECREMENT . "--")
- (INCREMENT . "++")
- (PLUS_EQUALS . "+=")
- (PLUS . "+")
- (MULTIPLY_EQUALS . "*=")
- (MULTIPLY . "*")
- (MOD_EQUALS . "%=")
- (MOD . "%")
- (MINUS_EQUALS . "-=")
- (MINUS . "-")
- (LS_EQUAL . "<=")
- (LOGICAL_NOT . "!!")
- (LOGICAL_OR . "||")
- (LOGICAL_AND . "&&")
- (GT_EQUAL . ">=")
- (GREATER_THAN . ">")
- (EQUALS . "==")
- (DIV_EQUALS . "/=")
- (NOT_EQUAL . "!=")
- (BITWISE_SHIFT_RIGHT_ZERO_FILL_EQUALS . ">>>=")
- (BITWISE_SHIFT_RIGHT_ZERO_FILL . ">>>")
- (BITWISE_SHIFT_RIGHT_EQUALS . ">>=")
- (BITWISE_SHIFT_RIGHT . ">>")
- (BITWISE_SHIFT_LEFT_EQUALS . "<<=")
- (BITWISE_SHIFT_LEFT . "<<")
- (BITWISE_OR_EQUALS . "|=")
- (BITWISE_OR . "|")
- (BITWISE_EXCLUSIVE_OR_EQUALS . "^=")
- (BITWISE_EXCLUSIVE_OR . "^")
- (BITWISE_AND_EQUALS . "&=")
- (BITWISE_AND . "&")
- (ASSIGN_SYMBOL . "="))
- 'punctuation)
-
-(define-lex-sexp-type-analyzer wisent-javascript-jv-wy--<string>-sexp-analyzer
- "sexp analyzer for <string> tokens."
- "\\s\""
- 'STRING)
-
-(define-lex-keyword-type-analyzer wisent-javascript-jv-wy--<keyword>-keyword-analyzer
- "keyword analyzer for <keyword> tokens."
- "\\(\\sw\\|\\s_\\)+")
-
-
-;;; Epilogue
-;;
-;;here something like:
-;;(define-lex wisent-java-tags-lexer
-;; should go
-(define-lex javascript-lexer-jv
-"javascript thingy"
-;;std stuff
- semantic-lex-ignore-whitespace
- semantic-lex-ignore-newline
- semantic-lex-ignore-comments
-
- ;;stuff generated from the wy file(one for each "type" declaration)
- wisent-javascript-jv-wy--<number>-regexp-analyzer
- wisent-javascript-jv-wy--<string>-sexp-analyzer
-
- wisent-javascript-jv-wy--<keyword>-keyword-analyzer
-
- wisent-javascript-jv-wy--<symbol>-regexp-analyzer
- wisent-javascript-jv-wy--<punctuation>-string-analyzer
- wisent-javascript-jv-wy--<block>-block-analyzer
-
-
- ;;;;more std stuff
- semantic-lex-default-action
- )
-
-(provide 'semantic/wisent/js-wy)
-
-;;; semantic/wisent/js-wy.el ends here
diff --git a/lisp/cedet/semantic/wisent/python-wy.el b/lisp/cedet/semantic/wisent/python-wy.el
deleted file mode 100644
index bfa96ff1a88..00000000000
--- a/lisp/cedet/semantic/wisent/python-wy.el
+++ /dev/null
@@ -1,847 +0,0 @@
-;;; semantic/wisent/python-wy.el --- Generated parser support file
-
-;; Copyright (C) 2002-2013 Free Software Foundation, Inc.
-;; Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-;; 2009, 2010 Python Software Foundation; All Rights Reserved
-
-;; 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 file was generated from admin/grammars/python.wy.
-;; It is derived in part from the Python grammar, used under the
-;; following license:
-;;
-;; PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
-;; --------------------------------------------
-;; 1. This LICENSE AGREEMENT is between the Python Software Foundation
-;; ("PSF"), and the Individual or Organization ("Licensee") accessing
-;; and otherwise using this software ("Python") in source or binary
-;; form and its associated documentation.
-;;
-;; 2. Subject to the terms and conditions of this License Agreement,
-;; PSF hereby grants Licensee a nonexclusive, royalty-free, world-wide
-;; license to reproduce, analyze, test, perform and/or display
-;; publicly, prepare derivative works, distribute, and otherwise use
-;; Python alone or in any derivative version, provided, however, that
-;; PSF's License Agreement and PSF's notice of copyright, i.e.,
-;; "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-;; 2009, 2010 Python Software Foundation; All Rights Reserved" are
-;; retained in Python alone or in any derivative version prepared by
-;; Licensee.
-;;
-;; 3. In the event Licensee prepares a derivative work that is based
-;; on or incorporates Python or any part thereof, and wants to make
-;; the derivative work available to others as provided herein, then
-;; Licensee hereby agrees to include in any such work a brief summary
-;; of the changes made to Python.
-;;
-;; 4. PSF is making Python available to Licensee on an "AS IS"
-;; basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
-;; IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
-;; DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
-;; FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
-;; INFRINGE ANY THIRD PARTY RIGHTS.
-;;
-;; 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
-;; FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A
-;; RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, OR
-;; ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
-;;
-;; 6. This License Agreement will automatically terminate upon a
-;; material breach of its terms and conditions.
-;;
-;; 7. Nothing in this License Agreement shall be deemed to create any
-;; relationship of agency, partnership, or joint venture between PSF
-;; and Licensee. This License Agreement does not grant permission to
-;; use PSF trademarks or trade name in a trademark sense to endorse or
-;; promote products or services of Licensee, or any third party.
-;;
-;; 8. By copying, installing or otherwise using Python, Licensee
-;; agrees to be bound by the terms and conditions of this License
-;; Agreement.
-
-;;; Code:
-
-(require 'semantic/lex)
-(eval-when-compile (require 'semantic/bovine))
-
-;;; Prologue
-;;
-(declare-function wisent-python-reconstitute-function-tag
- "semantic/wisent/python" (tag suite))
-(declare-function wisent-python-reconstitute-class-tag "semantic/wisent/python"
- (tag))
-(declare-function semantic-parse-region "semantic"
- (start end &optional nonterminal depth returnonerror))
-
-;;; Declarations
-;;
-(defconst wisent-python-wy--keyword-table
- (semantic-lex-make-keyword-table
- '(("and" . AND)
- ("as" . AS)
- ("assert" . ASSERT)
- ("break" . BREAK)
- ("class" . CLASS)
- ("continue" . CONTINUE)
- ("def" . DEF)
- ("del" . DEL)
- ("elif" . ELIF)
- ("else" . ELSE)
- ("except" . EXCEPT)
- ("exec" . EXEC)
- ("finally" . FINALLY)
- ("for" . FOR)
- ("from" . FROM)
- ("global" . GLOBAL)
- ("if" . IF)
- ("import" . IMPORT)
- ("in" . IN)
- ("is" . IS)
- ("lambda" . LAMBDA)
- ("not" . NOT)
- ("or" . OR)
- ("pass" . PASS)
- ("print" . PRINT)
- ("raise" . RAISE)
- ("return" . RETURN)
- ("try" . TRY)
- ("while" . WHILE)
- ("with" . WITH)
- ("yield" . YIELD))
- '(("yield" summary "Create a generator function")
- ("with" summary "Start statement with an associated context object")
- ("while" summary "Start a 'while' loop")
- ("try" summary "Start of statements protected by exception handlers")
- ("return" summary "Return from a function")
- ("raise" summary "Raise an exception")
- ("print" summary "Print each argument to standard output")
- ("pass" summary "Statement that does nothing")
- ("or" summary "Binary logical 'or' operator")
- ("not" summary "Unary boolean negation operator")
- ("lambda" summary "Create anonymous function")
- ("is" summary "Binary operator that tests for object equality")
- ("in" summary "Part of 'for' statement ")
- ("import" summary "Load specified modules")
- ("if" summary "Start 'if' conditional statement")
- ("global" summary "Declare one or more symbols as global symbols")
- ("from" summary "Modify behavior of 'import' statement")
- ("for" summary "Start a 'for' loop")
- ("finally" summary "Specify code to be executed after 'try' statements whether or not an exception occurred")
- ("exec" summary "Dynamically execute Python code")
- ("except" summary "Specify exception handlers along with 'try' keyword")
- ("else" summary "Start the 'else' clause following an 'if' statement")
- ("elif" summary "Shorthand for 'else if' following an 'if' statement")
- ("del" summary "Delete specified objects, i.e., undo what assignment did")
- ("def" summary "Define a new function")
- ("continue" summary "Skip to the next iteration of enclosing 'for' or 'while' loop")
- ("class" summary "Define a new class")
- ("break" summary "Terminate 'for' or 'while' loop")
- ("assert" summary "Raise AssertionError exception if <expr> is false")
- ("as" summary "EXPR as NAME makes value of EXPR available as variable NAME")
- ("and" summary "Logical AND binary operator ... ")))
- "Table of language keywords.")
-
-(defconst wisent-python-wy--token-table
- (semantic-lex-make-type-table
- '(("symbol"
- (NAME))
- ("number"
- (NUMBER_LITERAL))
- ("string"
- (STRING_LITERAL))
- ("punctuation"
- (AT . "@")
- (BACKQUOTE . "`")
- (ASSIGN . "=")
- (COMMA . ",")
- (SEMICOLON . ";")
- (COLON . ":")
- (BAR . "|")
- (TILDE . "~")
- (PERIOD . ".")
- (MINUS . "-")
- (PLUS . "+")
- (MOD . "%")
- (DIV . "/")
- (MULT . "*")
- (AMP . "&")
- (GT . ">")
- (LT . "<")
- (HAT . "^")
- (NE . "!=")
- (LTGT . "<>")
- (HATEQ . "^=")
- (OREQ . "|=")
- (AMPEQ . "&=")
- (MODEQ . "%=")
- (DIVEQ . "/=")
- (MULTEQ . "*=")
- (MINUSEQ . "-=")
- (PLUSEQ . "+=")
- (LE . "<=")
- (GE . ">=")
- (EQ . "==")
- (EXPONENT . "**")
- (GTGT . ">>")
- (LTLT . "<<")
- (DIVDIV . "//")
- (DIVDIVEQ . "//=")
- (EXPEQ . "**=")
- (GTGTEQ . ">>=")
- (LTLTEQ . "<<="))
- ("close-paren"
- (RBRACK . "]")
- (RBRACE . "}")
- (RPAREN . ")"))
- ("open-paren"
- (LBRACK . "[")
- (LBRACE . "{")
- (LPAREN . "("))
- ("block"
- (BRACK_BLOCK . "(LBRACK RBRACK)")
- (BRACE_BLOCK . "(LBRACE RBRACE)")
- (PAREN_BLOCK . "(LPAREN RPAREN)"))
- ("indentation"
- (INDENT_BLOCK . "(INDENT DEDENT)")
- (DEDENT . "[^:INDENT:]")
- (INDENT . "^\\s-+"))
- ("newline"
- (NEWLINE . "\n"))
- ("charquote"
- (BACKSLASH . "\\")))
- '(("keyword" :declared t)
- ("symbol" :declared t)
- ("number" :declared t)
- ("punctuation" :declared t)
- ("block" :declared t)))
- "Table of lexical tokens.")
-
-(defconst wisent-python-wy--parse-table
- (progn
- (eval-when-compile
- (require 'semantic/wisent/comp))
- (wisent-compile-grammar
- '((BACKSLASH NEWLINE INDENT DEDENT INDENT_BLOCK PAREN_BLOCK BRACE_BLOCK BRACK_BLOCK LPAREN RPAREN LBRACE RBRACE LBRACK RBRACK LTLTEQ GTGTEQ EXPEQ DIVDIVEQ DIVDIV LTLT GTGT EXPONENT EQ GE LE PLUSEQ MINUSEQ MULTEQ DIVEQ MODEQ AMPEQ OREQ HATEQ LTGT NE HAT LT GT AMP MULT DIV MOD PLUS MINUS PERIOD TILDE BAR COLON SEMICOLON COMMA ASSIGN BACKQUOTE AT STRING_LITERAL NUMBER_LITERAL NAME AND AS ASSERT BREAK CLASS CONTINUE DEF DEL ELIF ELSE EXCEPT EXEC FINALLY FOR FROM GLOBAL IF IMPORT IN IS LAMBDA NOT OR PASS PRINT RAISE RETURN TRY WHILE WITH YIELD)
- nil
- (goal
- ((NEWLINE))
- ((simple_stmt))
- ((compound_stmt)))
- (simple_stmt
- ((small_stmt_list semicolon_opt NEWLINE)))
- (small_stmt_list
- ((small_stmt))
- ((small_stmt_list SEMICOLON small_stmt)))
- (small_stmt
- ((expr_stmt))
- ((print_stmt))
- ((del_stmt))
- ((pass_stmt))
- ((flow_stmt))
- ((import_stmt))
- ((global_stmt))
- ((exec_stmt))
- ((assert_stmt)))
- (print_stmt
- ((PRINT print_stmt_trailer)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil))))
- (print_stmt_trailer
- ((test_list_opt)
- nil)
- ((GTGT test trailing_test_list_with_opt_comma_opt)
- nil))
- (trailing_test_list_with_opt_comma_opt
- (nil)
- ((trailing_test_list comma_opt)
- nil))
- (trailing_test_list
- ((COMMA test)
- nil)
- ((trailing_test_list COMMA test)
- nil))
- (expr_stmt
- ((testlist expr_stmt_trailer)
- (if
- (and $2
- (stringp $1)
- (string-match "^\\(\\sw\\|\\s_\\)+$" $1))
- (wisent-raw-tag
- (semantic-tag-new-variable $1 nil nil))
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil)))))
- (expr_stmt_trailer
- ((augassign testlist))
- ((eq_testlist_zom)))
- (eq_testlist_zom
- (nil)
- ((eq_testlist_zom ASSIGN testlist)
- (identity $3)))
- (augassign
- ((PLUSEQ))
- ((MINUSEQ))
- ((MULTEQ))
- ((DIVEQ))
- ((MODEQ))
- ((AMPEQ))
- ((OREQ))
- ((HATEQ))
- ((LTLTEQ))
- ((GTGTEQ))
- ((EXPEQ))
- ((DIVDIVEQ)))
- (del_stmt
- ((DEL exprlist)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil))))
- (exprlist
- ((expr_list comma_opt)
- nil))
- (expr_list
- ((expr)
- nil)
- ((expr_list COMMA expr)
- nil))
- (pass_stmt
- ((PASS)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil))))
- (flow_stmt
- ((break_stmt))
- ((continue_stmt))
- ((return_stmt))
- ((raise_stmt))
- ((yield_stmt)))
- (break_stmt
- ((BREAK)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil))))
- (continue_stmt
- ((CONTINUE)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil))))
- (return_stmt
- ((RETURN testlist_opt)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil))))
- (testlist_opt
- (nil)
- ((testlist)
- nil))
- (yield_stmt
- ((YIELD)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil)))
- ((YIELD testlist)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil))))
- (raise_stmt
- ((RAISE zero_one_two_or_three_tests)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil))))
- (zero_one_two_or_three_tests
- (nil)
- ((test zero_one_or_two_tests)
- nil))
- (zero_one_or_two_tests
- (nil)
- ((COMMA test zero_or_one_comma_test)
- nil))
- (zero_or_one_comma_test
- (nil)
- ((COMMA test)
- nil))
- (import_stmt
- ((IMPORT dotted_as_name_list)
- (wisent-raw-tag
- (semantic-tag-new-include $2 nil)))
- ((FROM dotted_name IMPORT star_or_import_as_name_list)
- (wisent-raw-tag
- (semantic-tag-new-include $2 nil))))
- (dotted_as_name_list
- ((dotted_as_name_list COMMA dotted_as_name)
- (cons $3 $1))
- ((dotted_as_name)
- (list $1)))
- (star_or_import_as_name_list
- ((MULT)
- nil)
- ((import_as_name_list)
- nil))
- (import_as_name_list
- ((import_as_name)
- nil)
- ((import_as_name_list COMMA import_as_name)
- nil))
- (import_as_name
- ((NAME as_name_opt)
- nil))
- (dotted_as_name
- ((dotted_name as_name_opt)))
- (as_name_opt
- (nil)
- ((AS NAME)
- (identity $2)))
- (dotted_name
- ((NAME))
- ((dotted_name PERIOD NAME)
- (format "%s.%s" $1 $3)))
- (global_stmt
- ((GLOBAL comma_sep_name_list)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil))))
- (comma_sep_name_list
- ((NAME))
- ((comma_sep_name_list COMMA NAME)))
- (exec_stmt
- ((EXEC expr exec_trailer)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil))))
- (exec_trailer
- (nil)
- ((IN test comma_test_opt)
- nil))
- (comma_test_opt
- (nil)
- ((COMMA test)
- nil))
- (assert_stmt
- ((ASSERT test comma_test_opt)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil))))
- (compound_stmt
- ((if_stmt))
- ((while_stmt))
- ((for_stmt))
- ((try_stmt))
- ((with_stmt))
- ((funcdef))
- ((class_declaration)))
- (if_stmt
- ((IF test COLON suite elif_suite_pair_list else_suite_pair_opt)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil))))
- (elif_suite_pair_list
- (nil)
- ((elif_suite_pair_list ELIF test COLON suite)
- nil))
- (else_suite_pair_opt
- (nil)
- ((ELSE COLON suite)
- nil))
- (suite
- ((simple_stmt)
- (list $1))
- ((NEWLINE indented_block)
- (progn $2)))
- (indented_block
- ((INDENT_BLOCK)
- (semantic-parse-region
- (car $region1)
- (cdr $region1)
- 'indented_block_body 1)))
- (indented_block_body
- ((INDENT)
- nil)
- ((DEDENT)
- nil)
- ((simple_stmt))
- ((compound_stmt)))
- (while_stmt
- ((WHILE test COLON suite else_suite_pair_opt)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil))))
- (for_stmt
- ((FOR exprlist IN testlist COLON suite else_suite_pair_opt)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil))))
- (try_stmt
- ((TRY COLON suite except_clause_suite_pair_list else_suite_pair_opt)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil)))
- ((TRY COLON suite FINALLY COLON suite)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil))))
- (except_clause_suite_pair_list
- ((except_clause COLON suite)
- nil)
- ((except_clause_suite_pair_list except_clause COLON suite)
- nil))
- (except_clause
- ((EXCEPT zero_one_or_two_test)
- nil))
- (zero_one_or_two_test
- (nil)
- ((test zero_or_one_comma_test)
- nil))
- (with_stmt
- ((WITH test COLON suite)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil)))
- ((WITH test with_var COLON suite)
- (wisent-raw-tag
- (semantic-tag-new-code $1 nil))))
- (with_var
- ((AS expr)
- nil))
- (decorator
- ((AT dotted_name varargslist_opt NEWLINE)
- (wisent-raw-tag
- (semantic-tag-new-function $2 "decorator" $3))))
- (decorators
- ((decorator)
- (list $1))
- ((decorator decorators)
- (cons $1 $2)))
- (funcdef
- ((DEF NAME function_parameter_list COLON suite)
- (wisent-python-reconstitute-function-tag
- (wisent-raw-tag
- (semantic-tag-new-function $2 nil $3))
- $5))
- ((decorators DEF NAME function_parameter_list COLON suite)
- (wisent-python-reconstitute-function-tag
- (wisent-raw-tag
- (semantic-tag-new-function $3 nil $4 :decorators $1))
- $6)))
- (function_parameter_list
- ((PAREN_BLOCK)
- (let
- ((wisent-python-EXPANDING-block t))
- (semantic-parse-region
- (car $region1)
- (cdr $region1)
- 'function_parameters 1))))
- (function_parameters
- ((LPAREN)
- nil)
- ((RPAREN)
- nil)
- ((function_parameter COMMA))
- ((function_parameter RPAREN)))
- (function_parameter
- ((fpdef_opt_test))
- ((MULT NAME)
- (wisent-raw-tag
- (semantic-tag-new-variable $2 nil nil)))
- ((EXPONENT NAME)
- (wisent-raw-tag
- (semantic-tag-new-variable $2 nil nil))))
- (class_declaration
- ((CLASS NAME paren_class_list_opt COLON suite)
- (wisent-python-reconstitute-class-tag
- (wisent-raw-tag
- (semantic-tag-new-type $2 $1 $5
- (cons $3 nil))))))
- (paren_class_list_opt
- (nil)
- ((paren_class_list)))
- (paren_class_list
- ((PAREN_BLOCK)
- (let
- ((wisent-python-EXPANDING-block t))
- (mapcar 'semantic-tag-name
- (semantic-parse-region
- (car $region1)
- (cdr $region1)
- 'paren_classes 1)))))
- (paren_classes
- ((LPAREN)
- nil)
- ((RPAREN)
- nil)
- ((paren_class COMMA)
- (wisent-raw-tag
- (semantic-tag-new-variable $1 nil nil)))
- ((paren_class RPAREN)
- (wisent-raw-tag
- (semantic-tag-new-variable $1 nil nil))))
- (paren_class
- ((dotted_name)))
- (test
- ((test_test))
- ((lambdef)))
- (test_test
- ((and_test))
- ((test_test OR and_test)
- nil))
- (and_test
- ((not_test))
- ((and_test AND not_test)
- nil))
- (not_test
- ((NOT not_test)
- nil)
- ((comparison)))
- (comparison
- ((expr))
- ((comparison comp_op expr)
- nil))
- (comp_op
- ((LT))
- ((GT))
- ((EQ))
- ((GE))
- ((LE))
- ((LTGT))
- ((NE))
- ((IN))
- ((NOT IN))
- ((IS))
- ((IS NOT)))
- (expr
- ((xor_expr))
- ((expr BAR xor_expr)
- nil))
- (xor_expr
- ((and_expr))
- ((xor_expr HAT and_expr)
- nil))
- (and_expr
- ((shift_expr))
- ((and_expr AMP shift_expr)
- nil))
- (shift_expr
- ((arith_expr))
- ((shift_expr shift_expr_operators arith_expr)
- nil))
- (shift_expr_operators
- ((LTLT))
- ((GTGT)))
- (arith_expr
- ((term))
- ((arith_expr plus_or_minus term)
- nil))
- (plus_or_minus
- ((PLUS))
- ((MINUS)))
- (term
- ((factor))
- ((term term_operator factor)
- nil))
- (term_operator
- ((MULT))
- ((DIV))
- ((MOD))
- ((DIVDIV)))
- (factor
- ((prefix_operators factor)
- nil)
- ((power)))
- (prefix_operators
- ((PLUS))
- ((MINUS))
- ((TILDE)))
- (power
- ((atom trailer_zom exponent_zom)
- (concat $1
- (if $2
- (concat " " $2 " ")
- "")
- (if $3
- (concat " " $3)
- ""))))
- (trailer_zom
- (nil)
- ((trailer_zom trailer)
- nil))
- (exponent_zom
- (nil)
- ((exponent_zom EXPONENT factor)
- nil))
- (trailer
- ((PAREN_BLOCK)
- nil)
- ((BRACK_BLOCK)
- nil)
- ((PERIOD NAME)
- nil))
- (atom
- ((PAREN_BLOCK)
- nil)
- ((BRACK_BLOCK)
- nil)
- ((BRACE_BLOCK)
- nil)
- ((BACKQUOTE testlist BACKQUOTE)
- nil)
- ((NAME))
- ((NUMBER_LITERAL))
- ((one_or_more_string)))
- (test_list_opt
- (nil)
- ((testlist)
- nil))
- (testlist
- ((comma_sep_test_list comma_opt)))
- (comma_sep_test_list
- ((test))
- ((comma_sep_test_list COMMA test)
- (format "%s, %s" $1 $3)))
- (one_or_more_string
- ((STRING_LITERAL))
- ((one_or_more_string STRING_LITERAL)
- (concat $1 $2)))
- (lambdef
- ((LAMBDA varargslist_opt COLON test)
- (format "%s %s" $1
- (or $2 ""))))
- (varargslist_opt
- (nil)
- ((varargslist)))
- (varargslist
- ((fpdef_opt_test_list_comma_zom rest_args)
- (nconc $2 $1))
- ((fpdef_opt_test_list comma_opt)))
- (rest_args
- ((MULT NAME multmult_name_opt)
- nil)
- ((EXPONENT NAME)
- nil))
- (multmult_name_opt
- (nil)
- ((COMMA EXPONENT NAME)
- (wisent-raw-tag
- (semantic-tag-new-variable $3 nil nil))))
- (fpdef_opt_test_list_comma_zom
- (nil)
- ((fpdef_opt_test_list_comma_zom fpdef_opt_test COMMA)
- (nconc $2 $1)))
- (fpdef_opt_test_list
- ((fpdef_opt_test))
- ((fpdef_opt_test_list COMMA fpdef_opt_test)
- (nconc $3 $1)))
- (fpdef_opt_test
- ((fpdef eq_test_opt)))
- (fpdef
- ((NAME)
- (wisent-raw-tag
- (semantic-tag-new-variable $1 nil nil))))
- (fplist
- ((fpdef_list comma_opt)))
- (fpdef_list
- ((fpdef))
- ((fpdef_list COMMA fpdef)))
- (eq_test_opt
- (nil)
- ((ASSIGN test)
- nil))
- (comma_opt
- (nil)
- ((COMMA)))
- (semicolon_opt
- (nil)
- ((SEMICOLON))))
- '(goal function_parameter paren_class indented_block function_parameters paren_classes indented_block_body)))
- "Parser table.")
-
-(defun wisent-python-wy--install-parser ()
- "Setup the Semantic Parser."
- (semantic-install-function-overrides
- '((parse-stream . wisent-parse-stream)))
- (setq semantic-parser-name "LALR"
- semantic--parse-table wisent-python-wy--parse-table
- semantic-debug-parser-source "python.wy"
- semantic-flex-keywords-obarray wisent-python-wy--keyword-table
- semantic-lex-types-obarray wisent-python-wy--token-table)
- ;; Collect unmatched syntax lexical tokens
- (semantic-make-local-hook 'wisent-discarding-token-functions)
- (add-hook 'wisent-discarding-token-functions
- 'wisent-collect-unmatched-syntax nil t))
-
-
-;;; Analyzers
-;;
-(define-lex-block-type-analyzer wisent-python-wy--<block>-block-analyzer
- "block analyzer for <block> tokens."
- "\\s(\\|\\s)"
- '((("(" LPAREN PAREN_BLOCK)
- ("{" LBRACE BRACE_BLOCK)
- ("[" LBRACK BRACK_BLOCK))
- (")" RPAREN)
- ("}" RBRACE)
- ("]" RBRACK))
- )
-
-(define-lex-regex-type-analyzer wisent-python-wy--<symbol>-regexp-analyzer
- "regexp analyzer for <symbol> tokens."
- "\\(\\sw\\|\\s_\\)+"
- nil
- 'NAME)
-
-(define-lex-regex-type-analyzer wisent-python-wy--<number>-regexp-analyzer
- "regexp analyzer for <number> tokens."
- semantic-lex-number-expression
- nil
- 'NUMBER_LITERAL)
-
-(define-lex-string-type-analyzer wisent-python-wy--<punctuation>-string-analyzer
- "string analyzer for <punctuation> tokens."
- "\\(\\s.\\|\\s$\\|\\s'\\)+"
- '((AT . "@")
- (BACKQUOTE . "`")
- (ASSIGN . "=")
- (COMMA . ",")
- (SEMICOLON . ";")
- (COLON . ":")
- (BAR . "|")
- (TILDE . "~")
- (PERIOD . ".")
- (MINUS . "-")
- (PLUS . "+")
- (MOD . "%")
- (DIV . "/")
- (MULT . "*")
- (AMP . "&")
- (GT . ">")
- (LT . "<")
- (HAT . "^")
- (NE . "!=")
- (LTGT . "<>")
- (HATEQ . "^=")
- (OREQ . "|=")
- (AMPEQ . "&=")
- (MODEQ . "%=")
- (DIVEQ . "/=")
- (MULTEQ . "*=")
- (MINUSEQ . "-=")
- (PLUSEQ . "+=")
- (LE . "<=")
- (GE . ">=")
- (EQ . "==")
- (EXPONENT . "**")
- (GTGT . ">>")
- (LTLT . "<<")
- (DIVDIV . "//")
- (DIVDIVEQ . "//=")
- (EXPEQ . "**=")
- (GTGTEQ . ">>=")
- (LTLTEQ . "<<="))
- 'punctuation)
-
-(define-lex-keyword-type-analyzer wisent-python-wy--<keyword>-keyword-analyzer
- "keyword analyzer for <keyword> tokens."
- "\\(\\sw\\|\\s_\\)+")
-
-
-;;; Epilogue
-;;
-
-(provide 'semantic/wisent/python-wy)
-
-;;; semantic/wisent/python-wy.el ends here
diff --git a/lisp/cedet/srecode/srt-wy.el b/lisp/cedet/srecode/srt-wy.el
deleted file mode 100644
index 450f57d943c..00000000000
--- a/lisp/cedet/srecode/srt-wy.el
+++ /dev/null
@@ -1,306 +0,0 @@
-;;; srecode/srt-wy.el --- Generated parser support file
-
-;; Copyright (C) 2005, 2007-2013 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/>.
-
-;;; Commentary:
-;;
-;; This file was generated from admin/grammars/srecode-template.wy.
-
-;;; Code:
-
-(require 'semantic/lex)
-(eval-when-compile (require 'semantic/bovine))
-
-;;; Prologue
-;;
-
-;;; Declarations
-;;
-(defconst srecode-template-wy--keyword-table
- (semantic-lex-make-keyword-table
- '(("set" . SET)
- ("show" . SHOW)
- ("macro" . MACRO)
- ("context" . CONTEXT)
- ("template" . TEMPLATE)
- ("sectiondictionary" . SECTIONDICTIONARY)
- ("section" . SECTION)
- ("end" . END)
- ("prompt" . PROMPT)
- ("default" . DEFAULT)
- ("defaultmacro" . DEFAULTMACRO)
- ("read" . READ)
- ("bind" . BIND))
- '(("bind" summary "bind \"<letter>\"")
- ("read" summary "prompt <symbol> \"Describe Symbol: \" [default[macro] <lispsym>|\"valuetext\"] [read <lispsym>]")
- ("defaultmacro" summary "prompt <symbol> \"Describe Symbol: \" [default[macro] <lispsym>|\"valuetext\"] [read <lispsym>]")
- ("default" summary "prompt <symbol> \"Describe Symbol: \" [default[macro] <lispsym>|\"valuetext\"] [read <lispsym>]")
- ("prompt" summary "prompt <symbol> \"Describe Symbol: \" [default[macro] <lispsym>|\"valuetext\"] [read <lispsym>]")
- ("end" summary "section ... end")
- ("section" summary "section <name>\\n <dictionary entries>\\n end")
- ("sectiondictionary" summary "sectiondictionary <name>\\n <dictionary entries>")
- ("template" summary "template <name>\\n <template definition>")
- ("context" summary "context <name>")
- ("macro" summary "... macro \"string\" ...")
- ("show" summary "show <name> ; to show a section")
- ("set" summary "set <name> <value>")))
- "Table of language keywords.")
-
-(defconst srecode-template-wy--token-table
- (semantic-lex-make-type-table
- '(("number"
- (number))
- ("string"
- (string))
- ("symbol"
- (symbol))
- ("property"
- (property))
- ("separator"
- (TEMPLATE_BLOCK . "^----"))
- ("newline"
- (newline)))
- '(("number" :declared t)
- ("string" :declared t)
- ("symbol" :declared t)
- ("property" syntax ":\\(\\w\\|\\s_\\)*")
- ("property" :declared t)
- ("newline" :declared t)
- ("punctuation" syntax "\\s.+")
- ("punctuation" :declared t)
- ("keyword" :declared t)))
- "Table of lexical tokens.")
-
-(defconst srecode-template-wy--parse-table
- (progn
- (eval-when-compile
- (require 'semantic/wisent/comp))
- (wisent-compile-grammar
- '((SET SHOW MACRO CONTEXT TEMPLATE SECTIONDICTIONARY SECTION END PROMPT DEFAULT DEFAULTMACRO READ BIND newline TEMPLATE_BLOCK property symbol string number)
- nil
- (template_file
- ((newline)
- nil)
- ((context))
- ((prompt))
- ((variable))
- ((template)))
- (context
- ((CONTEXT symbol newline)
- (wisent-raw-tag
- (semantic-tag $2 'context))))
- (prompt
- ((PROMPT symbol string opt-default-fcn opt-read-fcn newline)
- (wisent-raw-tag
- (semantic-tag $2 'prompt :text
- (read $3)
- :default $4 :read $5))))
- (opt-default-fcn
- ((DEFAULT symbol)
- (progn
- (read $2)))
- ((DEFAULT string)
- (progn
- (read $2)))
- ((DEFAULTMACRO string)
- (progn
- (cons 'macro
- (read $2))))
- (nil nil))
- (opt-read-fcn
- ((READ symbol)
- (progn
- (read $2)))
- (nil nil))
- (variable
- ((SET symbol insertable-string-list newline)
- (wisent-raw-tag
- (semantic-tag-new-variable $2 nil $3)))
- ((SET symbol number newline)
- (wisent-raw-tag
- (semantic-tag-new-variable $2 nil
- (list $3))))
- ((SHOW symbol newline)
- (wisent-raw-tag
- (semantic-tag-new-variable $2 nil t))))
- (insertable-string-list
- ((insertable-string)
- (list $1))
- ((insertable-string-list insertable-string)
- (append $1
- (list $2))))
- (insertable-string
- ((string)
- (read $1))
- ((MACRO string)
- (cons 'macro
- (read $2))))
- (template
- ((TEMPLATE templatename opt-dynamic-arguments newline opt-string section-dictionary-list TEMPLATE_BLOCK newline opt-bind)
- (wisent-raw-tag
- (semantic-tag-new-function $2 nil $3 :documentation $5 :code $7 :dictionaries $6 :binding $9))))
- (templatename
- ((symbol))
- ((PROMPT))
- ((CONTEXT))
- ((TEMPLATE))
- ((DEFAULT))
- ((MACRO))
- ((DEFAULTMACRO))
- ((READ))
- ((SET)))
- (opt-dynamic-arguments
- ((property opt-dynamic-arguments)
- (cons $1 $2))
- (nil nil))
- (opt-string
- ((string newline)
- (read $1))
- (nil nil))
- (section-dictionary-list
- (nil nil)
- ((section-dictionary-list flat-section-dictionary)
- (append $1
- (list $2)))
- ((section-dictionary-list section-dictionary)
- (append $1
- (list $2))))
- (flat-section-dictionary
- ((SECTIONDICTIONARY string newline flat-dictionary-entry-list)
- (cons
- (read $2)
- $4)))
- (flat-dictionary-entry-list
- (nil nil)
- ((flat-dictionary-entry-list flat-dictionary-entry)
- (append $1 $2)))
- (flat-dictionary-entry
- ((variable)
- (wisent-cook-tag $1)))
- (section-dictionary
- ((SECTION string newline dictionary-entry-list END newline)
- (cons
- (read $2)
- $4)))
- (dictionary-entry-list
- (nil nil)
- ((dictionary-entry-list dictionary-entry)
- (append $1 $2)))
- (dictionary-entry
- ((variable)
- (wisent-cook-tag $1))
- ((section-dictionary)
- (list $1)))
- (opt-bind
- ((BIND string newline)
- (read $2))
- (nil nil)))
- '(template_file)))
- "Parser table.")
-
-(defun srecode-template-wy--install-parser ()
- "Setup the Semantic Parser."
- (semantic-install-function-overrides
- '((parse-stream . wisent-parse-stream)))
- (setq semantic-parser-name "LALR"
- semantic--parse-table srecode-template-wy--parse-table
- semantic-debug-parser-source "srecode-template.wy"
- semantic-flex-keywords-obarray srecode-template-wy--keyword-table
- semantic-lex-types-obarray srecode-template-wy--token-table)
- ;; Collect unmatched syntax lexical tokens
- (semantic-make-local-hook 'wisent-discarding-token-functions)
- (add-hook 'wisent-discarding-token-functions
- 'wisent-collect-unmatched-syntax nil t))
-
-
-;;; Analyzers
-;;
-(define-lex-regex-type-analyzer srecode-template-wy--<property>-regexp-analyzer
- "regexp analyzer for <property> tokens."
- ":\\(\\w\\|\\s_\\)*"
- nil
- 'property)
-
-(define-lex-regex-type-analyzer srecode-template-wy--<symbol>-regexp-analyzer
- "regexp analyzer for <symbol> tokens."
- "\\(\\sw\\|\\s_\\)+"
- nil
- 'symbol)
-
-(define-lex-regex-type-analyzer srecode-template-wy--<number>-regexp-analyzer
- "regexp analyzer for <number> tokens."
- semantic-lex-number-expression
- nil
- 'number)
-
-(define-lex-string-type-analyzer srecode-template-wy--<punctuation>-string-analyzer
- "string analyzer for <punctuation> tokens."
- "\\s.+"
- nil
- 'punctuation)
-
-(define-lex-sexp-type-analyzer srecode-template-wy--<string>-sexp-analyzer
- "sexp analyzer for <string> tokens."
- "\\s\""
- 'string)
-
-(define-lex-keyword-type-analyzer srecode-template-wy--<keyword>-keyword-analyzer
- "keyword analyzer for <keyword> tokens."
- "\\(\\sw\\|\\s_\\)+")
-
-
-;;; Epilogue
-;;
-(define-lex-simple-regex-analyzer srecode-template-property-analyzer
- "Detect and create a dynamic argument properties."
- ":\\(\\w\\|\\s_\\)*" 'property 0)
-
-(define-lex-regex-analyzer srecode-template-separator-block
- "Detect and create a template quote block."
- "^----\n"
- (semantic-lex-push-token
- (semantic-lex-token
- 'TEMPLATE_BLOCK
- (match-end 0)
- (semantic-lex-unterminated-syntax-protection 'TEMPLATE_BLOCK
- (goto-char (match-end 0))
- (re-search-forward "^----$")
- (match-beginning 0))))
- (setq semantic-lex-end-point (point)))
-
-
-(define-lex wisent-srecode-template-lexer
- "Lexical analyzer that handles SRecode Template buffers.
-It ignores whitespace, newlines and comments."
- semantic-lex-newline
- semantic-lex-ignore-whitespace
- semantic-lex-ignore-newline
- semantic-lex-ignore-comments
- srecode-template-separator-block
- srecode-template-wy--<keyword>-keyword-analyzer
- srecode-template-property-analyzer
- srecode-template-wy--<number>-regexp-analyzer
- srecode-template-wy--<symbol>-regexp-analyzer
- srecode-template-wy--<string>-sexp-analyzer
- srecode-template-wy--<punctuation>-string-analyzer
- semantic-lex-default-action
- )
-
-(provide 'srecode/srt-wy)
-
-;;; srecode/srt-wy.el ends here
diff --git a/lisp/comint.el b/lisp/comint.el
index 8e1b2105de3..afd93fc6ff0 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -752,6 +752,7 @@ See `make-comint' and `comint-exec'."
(let ((name (file-name-nondirectory program)))
(switch-to-buffer (make-comint name program))
(run-hooks (intern-soft (concat "comint-" name "-hook")))))
+(put 'comint-run 'interactive-only 'make-comint)
(defun comint-exec (buffer name command startfile switches)
"Start up a process named NAME in buffer BUFFER for Comint modes.
diff --git a/lisp/composite.el b/lisp/composite.el
index f2f4437cadb..7cf35c2af68 100644
--- a/lisp/composite.el
+++ b/lisp/composite.el
@@ -1,5 +1,7 @@
;;; composite.el --- support character composition
+;; Copyright (C) 2001-2013 Free Software Foundation, Inc.
+
;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
;; 2008, 2009, 2010, 2011
;; National Institute of Advanced Industrial Science and Technology (AIST)
@@ -669,13 +671,15 @@ All non-spacing characters have this function in
(setq i (1+ i))))
gstring))))))
-(let ((elt `([,(purecopy "\\c.\\c^+") 1 compose-gstring-for-graphic]
- [nil 0 compose-gstring-for-graphic])))
- (map-char-table
- #'(lambda (key val)
- (if (memq val '(Mn Mc Me))
- (set-char-table-range composition-function-table key elt)))
- unicode-category-table))
+;; Allow for bootstrapping without uni-*.el.
+(when unicode-category-table
+ (let ((elt `([,(purecopy "\\c.\\c^+") 1 compose-gstring-for-graphic]
+ [nil 0 compose-gstring-for-graphic])))
+ (map-char-table
+ #'(lambda (key val)
+ (if (memq val '(Mn Mc Me))
+ (set-char-table-range composition-function-table key elt)))
+ unicode-category-table)))
(defun compose-gstring-for-terminal (gstring)
"Compose glyph-string GSTRING for terminal display.
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 24f8ac3bade..8e94e85f84c 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -272,6 +272,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
(tool-bar-mode (frames mouse) boolean nil
; :initialize custom-initialize-default
:set custom-set-minor-mode)
+ (frame-resize-pixelwise windows boolean "24.4")
;; fringe.c
(overflow-newline-into-fringe fringe boolean)
;; image.c
@@ -448,6 +449,7 @@ since it could result in memory overflow and make Emacs crash."
:value display-buffer)
(other :tag "Always (t)" :value t))
"24.3")
+ (window-resize-pixelwise windows boolean "24.4")
;; xdisp.c
;; The whitespace group is for whitespace.el.
(show-trailing-whitespace editing-basics boolean nil
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index e59aecc8773..71a865a7a49 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -499,6 +499,7 @@ Typically \"page-%s.png\".")
;; how many pages will be available.
(null doc-view--current-converter-processes))
(setq page len)))
+ (force-mode-line-update) ;To update `current-page'.
(setf (doc-view-current-page) page
(doc-view-current-info)
(concat
diff --git a/lisp/electric.el b/lisp/electric.el
index 04d0bd3e935..91b99b4bfe7 100644
--- a/lisp/electric.el
+++ b/lisp/electric.el
@@ -284,6 +284,8 @@ This is a global minor mode. When enabled, it reindents whenever
the hook `electric-indent-functions' returns non-nil, or you
insert a character from `electric-indent-chars'."
:global t :group 'electricity
+ :initialize 'custom-initialize-delay
+ :init-value t
(if (not electric-indent-mode)
(progn
(when (eq (lookup-key global-map [?\C-j])
diff --git a/lisp/emacs-lisp/authors.el b/lisp/emacs-lisp/authors.el
index 92796ac4e99..abb34d80348 100644
--- a/lisp/emacs-lisp/authors.el
+++ b/lisp/emacs-lisp/authors.el
@@ -617,6 +617,7 @@ in the repository.")
("config.h.in" . "config.in")
("paths.h-dist" . "paths.h.in")
("patch1" . "sed1.inp")
+ ("enriched.doc" . "enriched.txt")
("GETTING.GNU.SOFTWARE" . "FTP")
("etc/MACHINES" . "MACHINES")
("ONEWS" . "NEWS.19")
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 7ec24cc2aad..6beef7165d1 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -112,10 +112,10 @@ to set this property.")
''edebug-form-spec (list 'quote spec)))))
defun-declarations-alist)
"List associating properties of macros to their macro expansion.
-Each element of the list takes the form (PROP FUN) where FUN is
-a function. For each (PROP . VALUES) in a macro's declaration,
-the FUN corresponding to PROP is called with the function name
-and the VALUES and should return the code to use to set this property.")
+Each element of the list takes the form (PROP FUN) where FUN is a function.
+For each (PROP . VALUES) in a macro's declaration, the FUN corresponding
+to PROP is called with the macro name, the macro's arglist, and the VALUES
+and should return the code to use to set this property.")
(put 'defmacro 'doc-string-elt 3)
(put 'defmacro 'lisp-indent-function 2)
@@ -285,7 +285,6 @@ was first made obsolete, for example a date or a release number."
(declare (advertised-calling-convention
;; New code should always provide the `when' argument.
(obsolete-name current-name when) "23.1"))
- (interactive "aMake function obsolete: \nxObsoletion replacement: ")
(put obsolete-name 'byte-obsolete-info
;; The second entry used to hold the `byte-compile' handler, but
;; is not used any more nowadays.
@@ -392,7 +391,7 @@ If you think you need this, you're probably making a mistake somewhere."
"Like `progn', but evaluates the body at compile time if you're compiling.
Thus, the result of the body appears to the compiler as a quoted constant.
In interpreted code, this is entirely equivalent to `progn'."
- (declare (debug t) (indent 0))
+ (declare (debug (def-body)) (indent 0))
(list 'quote (eval (cons 'progn body) lexical-binding)))
(defmacro eval-and-compile (&rest body)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index e0d474bbb9f..4d91389a3e0 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -353,11 +353,11 @@ else the global value will be modified."
(t
(append byte-compile-warnings (list warning)))))))
-(defvar byte-compile-interactive-only-functions
- '(beginning-of-buffer end-of-buffer replace-string replace-regexp
- insert-file insert-buffer insert-file-literally previous-line next-line
- goto-line comint-run delete-backward-char)
+(defvar byte-compile-interactive-only-functions nil
"List of commands that are not meant to be called from Lisp.")
+(make-obsolete-variable 'byte-compile-interactive-only-functions
+ "use the `interactive-only' symbol property instead"
+ "24.4")
(defvar byte-compile-not-obsolete-vars nil
"List of variables that shouldn't be reported as obsolete.")
@@ -2929,13 +2929,23 @@ for symbols generated by the byte compiler itself."
(byte-compile-variable-ref form))))
((symbolp (car form))
(let* ((fn (car form))
- (handler (get fn 'byte-compile)))
+ (handler (get fn 'byte-compile))
+ (interactive-only
+ (or (get fn 'interactive-only)
+ (memq fn byte-compile-interactive-only-functions))))
(when (macroexp--const-symbol-p fn)
(byte-compile-warn "`%s' called as a function" fn))
- (and (byte-compile-warning-enabled-p 'interactive-only)
- (memq fn byte-compile-interactive-only-functions)
- (byte-compile-warn "`%s' used from Lisp code\n\
-That command is designed for interactive use only" fn))
+ (when (and (byte-compile-warning-enabled-p 'interactive-only)
+ interactive-only)
+ (byte-compile-warn "`%s' is for interactive use only%s"
+ fn
+ (cond ((stringp interactive-only)
+ (format "; %s" interactive-only))
+ ((and (symbolp 'interactive-only)
+ (not (eq interactive-only t)))
+ (format "; use `%s' instead."
+ interactive-only))
+ (t "."))))
(if (and (fboundp (car form))
(eq (car-safe (symbol-function (car form))) 'macro))
(byte-compile-log-warning
@@ -3598,7 +3608,7 @@ discarding."
(byte-compile-constant (if (eq 'lambda (car-safe f))
(byte-compile-lambda f)
f))))
-
+
(defun byte-compile-indent-to (form)
(let ((len (length form)))
(cond ((= len 2)
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 6c7a0d2db1d..87d1d1eae64 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -204,7 +204,7 @@ first will be printed into the backtrace buffer."
(window-resize
debugger-window
(- debugger-previous-window-height
- (window-total-size debugger-window)))
+ (window-total-height debugger-window)))
(error nil)))
(setq debugger-previous-window debugger-window))
(debugger-mode)
@@ -236,7 +236,7 @@ first will be printed into the backtrace buffer."
(eq (window-buffer debugger-window) debugger-buffer))
;; Record height of debugger window.
(setq debugger-previous-window-height
- (window-total-size debugger-window)))
+ (window-total-height debugger-window)))
(if debugger-will-be-back
;; Restore previous window configuration (Bug#12623).
(set-window-configuration window-configuration)
@@ -494,9 +494,13 @@ removes itself from that hook."
(forward-line 1)
(while (progn
(forward-char 2)
- (if (= (following-char) ?\()
- (forward-sexp 1)
- (forward-sexp 2))
+ (cond ((debugger--locals-visible-p)
+ (goto-char (next-single-char-property-change
+ (point) 'locals-visible)))
+ ((= (following-char) ?\()
+ (forward-sexp 1))
+ (t
+ (forward-sexp 2)))
(forward-line 1)
(<= (point) opoint))
(if (looking-at " *;;;")
@@ -541,6 +545,14 @@ Applies to the frame whose line point is on in the backtrace."
(progn ,@body)
(setq debugger-outer-match-data (match-data)))))
+(defun debugger--backtrace-base ()
+ "Return the function name that marks the top of the backtrace.
+See `backtrace-frame'."
+ (cond ((eq 'debug--implement-debug-on-entry
+ (cadr (backtrace-frame 1 'debug)))
+ 'debug--implement-debug-on-entry)
+ (t 'debug)))
+
(defun debugger-eval-expression (exp &optional nframe)
"Eval an expression, in an environment like that outside the debugger.
The environment used is the one when entering the activation frame at point."
@@ -549,15 +561,70 @@ The environment used is the one when entering the activation frame at point."
(let ((nframe (or nframe
(condition-case nil (1+ (debugger-frame-number 'skip-base))
(error 0)))) ;; If on first line.
- (base (if (eq 'debug--implement-debug-on-entry
- (cadr (backtrace-frame 1 'debug)))
- 'debug--implement-debug-on-entry 'debug)))
+ (base (debugger--backtrace-base)))
(debugger-env-macro
(let ((val (backtrace-eval exp nframe base)))
(prog1
(prin1 val t)
(let ((str (eval-expression-print-format val)))
(if str (princ str t))))))))
+
+(defun debugger--locals-visible-p ()
+ "Are the local variables of the current stack frame visible?"
+ (save-excursion
+ (move-to-column 2)
+ (get-text-property (point) 'locals-visible)))
+
+(defun debugger--insert-locals (locals)
+ "Insert the local variables LOCALS at point."
+ (cond ((null locals)
+ (insert "\n [no locals]"))
+ (t
+ (let ((print-escape-newlines t))
+ (dolist (s+v locals)
+ (let ((symbol (car s+v))
+ (value (cdr s+v)))
+ (insert "\n ")
+ (prin1 symbol (current-buffer))
+ (insert " = ")
+ (prin1 value (current-buffer))))))))
+
+(defun debugger--show-locals ()
+ "For the frame at point, insert locals and add text properties."
+ (let* ((nframe (1+ (debugger-frame-number 'skip-base)))
+ (base (debugger--backtrace-base))
+ (locals (backtrace--locals nframe base))
+ (inhibit-read-only t))
+ (save-excursion
+ (let ((start (progn
+ (move-to-column 2)
+ (point))))
+ (end-of-line)
+ (debugger--insert-locals locals)
+ (add-text-properties start (point) '(locals-visible t))))))
+
+(defun debugger--hide-locals ()
+ "Delete local variables and remove the text property."
+ (let* ((col (current-column))
+ (end (progn
+ (move-to-column 2)
+ (next-single-char-property-change (point) 'locals-visible)))
+ (start (previous-single-char-property-change end 'locals-visible))
+ (inhibit-read-only t))
+ (remove-text-properties start end '(locals-visible))
+ (goto-char start)
+ (end-of-line)
+ (delete-region (point) end)
+ (move-to-column col)))
+
+(defun debugger-toggle-locals ()
+ "Show or hide local variables of the current stack frame."
+ (interactive)
+ (cond ((debugger--locals-visible-p)
+ (debugger--hide-locals))
+ (t
+ (debugger--show-locals))))
+
(defvar debugger-mode-map
(let ((map (make-keymap))
@@ -575,6 +642,7 @@ The environment used is the one when entering the activation frame at point."
(define-key map "h" 'describe-mode)
(define-key map "q" 'top-level)
(define-key map "e" 'debugger-eval-expression)
+ (define-key map "v" 'debugger-toggle-locals) ;"v" is for "v"ariables.
(define-key map " " 'next-line)
(define-key map "R" 'debugger-record-expression)
(define-key map "\C-m" 'debug-help-follow)
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 250f93800ec..8ec6b41efe7 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -216,6 +216,9 @@ expression point is on."
Otherwise work like `message'."
(if (minibufferp)
(progn
+ (add-hook 'minibuffer-exit-hook
+ (lambda () (setq eldoc-mode-line-string nil))
+ nil t)
(with-current-buffer
(window-buffer
(or (window-in-direction 'above (minibuffer-window))
@@ -226,17 +229,11 @@ Otherwise work like `message'."
(setq mode-line-format
(list "" '(eldoc-mode-line-string
(" " eldoc-mode-line-string " "))
- mode-line-format))))
- (add-hook 'minibuffer-exit-hook
- (lambda () (setq eldoc-mode-line-string nil))
- nil t)
- (cond
- ((null format-string)
- (setq eldoc-mode-line-string nil))
- ((stringp format-string)
- (setq eldoc-mode-line-string
- (apply 'format format-string args))))
- (force-mode-line-update))
+ mode-line-format)))
+ (setq eldoc-mode-line-string
+ (when (stringp format-string)
+ (apply 'format format-string args)))
+ (force-mode-line-update)))
(apply 'message format-string args)))
(defun eldoc-message (&rest args)
diff --git a/lisp/emacs-lisp/helpers.el b/lisp/emacs-lisp/helpers.el
index 73c2ff1c15c..8049f4e1d1d 100644
--- a/lisp/emacs-lisp/helpers.el
+++ b/lisp/emacs-lisp/helpers.el
@@ -37,6 +37,38 @@
(maphash (lambda (_k v) (push v values)) hash-table)
values))
+(defsubst string-empty-p (string)
+ "Check whether STRING is empty."
+ (string= string ""))
+
+(defsubst string-join (strings &optional separator)
+ "Join all STRINGS using SEPARATOR."
+ (mapconcat 'identity strings separator))
+
+(defsubst string-reverse (str)
+ "Reverse the string STR."
+ (apply 'string (nreverse (string-to-list str))))
+
+(defsubst string-trim-left (string)
+ "Remove leading whitespace from STRING."
+ (if (string-match "\\`[ \t\n\r]+" string)
+ (replace-match "" t t string)
+ string))
+
+(defsubst string-trim-right (string)
+ "Remove trailing whitespace from STRING."
+ (if (string-match "[ \t\n\r]+\\'" string)
+ (replace-match "" t t string)
+ string))
+
+(defsubst string-trim (string)
+ "Remove leading and trailing whitespace from STRING."
+ (string-trim-left (string-trim-right string)))
+
+(defsubst string-blank-p (string)
+ "Check whether STRING is either empty or only whitespace."
+ (string-empty-p (string-trim string)))
+
(provide 'helpers)
;;; helpers.el ends here
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el
index f2e691102d4..8e8b8747a29 100644
--- a/lisp/emacs-lisp/lisp-mnt.el
+++ b/lisp/emacs-lisp/lisp-mnt.el
@@ -461,8 +461,8 @@ each line."
(let ((keywords (lm-keywords file)))
(if keywords
(if (string-match-p "," keywords)
- (split-string keywords ",[ \t\n]*" t)
- (split-string keywords "[ \t\n]+" t)))))
+ (split-string keywords ",[ \t\n]*" t "[ ]+")
+ (split-string keywords "[ \t\n]+" t "[ ]+")))))
(defvar finder-known-keywords)
(defun lm-keywords-finder-p (&optional file)
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index e8768ea6ac9..853c83e2fa2 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1403,6 +1403,8 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
'action 'package-install-button-action)))
(t (insert (capitalize status) ".")))
(insert "\n")
+ (insert " " (propertize "Archive" 'font-lock-face 'bold)
+ ": " (or archive "n/a") "\n")
(and version
(insert " "
(propertize "Version" 'font-lock-face 'bold) ": "
diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el
index de9966c0af0..cb7828ddd95 100644
--- a/lisp/emacs-lisp/regexp-opt.el
+++ b/lisp/emacs-lisp/regexp-opt.el
@@ -285,7 +285,9 @@ CHARS should be a list of characters."
;;
;; Make sure a caret is not first and a dash is first or last.
(if (and (string-equal charset "") (string-equal bracket ""))
- (concat "[" dash caret "]")
+ (if (string-equal dash "")
+ "\\^" ; [^] is not a valid regexp
+ (concat "[" dash caret "]"))
(concat "[" bracket charset caret dash "]"))))
(provide 'regexp-opt)
diff --git a/lisp/emacs-lock.el b/lisp/emacs-lock.el
index ac12c149b01..f1fa9316c82 100644
--- a/lisp/emacs-lock.el
+++ b/lisp/emacs-lock.el
@@ -109,8 +109,7 @@ Internal use only.")
(defun emacs-lock-live-process-p (buffer-or-name)
"Return t if BUFFER-OR-NAME is associated with a live process."
- (let ((proc (get-buffer-process buffer-or-name)))
- (and proc (process-live-p proc))))
+ (process-live-p (get-buffer-process buffer-or-name)))
(defun emacs-lock--can-auto-unlock (action)
"Return t if the current buffer can auto-unlock for ACTION.
diff --git a/lisp/epa-file.el b/lisp/epa-file.el
index e3a91ac7c25..60412344595 100644
--- a/lisp/epa-file.el
+++ b/lisp/epa-file.el
@@ -132,6 +132,7 @@ encryption is used."
(error)))
(local-file (or local-copy file))
(context (epg-make-context))
+ (buf (current-buffer))
string length entry)
(if visit
(setq buffer-file-name file))
@@ -157,16 +158,16 @@ encryption is used."
;; where `find-file-not-found-functions' are called in
;; `find-file-noselect-1'.
(when (file-exists-p local-file)
- (make-local-variable 'epa-file-error)
- (setq epa-file-error error)
+ (setq-local epa-file-error error)
(add-hook 'find-file-not-found-functions
'epa-file--find-file-not-found-function
nil t))
(signal 'file-error
(cons "Opening input file" (cdr error)))))
- (make-local-variable 'epa-file-encrypt-to)
- (setq epa-file-encrypt-to
- (mapcar #'car (epg-context-result-for context 'encrypted-to)))
+ (set-buffer buf) ;In case timer/filter changed/killed it (bug#16029)!
+ (setq-local epa-file-encrypt-to
+ (mapcar #'car (epg-context-result-for
+ context 'encrypted-to)))
(if (or beg end)
(setq string (substring string (or beg 0) end)))
(save-excursion
@@ -268,14 +269,13 @@ If no one is selected, symmetric encryption will be performed. "
(defun epa-file-select-keys ()
"Select recipients for encryption."
(interactive)
- (make-local-variable 'epa-file-encrypt-to)
- (setq epa-file-encrypt-to
- (mapcar
- (lambda (key)
- (epg-sub-key-id (car (epg-key-sub-key-list key))))
- (epa-select-keys
- (epg-make-context)
- "Select recipients for encryption.
+ (setq-local epa-file-encrypt-to
+ (mapcar
+ (lambda (key)
+ (epg-sub-key-id (car (epg-key-sub-key-list key))))
+ (epa-select-keys
+ (epg-make-context)
+ "Select recipients for encryption.
If no one is selected, symmetric encryption will be performed. "))))
;;;###autoload
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 5856a592ebf..f7a998c5e0e 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-25 Glenn Morris <rgm@gnu.org>
+
+ * erc-button.el (erc-nick-popup): Make `nick' available in the
+ eval environment. (Bug#15969)
+
2013-11-04 Stefan Monnier <monnier@iro.umontreal.ca>
* erc-pcomplete.el (erc-pcomplete): Set this-command.
diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el
index 751a35dfdff..a124954498d 100644
--- a/lisp/erc/erc-button.el
+++ b/lisp/erc/erc-button.el
@@ -514,7 +514,7 @@ Examples:
(code (cdr (assoc action erc-nick-popup-alist))))
(when code
(erc-set-active-buffer (current-buffer))
- (eval code))))
+ (eval code `((nick . ,nick))))))
;;; Callback functions
(defun erc-button-describe-symbol (symbol-name)
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index 5a5435bb4cb..72ee0ced785 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -207,7 +207,7 @@ include the following symbols:
permissions or modification time
If FILE is a directory, 'change' watches for file creation or
-deletion in that directory.
+deletion in that directory. This does not work recursively.
When any event happens, Emacs will call the CALLBACK function passing
it a single argument EVENT, which is of the form
@@ -237,8 +237,7 @@ FILE is the name of the file whose event is being reported."
(let* ((handler (find-file-name-handler file 'file-notify-add-watch))
(dir (directory-file-name
- (if (or (and (not handler) (eq file-notify--library 'w32notify))
- (file-directory-p file))
+ (if (file-directory-p file)
file
(file-name-directory file))))
desc func l-flags)
diff --git a/lisp/files.el b/lisp/files.el
index d44401b4302..229770006c7 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2085,6 +2085,7 @@ Don't call it from programs! Use `insert-file-contents-literally' instead.
\(Its calling sequence is different; see its documentation)."
(interactive "*fInsert file literally: ")
(insert-file-1 filename #'insert-file-contents-literally))
+(put 'insert-file-literally 'interactive-only 'insert-file-contents-literally)
(defvar find-file-literally nil
"Non-nil if this buffer was made by `find-file-literally' or equivalent.
@@ -5007,6 +5008,7 @@ Don't call it from programs! Use `insert-file-contents' instead.
\(Its calling sequence is different; see its documentation)."
(interactive "*fInsert file: ")
(insert-file-1 filename #'insert-file-contents))
+(put 'insert-file 'interactive-only 'insert-file-contents)
(defun append-to-file (start end filename)
"Append the contents of the region to the end of file FILENAME.
diff --git a/lisp/frame.el b/lisp/frame.el
index 87756f78f1c..6105c88d7be 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -120,6 +120,23 @@ appended when the minibuffer frame is created."
(delete-frame frame t)
;; Gildea@x.org says it is ok to ask questions before terminating.
(save-buffers-kill-emacs))))
+
+(defun handle-focus-in (_event)
+ "Handle a focus-in event.
+Focus-in events are usually bound to this function.
+Focus-in events occur when a frame has focus, but a switch-frame event
+is not generated.
+This function runs the hook `focus-in-hook'."
+ (interactive "e")
+ (run-hooks 'focus-in-hook))
+
+(defun handle-focus-out (_event)
+ "Handle a focus-out event.
+Focus-out events are usually bound to this function.
+Focus-out events occur when no frame has focus.
+This function runs the hook `focus-out-hook'."
+ (interactive "e")
+ (run-hooks 'focus-out-hook))
;;;; Arrangement of frames at startup
@@ -193,6 +210,8 @@ appended when the minibuffer frame is created."
(declare-function tool-bar-mode "tool-bar" (&optional arg))
+(defalias 'tool-bar-lines-needed 'tool-bar-height)
+
;; startup.el calls this function after loading the user's init
;; file. Now default-frame-alist and initial-frame-alist contain
;; information to which we must react; do what needs to be done.
@@ -1727,12 +1746,11 @@ command starts, by installing a pre-command hook."
"Timer function of timer `blink-cursor-timer'."
(internal-show-cursor nil (not (internal-show-cursor-p)))
;; Each blink is two calls to this function.
- (when (memq window-system '(x ns w32))
- (setq blink-cursor-blinks-done (1+ blink-cursor-blinks-done))
- (when (and (> blink-cursor-blinks 0)
- (<= (* 2 blink-cursor-blinks) blink-cursor-blinks-done))
- (blink-cursor-suspend)
- (add-hook 'post-command-hook 'blink-cursor-check))))
+ (setq blink-cursor-blinks-done (1+ blink-cursor-blinks-done))
+ (when (and (> blink-cursor-blinks 0)
+ (<= (* 2 blink-cursor-blinks) blink-cursor-blinks-done))
+ (blink-cursor-suspend)
+ (add-hook 'post-command-hook 'blink-cursor-check)))
(defun blink-cursor-end ()
@@ -1747,15 +1765,14 @@ itself as a pre-command hook."
(setq blink-cursor-timer nil)))
(defun blink-cursor-suspend ()
- "Suspend cursor blinking on NS, X and W32.
+ "Suspend cursor blinking.
This is called when no frame has focus and timers can be suspended.
Timers are restarted by `blink-cursor-check', which is called when a
frame receives focus."
- (when (memq window-system '(x ns w32))
- (blink-cursor-end)
- (when blink-cursor-idle-timer
- (cancel-timer blink-cursor-idle-timer)
- (setq blink-cursor-idle-timer nil))))
+ (blink-cursor-end)
+ (when blink-cursor-idle-timer
+ (cancel-timer blink-cursor-idle-timer)
+ (setq blink-cursor-idle-timer nil)))
(defun blink-cursor-check ()
"Check if cursor blinking shall be restarted.
@@ -1789,13 +1806,15 @@ terminals, cursor blinking is controlled by the terminal."
(if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer))
(setq blink-cursor-idle-timer nil)
(blink-cursor-end)
+ (remove-hook 'focus-in-hook #'blink-cursor-check)
+ (remove-hook 'focus-out-hook #'blink-cursor-suspend)
(when blink-cursor-mode
- ;; Hide the cursor.
- ;;(internal-show-cursor nil nil)
+ (add-hook 'focus-in-hook #'blink-cursor-check)
+ (add-hook 'focus-out-hook #'blink-cursor-suspend)
(setq blink-cursor-idle-timer
(run-with-idle-timer blink-cursor-delay
blink-cursor-delay
- 'blink-cursor-start))))
+ #'blink-cursor-start))))
;; Frame maximization/fullscreen
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 9a6ea149753..2026d11042d 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,55 @@
+2013-12-03 Vitalie Spinu <spinuvit@gmail.com>
+
+ * message.el (message-send-mail-with-sendmail):
+ Don't kill error buffer if sending fails.
+
+2013-11-28 Jan Tatarik <jan.tatarik@gmail.com>
+
+ * gnus-icalendar.el (gnus-icalendar-event-from-ical)
+ (gnus-icalendar-event->org-entry)
+ (gnus-icalendar--update-org-event)
+ (gnus-icalendar-event->gnus-calendar): Distinguish between
+ required/optional/non-participant attendee status. Fix bug causing
+ the first required event participant to be omitted.
+
+2013-11-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-art.el (article-de-quoted-unreadable)
+ (article-de-base64-unreadable, gnus-mime-copy-part)
+ * gnus-html.el (gnus-article-html)
+ * mm-view.el (mm-inline-text-html-render-with-w3)
+ (mm-inline-text-html-render-with-w3m-standalone)
+ * rfc2231.el (rfc2231-decode-encoded-string):
+ Allow overriding charset by mm-charset-override-alist.
+
+ * gnus-art.el (gnus-article-browse-html-parts):
+ Replace LWSPs with `&nbsp;'s in header.
+
+ Work for broken Chinese articles.
+
+ * gnus-art.el (gnus-article-browse-html-save-cid-content):
+ Exclude broken handles that gnus-summary-enter-digest-group may create.
+ (gnus-article-browse-html-parts):
+ Allow overriding charset by mm-charset-override-alist.
+
+2013-11-21 Jan Tatarik <jan.tatarik@gmail.com>
+
+ * gnus-icalendar.el (gnus-icalendar-additional-identities): New.
+ (gnus-icalendar-identities): Support additional-identities.
+
+ * gnus-icalendar.el (gnus-icalendar-event:org-timestamp):
+ Fix org-timestamp for events ending at midnight.
+
+2013-11-21 Ivan Shmakov <ivan@siamics.net> (tiny change)
+
+ * nndoc.el (nndoc-type-alist, nndoc-debbugs-db-type-p):
+ Support debbugs .log files.
+
+2013-11-20 Dave Goldberg <david.goldberg6@verizon.net>
+
+ * message.el (message-beginning-of-line):
+ Use beginning-of-visual-line when visual-line-mode is turned on.
+
2013-11-15 Jan Tatarik <jan.tatarik@gmail.com>
* gnus-icalendar.el (gnus-icalendar-event->gnus-calendar)
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index b80aa3a24e9..9eac2c428e9 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -2665,7 +2665,7 @@ If READ-CHARSET, ask for a coding system."
(string-match "quoted-printable" type))))
(article-goto-body)
(quoted-printable-decode-region
- (point) (point-max) (mm-charset-to-coding-system charset))))))
+ (point) (point-max) (mm-charset-to-coding-system charset nil t))))))
(defun article-de-base64-unreadable (&optional force read-charset)
"Translate a base64 article.
@@ -2696,7 +2696,8 @@ If READ-CHARSET, ask for a coding system."
(narrow-to-region (point) (point-max))
(base64-decode-region (point-min) (point-max))
(mm-decode-coding-region
- (point-min) (point-max) (mm-charset-to-coding-system charset)))))))
+ (point-min) (point-max)
+ (mm-charset-to-coding-system charset nil t)))))))
(eval-when-compile
(require 'rfc1843))
@@ -2794,6 +2795,9 @@ Return file name."
(dolist (handle handles)
(cond
((not (listp handle)))
+ ;; Exclude broken handles that `gnus-summary-enter-digest-group'
+ ;; may create.
+ ((not (or (bufferp (car handle)) (stringp (car handle)))))
((equal (mm-handle-media-supertype handle) "multipart")
(when (setq file (gnus-article-browse-html-save-cid-content
cid handle directory))
@@ -2801,11 +2805,12 @@ Return file name."
((equal (concat "<" cid ">") (mm-handle-id handle))
(setq file
(expand-file-name
- (or (mm-handle-filename handle)
- (concat
- (make-temp-name "cid")
- (car (rassoc (car (mm-handle-type handle)) mailcap-mime-extensions))))
- directory))
+ (or (mm-handle-filename handle)
+ (concat
+ (make-temp-name "cid")
+ (car (rassoc (car (mm-handle-type handle))
+ mailcap-mime-extensions))))
+ directory))
(mm-save-part-to-file handle file)
(throw 'found file))))))))
@@ -2891,6 +2896,13 @@ message header will be added to the bodies of the \"text/html\" parts."
((match-beginning 3) "&amp;")
(t "<br>\n"))))
(goto-char (point-min))
+ (while (re-search-forward "^[\t ]+" nil t)
+ (dotimes (i (prog1
+ (current-column)
+ (delete-region (match-beginning 0)
+ (match-end 0))))
+ (insert "&nbsp;")))
+ (goto-char (point-min))
(insert "<div align=\"left\">\n")
(goto-char (point-max))
(insert "</div>\n<hr>\n")
@@ -2908,7 +2920,7 @@ message header will be added to the bodies of the \"text/html\" parts."
(cond ((= (length hcharset) 1)
(setq hcharset (car hcharset)
coding (mm-charset-to-coding-system
- hcharset)))
+ hcharset nil t)))
((> (length hcharset) 1)
(setq hcharset 'utf-8
coding hcharset)))
@@ -2916,7 +2928,8 @@ message header will be added to the bodies of the \"text/html\" parts."
(if charset
(progn
(setq body
- (mm-charset-to-coding-system charset))
+ (mm-charset-to-coding-system charset
+ nil t))
(if (eq coding body)
(setq eheader (mm-encode-coding-string
(buffer-string) coding)
@@ -5235,7 +5248,8 @@ are decompressed."
(switch-to-buffer (generate-new-buffer filename))
(if (or coding-system
(and charset
- (setq coding-system (mm-charset-to-coding-system charset))
+ (setq coding-system (mm-charset-to-coding-system
+ charset nil t))
(not (eq coding-system 'ascii))))
(progn
(mm-enable-multibyte)
diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el
index 2700af3d009..36c1677be0a 100644
--- a/lisp/gnus/gnus-html.el
+++ b/lisp/gnus/gnus-html.el
@@ -143,7 +143,8 @@ CHARS is a regexp-like character alternative (e.g., \"[)$]\")."
(charset (mail-content-type-get (mm-handle-type handle)
'charset)))
(when (and charset
- (setq charset (mm-charset-to-coding-system charset))
+ (setq charset (mm-charset-to-coding-system
+ charset nil t))
(not (eq charset 'ascii)))
(insert (prog1
(mm-decode-coding-string (buffer-string) charset)
diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index a8277635f3e..5f152921b66 100644
--- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -92,10 +92,10 @@
:accessor gnus-icalendar-event:rsvp
:initform nil
:type (or null boolean))
- (participation-required :initarg :participation-required
- :accessor gnus-icalendar-event:participation-required
- :initform t
- :type (or null boolean))
+ (participation-type :initarg :participation-type
+ :accessor gnus-icalendar-event:participation-type
+ :initform 'non-participant
+ :type (or null t))
(req-participants :initarg :req-participants
:accessor gnus-icalendar-event:req-participants
:initform nil
@@ -196,15 +196,18 @@
(attendee (when attendee-name-or-email
(gnus-icalendar-event--find-attendee ical attendee-name-or-email)))
(attendee-names (gnus-icalendar-event--get-attendee-names ical))
+ (role (plist-get (cadr attendee) 'ROLE))
+ (participation-type (pcase role
+ ("REQ-PARTICIPANT" 'required)
+ ("OPT-PARTICIPANT" 'optional)
+ (_ 'non-participant)))
(args (list :method method
:organizer organizer
:start-time (gnus-icalendar-event--decode-datefield event 'DTSTART)
:end-time (gnus-icalendar-event--decode-datefield event 'DTEND)
- :rsvp (string= (plist-get (cadr attendee) 'RSVP)
- "TRUE")
- :participation-required (string= (plist-get (cadr attendee) 'ROLE)
- "REQ-PARTICIPANT")
- :req-participants (cdar attendee-names)
+ :rsvp (string= (plist-get (cadr attendee) 'RSVP) "TRUE")
+ :participation-type participation-type
+ :req-participants (car attendee-names)
:opt-participants (cadr attendee-names)))
(event-class (cond
((string= method "REQUEST") 'gnus-icalendar-event-request)
@@ -387,14 +390,46 @@ Return nil for non-recurring EVENT."
(end (gnus-icalendar-event:end-time event))
(start-date (format-time-string "%Y-%m-%d %a" start))
(start-time (format-time-string "%H:%M" start))
+ (start-at-midnight (string= start-time "00:00"))
(end-date (format-time-string "%Y-%m-%d %a" end))
(end-time (format-time-string "%H:%M" end))
+ (end-at-midnight (string= end-time "00:00"))
+ (start-end-date-diff (/ (float-time (time-subtract
+ (date-to-time end-date)
+ (date-to-time start-date)))
+ 86400))
(org-repeat (gnus-icalendar-event:org-repeat event))
- (repeat (if org-repeat (concat " " org-repeat) "")))
-
- (if (equal start-date end-date)
- (format "<%s %s-%s%s>" start-date start-time end-time repeat)
- (format "<%s %s>--<%s %s>" start-date start-time end-date end-time))))
+ (repeat (if org-repeat (concat " " org-repeat) ""))
+ (time-1-day '(0 86400)))
+
+ ;; NOTE: special care is needed with appointments ending at midnight
+ ;; (typically all-day events): the end time has to be changed to 23:59 to
+ ;; prevent org agenda showing the event on one additional day
+ (cond
+ ;; start/end midnight
+ ;; A 0:0 - A+1 0:0 -> A
+ ;; A 0:0 - A+n 0:0 -> A - A+n-1
+ ((and start-at-midnight end-at-midnight) (if (> start-end-date-diff 1)
+ (let ((end-ts (format-time-string "%Y-%m-%d %a" (time-subtract end time-1-day))))
+ (format "<%s>--<%s>" start-date end-ts))
+ (format "<%s%s>" start-date repeat)))
+ ;; end midnight
+ ;; A .:. - A+1 0:0 -> A .:.-23:59
+ ;; A .:. - A+n 0:0 -> A .:. - A_n-1
+ (end-at-midnight (if (= start-end-date-diff 1)
+ (format "<%s %s-23:59%s>" start-date start-time repeat)
+ (let ((end-ts (format-time-string "%Y-%m-%d %a" (time-subtract end time-1-day))))
+ (format "<%s %s>--<%s>" start-date start-time end-ts))))
+ ;; start midnight
+ ;; A 0:0 - A .:. -> A 0:0-.:. (default 1)
+ ;; A 0:0 - A+n .:. -> A - A+n .:.
+ ((and start-at-midnight
+ (plusp start-end-date-diff)) (format "<%s>--<%s %s>" start-date end-date end-time))
+ ;; default
+ ;; A .:. - A .:. -> A .:.-.:.
+ ;; A .:. - B .:.
+ ((zerop start-end-date-diff) (format "<%s %s-%s%s>" start-date start-time end-time repeat))
+ (t (format "<%s %s>--<%s %s>" start-date start-time end-date end-time)))))
(defun gnus-icalendar--format-summary-line (summary &optional location)
(if location
@@ -419,7 +454,7 @@ Return nil for non-recurring EVENT."
("DT" . ,(gnus-icalendar-event:org-timestamp event))
("ORGANIZER" . ,(gnus-icalendar-event:organizer event))
("LOCATION" . ,(gnus-icalendar-event:location event))
- ("PARTICIPATION_REQUIRED" . ,(when (gnus-icalendar-event:participation-required event) "t"))
+ ("PARTICIPATION_TYPE" . ,(symbol-name (gnus-icalendar-event:participation-type event)))
("REQ_PARTICIPANTS" . ,(gnus-icalendar--format-participant-list (gnus-icalendar-event:req-participants event)))
("OPT_PARTICIPANTS" . ,(gnus-icalendar--format-participant-list (gnus-icalendar-event:opt-participants event)))
("RRULE" . ,(gnus-icalendar-event:recur event))
@@ -481,7 +516,7 @@ is searched."
(when file
(with-current-buffer (find-file-noselect file)
(with-slots (uid summary description organizer location recur
- participation-required req-participants opt-participants) event
+ participation-type req-participants opt-participants) event
(let ((event-pos (org-find-entry-with-id uid)))
(when event-pos
(goto-char event-pos)
@@ -523,7 +558,7 @@ is searched."
(org-entry-put event-pos "DT" (gnus-icalendar-event:org-timestamp event))
(org-entry-put event-pos "ORGANIZER" organizer)
(org-entry-put event-pos "LOCATION" location)
- (org-entry-put event-pos "PARTICIPATION_REQUIRED" (when participation-required "t"))
+ (org-entry-put event-pos "PARTICIPATION_TYPE" (symbol-name participation-type))
(org-entry-put event-pos "REQ_PARTICIPANTS" (gnus-icalendar--format-participant-list req-participants))
(org-entry-put event-pos "OPT_PARTICIPANTS" (gnus-icalendar--format-participant-list opt-participants))
(org-entry-put event-pos "RRULE" recur)
@@ -617,6 +652,22 @@ is searched."
:type '(string)
:group 'gnus-icalendar)
+(defcustom gnus-icalendar-additional-identities nil
+ "We need to know your identity to make replies to calendar requests work.
+
+Gnus will only offer you the Accept/Tentative/Decline buttons for
+calendar events if any of your identities matches at least one
+RSVP participant.
+
+Your identity is guessed automatically from the variables `user-full-name',
+`user-mail-address', and `gnus-ignored-from-addresses'.
+
+If you need even more aliases you can define them here. It really
+only makes sense to define names or email addresses."
+
+ :type '(repeat string)
+ :group 'gnus-icalendar)
+
(make-variable-buffer-local
(defvar gnus-icalendar-reply-status nil))
@@ -630,8 +681,9 @@ is searched."
(apply #'append
(mapcar (lambda (x) (if (listp x) x (list x)))
(list user-full-name (regexp-quote user-mail-address)
- ; NOTE: this one can be a list
- gnus-ignored-from-addresses))))
+ ; NOTE: these can be lists
+ gnus-ignored-from-addresses ; already regexp-quoted
+ (mapcar #'regexp-quote gnus-icalendar-additional-identities)))))
;; TODO: make the template customizable
(defmethod gnus-icalendar-event->gnus-calendar ((event gnus-icalendar-event) &optional reply-status)
@@ -642,12 +694,14 @@ is searched."
(cadr x))))
(with-slots (organizer summary description location recur uid
- method rsvp participation-required) event
+ method rsvp participation-type) event
(let ((headers `(("Summary" ,summary)
("Location" ,(or location ""))
("Time" ,(gnus-icalendar-event:org-timestamp event))
("Organizer" ,organizer)
- ("Attendance" ,(if participation-required "Required" "Optional"))
+ ("Attendance" ,(if (eq participation-type 'non-participant)
+ "You are not listed as an attendee"
+ (capitalize (symbol-name participation-type))))
("Method" ,method))))
(when (and (not (gnus-icalendar-event-reply-p event)) rsvp)
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index a458b3fc25b..11a51a79fce 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -4739,7 +4739,9 @@ that instead."
(list resend-to-addresses)
'("-t"))))))
(unless (or (null cpr) (and (numberp cpr) (zerop cpr)))
- (if errbuf (pop-to-buffer errbuf))
+ (when errbuf
+ (pop-to-buffer errbuf)
+ (setq errbuf nil))
(error "Sending...failed with exit value %d" cpr)))
(when message-interactive
(with-current-buffer errbuf
@@ -6271,6 +6273,9 @@ they are."
:link '(custom-manual "(message)Movement")
:type 'boolean)
+(defvar visual-line-mode)
+(declare-function beginning-of-visual-line "simple" (&optional n))
+
(defun message-beginning-of-line (&optional n)
"Move point to beginning of header value or to beginning of line.
The prefix argument N is passed directly to `beginning-of-line'.
@@ -6297,7 +6302,9 @@ between beginning of field and beginning of line."
(goto-char
(if (and eoh (or (< eoh here) (= bol here)))
eoh bol)))
- (beginning-of-line n)))
+ (if (and (boundp 'visual-line-mode) visual-line-mode)
+ (beginning-of-visual-line n)
+ (beginning-of-line n))))
(defun message-buffer-name (type &optional to group)
"Return a new (unique) buffer name based on TYPE and TO."
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index 9512a411d81..48124f17ef9 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -175,7 +175,7 @@
(match-end 2))))
(if (fboundp 'w3-coding-system-for-mime-charset)
(w3-coding-system-for-mime-charset bsubstr)
- (mm-charset-to-coding-system bsubstr))))
+ (mm-charset-to-coding-system bsubstr nil t))))
(delete-region (point-min) (point-max))
(insert (mm-decode-string text charset))))
(save-window-excursion
@@ -343,9 +343,10 @@
'charset)
(symbol-name mail-parse-charset)))
cs)
- (unless (and charset
- (setq cs (mm-charset-to-coding-system charset))
- (not (eq cs 'ascii)))
+ (if (and charset
+ (setq cs (mm-charset-to-coding-system charset nil t))
+ (not (eq cs 'ascii)))
+ (setq charset (format "%s" (mm-coding-system-to-mime-charset cs)))
;; The default.
(setq charset "iso-8859-1"
cs 'iso-8859-1))
diff --git a/lisp/gnus/nndoc.el b/lisp/gnus/nndoc.el
index b17a7a6ecd8..69ac2e8fad8 100644
--- a/lisp/gnus/nndoc.el
+++ b/lisp/gnus/nndoc.el
@@ -56,6 +56,10 @@ from the document.")
`((mmdf
(article-begin . "^\^A\^A\^A\^A\n")
(body-end . "^\^A\^A\^A\^A\n"))
+ (debbugs-db
+ (file-begin . "^\005")
+ (article-begin . "^[\005\007]\n")
+ (body-end . "^\003"))
(mime-digest
(article-begin . "")
(head-begin . "^ ?\n")
@@ -460,6 +464,10 @@ from the document.")
(when (looking-at "\^A\^A\^A\^A$")
t))
+(defun nndoc-debbugs-db-type-p ()
+ (when (looking-at "\006$")
+ t))
+
(defun nndoc-news-type-p ()
(when (looking-at "^Path:.*\n")
t))
diff --git a/lisp/gnus/rfc2231.el b/lisp/gnus/rfc2231.el
index e8d7075bc65..4baacde8ea4 100644
--- a/lisp/gnus/rfc2231.el
+++ b/lisp/gnus/rfc2231.el
@@ -215,7 +215,8 @@ These look like:
\"''This%20is%20%2A%2A%2Afun%2A%2A%2A\", or
\"This is ***fun***\"."
(string-match "\\`\\(?:\\([^']+\\)?'\\([^']+\\)?'\\)?\\(.+\\)" string)
- (let ((coding-system (mm-charset-to-coding-system (match-string 1 string)))
+ (let ((coding-system (mm-charset-to-coding-system
+ (match-string 1 string) nil t))
;;(language (match-string 2 string))
(value (match-string 3 string)))
(mm-with-unibyte-buffer
diff --git a/lisp/help.el b/lisp/help.el
index c21d5b8c1d1..905c875ecb3 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -493,9 +493,8 @@ The optional argument MENUS, if non-nil, says to mention menu bindings.
The optional argument PREFIX, if non-nil, should be a key sequence;
then we display only bindings that start with that prefix."
(let ((buf (current-buffer)))
- (with-help-window "*Help*"
- (with-current-buffer standard-output
- (describe-buffer-bindings buf prefix menus)))))
+ (with-help-window (help-buffer)
+ (describe-buffer-bindings buf prefix menus))))
(defun where-is (definition &optional insert)
"Print message listing key sequences that invoke the command DEFINITION.
@@ -983,6 +982,23 @@ function is called, the window to be resized is selected."
:group 'help
:version "24.3")
+(defcustom temp-buffer-max-width
+ (lambda (buffer)
+ (if (eq (selected-window) (frame-root-window))
+ (/ (x-display-pixel-width) (frame-char-width) 2)
+ (/ (- (frame-width) 2) 2)))
+ "Maximum width of a window displaying a temporary buffer.
+This is effective only when Temp Buffer Resize mode is enabled.
+The value is the maximum width (in columns) which
+`resize-temp-buffer-window' will give to a window displaying a
+temporary buffer. It can also be a function to be called to
+choose the width for such a buffer. It gets one argument, the
+buffer, and should return a positive integer. At the time the
+function is called, the window to be resized is selected."
+ :type '(choice integer function)
+ :group 'help
+ :version "24.4")
+
(define-minor-mode temp-buffer-resize-mode
"Toggle auto-resizing temporary buffer windows (Temp Buffer Resize Mode).
With a prefix argument ARG, enable Temp Buffer Resize mode if ARG
@@ -1010,33 +1026,40 @@ and some others."
(defun resize-temp-buffer-window (&optional window)
"Resize WINDOW to fit its contents.
-WINDOW can be any live window and defaults to the selected one.
-
-Do not make WINDOW higher than `temp-buffer-max-height' nor
-smaller than `window-min-height'. Do nothing if WINDOW is not
-vertically combined, some of its contents are scrolled out of
-view, or WINDOW was not created by `display-buffer'."
+WINDOW must be a live window and defaults to the selected one.
+Do not resize if WINDOW was not created by `display-buffer'.
+
+If WINDOW is part of a vertical combination, restrain its new
+size by `temp-buffer-max-height' and do not resize if its minimum
+accessible position is scrolled out of view. If WINDOW is part
+of a horizontal combination, restrain its new size by
+`temp-buffer-max-width'. In both cases, the value of the option
+`fit-window-to-buffer-horizontally' can inhibit resizing.
+
+If WINDOW is the root window of its frame, resize the frame
+provided `fit-frame-to-buffer' is non-nil."
(setq window (window-normalize-window window t))
(let ((height (if (functionp temp-buffer-max-height)
(with-selected-window window
(funcall temp-buffer-max-height (window-buffer)))
temp-buffer-max-height))
+ (width (if (functionp temp-buffer-max-width)
+ (with-selected-window window
+ (funcall temp-buffer-max-width (window-buffer)))
+ temp-buffer-max-width))
(quit-cadr (cadr (window-parameter window 'quit-restore))))
- (cond
- ;; Resize WINDOW iff it was split off by `display-buffer'.
- ((and (eq quit-cadr 'window)
- (pos-visible-in-window-p (point-min) window)
- (window-combined-p window))
- (fit-window-to-buffer window height))
- ;; Resize FRAME iff it was created by `display-buffer'.
- ((and fit-frame-to-buffer
- (eq quit-cadr 'frame)
- (eq window (frame-root-window window)))
- (let ((frame (window-frame window)))
- (fit-frame-to-buffer
- frame (+ (frame-height frame)
- (- (window-total-size window))
- height)))))))
+ ;; Resize WINDOW iff it was made by `display-buffer'.
+ (when (or (and (eq quit-cadr 'window)
+ (or (and (window-combined-p window)
+ (not (eq fit-window-to-buffer-horizontally
+ 'only))
+ (pos-visible-in-window-p (point-min) window))
+ (and (window-combined-p window t)
+ fit-window-to-buffer-horizontally)))
+ (and (eq quit-cadr 'frame)
+ fit-frame-to-buffer
+ (eq window (frame-root-window window))))
+ (fit-window-to-buffer window height nil width))))
;;; Help windows.
(defcustom help-window-select 'other
@@ -1089,28 +1112,29 @@ window."
(message "%s"
(substitute-command-keys (concat quit-part scroll-part)))))
-(defun help-window-setup (help-window)
- "Set up help window for `with-help-window'.
-HELP-WINDOW is the window used for displaying the help buffer."
- (let* ((help-buffer (when (window-live-p help-window)
- (window-buffer help-window)))
- (help-setup (when (window-live-p help-window)
- (car (window-parameter help-window 'quit-restore)))))
+(defun help-window-setup (window &optional value)
+ "Set up help window WINDOW for `with-help-window'.
+WINDOW is the window used for displaying the help buffer.
+Return VALUE."
+ (let* ((help-buffer (when (window-live-p window)
+ (window-buffer window)))
+ (help-setup (when (window-live-p window)
+ (car (window-parameter window 'quit-restore)))))
(when help-buffer
;; Handle `help-window-point-marker'.
(when (eq (marker-buffer help-window-point-marker) help-buffer)
- (set-window-point help-window help-window-point-marker)
+ (set-window-point window help-window-point-marker)
;; Reset `help-window-point-marker'.
(set-marker help-window-point-marker nil))
(cond
- ((or (eq help-window (selected-window))
+ ((or (eq window (selected-window))
(and (or (eq help-window-select t)
(eq help-setup 'frame)
(and (eq help-window-select 'other)
- (eq (window-frame help-window) (selected-frame))
+ (eq (window-frame window) (selected-frame))
(> (length (window-list nil 'no-mini)) 2)))
- (select-window help-window)))
+ (select-window window)))
;; The help window is or gets selected ...
(help-window-display-message
(cond
@@ -1118,12 +1142,12 @@ HELP-WINDOW is the window used for displaying the help buffer."
;; ... and is new, ...
"Type \"q\" to delete help window")
((eq help-setup 'frame)
- "Type \"q\" to delete help frame")
+ "Type \"q\" to quit the help frame")
((eq help-setup 'other)
;; ... or displayed some other buffer before.
"Type \"q\" to restore previous buffer"))
- help-window t))
- ((and (eq (window-frame help-window) (selected-frame))
+ window t))
+ ((and (eq (window-frame window) (selected-frame))
(= (length (window-list nil 'no-mini)) 2))
;; There are two windows on the help window's frame and the
;; other one is the selected one.
@@ -1133,7 +1157,7 @@ HELP-WINDOW is the window used for displaying the help buffer."
"Type \\[delete-other-windows] to delete the help window")
((eq help-setup 'other)
"Type \"q\" in help window to restore its previous buffer"))
- help-window 'other))
+ window 'other))
(t
;; The help window is not selected ...
(help-window-display-message
@@ -1144,40 +1168,42 @@ HELP-WINDOW is the window used for displaying the help buffer."
((eq help-setup 'other)
;; ... or displayed some other buffer before.
"Type \"q\" in help window to restore previous buffer"))
- help-window))))))
+ window))))
+ ;; Return VALUE.
+ value))
-;; `with-help-window' is a wrapper for `with-output-to-temp-buffer'
+;; `with-help-window' is a wrapper for `with-temp-buffer-window'
;; providing the following additional twists:
-;; (1) Issue more accurate messages telling how to scroll and quit the
-;; help window.
+;; (1) It puts the buffer in `help-mode' (via `help-mode-setup') and
+;; adds cross references (via `help-mode-finish').
+
+;; (2) It issues a message telling how to scroll and quit the help
+;; window (via `help-window-setup').
-;; (2) An option (customizable via `help-window-select') to select the
+;; (3) An option (customizable via `help-window-select') to select the
;; help window automatically.
-;; (3) A marker (`help-window-point-marker') to move point in the help
+;; (4) A marker (`help-window-point-marker') to move point in the help
;; window to an arbitrary buffer position.
;; Note: It's usually always wrong to use `help-print-return-message' in
;; the body of `with-help-window'.
(defmacro with-help-window (buffer-name &rest body)
"Display buffer with name BUFFER-NAME in a help window evaluating BODY.
-Select help window if the actual value of the user option
+Select help window if the current value of the user option
`help-window-select' says so. Return last value in BODY."
(declare (indent 1) (debug t))
`(progn
;; Make `help-window-point-marker' point nowhere. The only place
;; where this should be set to a buffer position is within BODY.
(set-marker help-window-point-marker nil)
- (let* (help-window
- (temp-buffer-show-hook
- (cons (lambda () (setq help-window (selected-window)))
- temp-buffer-show-hook)))
- ;; Return value returned by `with-output-to-temp-buffer'.
- (prog1
- (with-output-to-temp-buffer ,buffer-name
- (progn ,@body))
- (help-window-setup help-window)))))
+ (let ((temp-buffer-window-setup-hook
+ (cons 'help-mode-setup temp-buffer-window-setup-hook))
+ (temp-buffer-window-show-hook
+ (cons 'help-mode-finish temp-buffer-window-show-hook)))
+ (with-temp-buffer-window
+ ,buffer-name nil 'help-window-setup (progn ,@body)))))
;; Called from C, on encountering `help-char' when reading a char.
;; Don't print to *Help*; that would clobber Help history.
diff --git a/lisp/imenu.el b/lisp/imenu.el
index d79b0abeebc..e4b92cf24d6 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -185,6 +185,13 @@ with name concatenation."
:type 'string
:group 'imenu)
+(defcustom imenu-generic-skip-comments-and-strings t
+ "When non-nil, ignore text inside comments and strings.
+Only affects `imenu--generic-function'."
+ :type 'boolean
+ :group 'imenu
+ :version "24.4")
+
;;;###autoload
(defvar imenu-generic-expression nil
"List of definition matchers for creating an Imenu index.
@@ -286,8 +293,10 @@ The function in this variable is called when selecting a normal index-item.")
(defun imenu--subalist-p (item)
- (and (consp (cdr item)) (listp (cadr item))
- (not (eq (car (cadr item)) 'lambda))))
+ (and (consp item)
+ (consp (cdr item))
+ (listp (cadr item))
+ (not (functionp (cadr item)))))
(defmacro imenu-progress-message (_prevpos &optional _relpos _reverse)
"Macro to display a progress message.
@@ -454,7 +463,7 @@ Special elements look like (INDEX-NAME POSITION FUNCTION ARGUMENTS...).
To \"go to\" a special element means applying FUNCTION
to INDEX-NAME, POSITION, and the ARGUMENTS.
-A nested sub-alist element looks like (INDEX-NAME SUB-ALIST).
+A nested sub-alist element looks like (INDEX-NAME . SUB-ALIST).
The function `imenu--subalist-p' tests an element and returns t
if it is a sub-alist.
@@ -638,9 +647,11 @@ Non-nil arguments are in recursive calls."
;; (INDEX-NAME (INDEX-NAME . INDEX-POSITION) ...)
;; while a bottom-level element looks like
;; (INDEX-NAME . INDEX-POSITION)
+ ;; or
+ ;; (INDEX-NAME INDEX-POSITION FUNCTION ARGUMENTS...)
;; We are only interested in the bottom-level elements, so we need to
- ;; recurse if TAIL is a list.
- (cond ((listp tail)
+ ;; recurse if TAIL is a nested ALIST.
+ (cond ((imenu--subalist-p elt)
(if (setq res (imenu--in-alist str tail))
(setq alist nil)))
((if imenu-name-lookup-function
@@ -796,7 +807,9 @@ depending on PATTERNS."
;; starting with its title (or nil).
(menu (assoc menu-title index-alist)))
;; Insert the item unless it is already present.
- (unless (member item (cdr menu))
+ (unless (or (member item (cdr menu))
+ (and imenu-generic-skip-comments-and-strings
+ (nth 8 (syntax-ppss))))
(setcdr menu
(cons item (cdr menu)))))
;; Go to the start of the match, to make sure we
@@ -1024,8 +1037,8 @@ for more information."
(nth 2 index-item) imenu-default-goto-function))
(position (if is-special-item
(cadr index-item) (cdr index-item)))
- (rest (if is-special-item (cddr index-item))))
- (apply function (car index-item) position rest))
+ (args (if is-special-item (cdr (cddr index-item)))))
+ (apply function (car index-item) position args))
(run-hooks 'imenu-after-jump-hook)))
(provide 'imenu)
diff --git a/lisp/international/.gitignore b/lisp/international/.gitignore
index c531d9867f6..161b3125972 100644
--- a/lisp/international/.gitignore
+++ b/lisp/international/.gitignore
@@ -1 +1,16 @@
-*.elc
+# Generated Unicode files.
+charprop.el
+uni-bidi.el
+uni-category.el
+uni-combining.el
+uni-comment.el
+uni-decimal.el
+uni-decomposition.el
+uni-digit.el
+uni-lowercase.el
+uni-mirrored.el
+uni-name.el
+uni-numeric.el
+uni-old-name.el
+uni-titlecase.el
+uni-uppercase.el
diff --git a/lisp/international/characters.el b/lisp/international/characters.el
index 2195308737c..7632650b7f7 100644
--- a/lisp/international/characters.el
+++ b/lisp/international/characters.el
@@ -484,13 +484,16 @@ with L, LRE, or LRO Unicode bidi character type.")
;; Bidi categories
-(map-char-table (lambda (key val)
- (cond
- ((memq val '(R AL RLO RLE))
- (modify-category-entry key ?R))
- ((memq val '(L LRE LRO))
- (modify-category-entry key ?L))))
- (unicode-property-table-internal 'bidi-class))
+;; If bootstrapping without generated uni-*.el files, table not defined.
+(let ((table (unicode-property-table-internal 'bidi-class)))
+ (when table
+ (map-char-table (lambda (key val)
+ (cond
+ ((memq val '(R AL RLO RLE))
+ (modify-category-entry key ?R))
+ ((memq val '(L LRE LRO))
+ (modify-category-entry key ?L))))
+ table)))
;; Latin
@@ -1332,15 +1335,15 @@ Setup char-width-table appropriate for non-CJK language environment."
;;; Setting unicode-category-table.
-(setq unicode-category-table
- (unicode-property-table-internal 'general-category))
-(map-char-table #'(lambda (key val)
- (if (and val
- (or (and (/= (aref (symbol-name val) 0) ?M)
- (/= (aref (symbol-name val) 0) ?C))
- (eq val 'Zs)))
- (modify-category-entry key ?.)))
- unicode-category-table)
+(when (setq unicode-category-table
+ (unicode-property-table-internal 'general-category))
+ (map-char-table #'(lambda (key val)
+ (if (and val
+ (or (and (/= (aref (symbol-name val) 0) ?M)
+ (/= (aref (symbol-name val) 0) ?C))
+ (eq val 'Zs)))
+ (modify-category-entry key ?.)))
+ unicode-category-table))
(optimize-char-table (standard-category-table))
@@ -1426,23 +1429,24 @@ This function updates the char-table `glyphless-char-display'."
(glyphless-set-char-table-range glyphless-char-display
#x80 #x9F method))
((eq target 'format-control)
- (map-char-table
- #'(lambda (char category)
- (if (eq category 'Cf)
- (let ((this-method method)
- from to)
- (if (consp char)
- (setq from (car char) to (cdr char))
- (setq from char to char))
- (while (<= from to)
- (when (/= from #xAD)
- (if (eq method 'acronym)
- (setq this-method
- (aref char-acronym-table from)))
- (set-char-table-range glyphless-char-display
- from this-method))
- (setq from (1+ from))))))
- unicode-category-table))
+ (when unicode-category-table
+ (map-char-table
+ #'(lambda (char category)
+ (if (eq category 'Cf)
+ (let ((this-method method)
+ from to)
+ (if (consp char)
+ (setq from (car char) to (cdr char))
+ (setq from char to char))
+ (while (<= from to)
+ (when (/= from #xAD)
+ (if (eq method 'acronym)
+ (setq this-method
+ (aref char-acronym-table from)))
+ (set-char-table-range glyphless-char-display
+ from this-method))
+ (setq from (1+ from))))))
+ unicode-category-table)))
((eq target 'no-font)
(set-char-table-extra-slot glyphless-char-display 0 method))
(t
diff --git a/lisp/international/charprop.el b/lisp/international/charprop.el
deleted file mode 100644
index 514428d0dc4..00000000000
--- a/lisp/international/charprop.el
+++ /dev/null
@@ -1,88 +0,0 @@
-;; Automatically generated by unidata-gen.el.
-;; FILE: uni-name.el
-(define-char-code-property 'name "uni-name.el"
- "Unicode character name.
-Property value is a string or nil.
-The value nil stands for the default value \"null string\").")
-;; FILE: uni-category.el
-(define-char-code-property 'general-category "uni-category.el"
- "Unicode general category.
-Property value is one of the following symbols:
- Lu, Ll, Lt, Lm, Lo, Mn, Mc, Me, Nd, Nl, No, Pc, Pd, Ps, Pe, Pi, Pf, Po,
- Sm, Sc, Sk, So, Zs, Zl, Zp, Cc, Cf, Cs, Co, Cn")
-;; FILE: uni-combining.el
-(define-char-code-property 'canonical-combining-class "uni-combining.el"
- "Unicode canonical combining class.
-Property value is an integer.")
-;; FILE: uni-bidi.el
-(define-char-code-property 'bidi-class "uni-bidi.el"
- "Unicode bidi class.
-Property value is one of the following symbols:
- L, LRE, LRO, R, AL, RLE, RLO, PDF, EN, ES, ET,
- AN, CS, NSM, BN, B, S, WS, ON")
-;; FILE: uni-decomposition.el
-(define-char-code-property 'decomposition "uni-decomposition.el"
- "Unicode decomposition mapping.
-Property value is a list of characters. The first element may be
-one of these symbols representing compatibility formatting tag:
- font, noBreak, initial, medial, final, isolated, circle, super,
- sub, vertical, wide, narrow, small, square, fraction, compat")
-;; FILE: uni-decimal.el
-(define-char-code-property 'decimal-digit-value "uni-decimal.el"
- "Unicode numeric value (decimal digit).
-Property value is an integer 0..9, or nil.
-The value nil stands for NaN \"Numeric_Value\".")
-;; FILE: uni-digit.el
-(define-char-code-property 'digit-value "uni-digit.el"
- "Unicode numeric value (digit).
-Property value is an integer 0..9, or nil.
-The value nil stands for NaN \"Numeric_Value\".")
-;; FILE: uni-numeric.el
-(define-char-code-property 'numeric-value "uni-numeric.el"
- "Unicode numeric value (numeric).
-Property value is an integer, a floating point, or nil.
-The value nil stands for NaN \"Numeric_Value\".")
-;; FILE: uni-mirrored.el
-(define-char-code-property 'mirrored "uni-mirrored.el"
- "Unicode bidi mirrored flag.
-Property value is a symbol `Y' or `N'. See also the property `mirroring'.")
-;; FILE: uni-old-name.el
-(define-char-code-property 'old-name "uni-old-name.el"
- "Unicode old names as published in Unicode 1.0.
-Property value is a string or nil.
-The value nil stands for the default value \"null string\").")
-;; FILE: uni-comment.el
-(define-char-code-property 'iso-10646-comment "uni-comment.el"
- "Unicode ISO 10646 comment.
-Property value is a string.")
-;; FILE: uni-uppercase.el
-(define-char-code-property 'uppercase "uni-uppercase.el"
- "Unicode simple uppercase mapping.
-Property value is a character or nil.
-The value nil means that the actual property value of a character
-is the character itself.")
-;; FILE: uni-lowercase.el
-(define-char-code-property 'lowercase "uni-lowercase.el"
- "Unicode simple lowercase mapping.
-Property value is a character or nil.
-The value nil means that the actual property value of a character
-is the character itself.")
-;; FILE: uni-titlecase.el
-(define-char-code-property 'titlecase "uni-titlecase.el"
- "Unicode simple titlecase mapping.
-Property value is a character or nil.
-The value nil means that the actual property value of a character
-is the character itself.")
-;; FILE: uni-mirrored.el
-(define-char-code-property 'mirroring "uni-mirrored.el"
- "Unicode bidi-mirroring characters.
-Property value is a character that has the corresponding mirroring image or nil.
-The value nil means that the actual property value of a character
-is the character itself.")
-;; Local Variables:
-;; coding: utf-8
-;; version-control: never
-;; no-byte-compile: t
-;; End:
-
-;; charprop.el ends here
diff --git a/lisp/international/ja-dic-cnv.el b/lisp/international/ja-dic-cnv.el
index 41a31004194..8fa8b6d8056 100644
--- a/lisp/international/ja-dic-cnv.el
+++ b/lisp/international/ja-dic-cnv.el
@@ -1,5 +1,7 @@
;;; ja-dic-cnv.el --- convert a Japanese dictionary (SKK-JISYO.L) to Emacs Lisp
+;; Copyright (C) 2001-2013 Free Software Foundation, Inc.
+
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006, 2007, 2008, 2009, 2010, 2011
;; National Institute of Advanced Industrial Science and Technology (AIST)
@@ -342,15 +344,12 @@ The name of generated file is specified by the variable `ja-dic-filename'."
(with-current-buffer buf
(erase-buffer)
(buffer-disable-undo)
- (insert ";;; ja-dic.el --- dictionary for Japanese input method"
- " -*-coding: utf-8; -*-\n"
+ (insert ";;; ja-dic.el --- dictionary for Japanese input method\n"
";;\tGenerated by the command `skkdic-convert'\n"
";;\tOriginal SKK dictionary file: "
(file-relative-name (expand-file-name filename) dirname)
"\n\n"
";; This file is part of GNU Emacs.\n\n"
- ";;; Commentary:\n\n"
- ";; Do byte-compile this file again after any modification.\n\n"
";;; Start of the header of the original SKK dictionary.\n\n")
(set-buffer skkbuf)
(goto-char 1)
@@ -398,7 +397,13 @@ The name of generated file is specified by the variable `ja-dic-filename'."
;; Postfix
(with-current-buffer buf
(goto-char (point-max))
- (insert ";;\n(provide 'ja-dic)\n\n;;; ja-dic.el ends here\n")))
+ (insert ";;\n(provide 'ja-dic)\n\n"
+ ";; Local Variables:\n"
+ ";; version-control: never\n"
+ ";; no-update-autoloads: t\n"
+ ";; coding: utf-8\n"
+ ";; End:\n\n"
+ ";;; ja-dic.el ends here\n")))
;; Save the working buffer.
(set-buffer buf)
diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el
index bcad78d8ce0..2493700f31f 100644
--- a/lisp/international/titdic-cnv.el
+++ b/lisp/international/titdic-cnv.el
@@ -272,13 +272,11 @@ SPC, 6, 3, 4, or 7 specifying a tone (SPC:$(0?v(N(B, 6:$(0Dm(N(B, 3:$(0&9Vy
(princ ";; Quail package `")
(princ package)
- (princ (format "' -*- coding:%s -*-\n" coding-system-for-write))
+ (princ "\n")
(princ ";; Generated by the command `titdic-convert'\n")
(princ ";;\tOriginal TIT dictionary file: ")
(princ (file-name-nondirectory filename))
- (princ "\n\n;;; Comment:\n\n")
- (princ ";; Byte-compile this file again after any modification.\n\n")
- (princ ";;; Start of the header of original TIT dictionary.\n\n")
+ (princ "\n\n")
(while (not (eobp))
(let ((ch (following-char))
@@ -518,7 +516,13 @@ the generated Quail package is saved."
(widen)
;; Process the body part
- (tit-process-body))))))
+ (tit-process-body)
+
+ (princ ";; Local Variables:\n")
+ (princ ";; version-control: never\n")
+ (princ ";; no-update-autoloads: t\n")
+ (princ (format ";; coding: %s\n" coding-system-for-write))
+ (princ ";; End:\n"))))))
;;;###autoload
(defun batch-titdic-convert (&optional force)
@@ -1148,8 +1152,7 @@ the generated Quail package is saved."
(setq coding-system-for-write
(coding-system-change-eol-conversion coding 'unix))
(with-temp-file (expand-file-name quailfile dirname)
- (insert (format ";; Quail package `%s' -*- coding:%s -*-\n"
- name coding))
+ (insert (format ";; Quail package `%s'\n" name))
(insert ";; Generated by the command `miscdic-convert'\n")
(insert ";; Source dictionary file: " dicfile "\n")
(insert ";; Copyright notice of the source file\n")
@@ -1168,7 +1171,13 @@ the generated Quail package is saved."
(coding-system-change-eol-conversion coding 'unix))
(dicbuf (find-file-noselect filename)))
(funcall converter dicbuf name title)
- (kill-buffer dicbuf)))
+ (kill-buffer dicbuf))
+ (insert ";; Local Variables:\n"
+ ";; version-control: never\n"
+ ";; no-update-autoloads: t\n"
+ (format ";; coding: %s\n" coding)
+ ";; End:\n\n"
+ ";;; " quailfile " ends here\n"))
(message "Converting %s to %s...done" dicfile quailfile))
(setq tail (cdr tail)))))
@@ -1198,4 +1207,7 @@ to store generated Quail packages."
(miscdic-convert filename dir))))
(kill-emacs 0))
+;; Prevent "Local Variables" above confusing Emacs.
+
+
;;; titdic-cnv.el ends here
diff --git a/lisp/international/uni-bidi.el b/lisp/international/uni-bidi.el
deleted file mode 100644
index 2fc5d2bfc67..00000000000
--- a/lisp/international/uni-bidi.el
+++ /dev/null
@@ -1,26 +0,0 @@
-;; Copyright (C) 1991-2013 Unicode, Inc.
-;; This file was generated from the Unicode data files at
-;; http://www.unicode.org/Public/UNIDATA/.
-;; See lisp/international/README for the copyright and permission notice.
-(define-char-code-property 'bidi-class
- #^[1 nil char-code-property-table
-#^^[3 0 5 5 5 5 5 5 5 5 5 17 6 17 18 6 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 17 18 19 19 14 14 14 19 19 19 19 19 13 15 13 15 15 3 3 3 3 3 3 3 3 3 3 15 19 19 19 19 19 19 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 19 19 19 19 19 19 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 19 19 19 19 5] #^^[1 0 #^^[2 0
-#^^[3 0 5 5 5 5 5 5 5 5 5 17 6 17 18 6 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 17 18 19 19 14 14 14 19 19 19 19 19 13 15 13 15 15 3 3 3 3 3 3 3 3 3 3 15 19 19 19 19 19 19 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 19 19 19 19 19 19 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 19 19 19 19 5] "…š„„ƒ…—Ÿˆ" 1 1 1 "¹‡ŽŽ…‰‘" "ð„ˆ" "„î‰" 1 "ƒ‡ö" 1 "Š„­¸" "…‹°•Šƒ" "Ö‡†„І" "Žž›³" "¦‹Ž«‰„†" "–„‰ƒ…«ƒ¤" " ‹·›" "ƒ·„ˆ„ƒ‡Šœ" "º„„ˆ”އ„" "¹„„ƒƒžƒŠ" "¹„…„”Ž" "º„ˆˆ‹œ" "½Œ¥†…" "¾ƒ…ƒ„‡‹”‡" "¼”œ" "Á„ˆ”œ" "ʇƒ©" "±‡„‡ˆ±" "±†‹†²" "˜›„³Ž" "……‹¤‰¹"] #^^[2 4096 "­„†™„ƒ„‹" "†â" 1 1 1 1 "݃ " "Šæ" "ÿ" 1 1 1 1 "šã" "’ƒƒžŒ" "´‡ˆ‹‡’І" "‹ƒñ" "©Ö" " ƒ„‰†ƒ„ƒº" "Þ¢" "—º‡ˆ†Š" 1 "„°……¨‰Œ" " „ºƒƒŽ" "¬ˆÈ" "Ѓ‡„†‹" 1 "À§•„" 1 1 1 "½ƒ‹ƒƒƒ"] #^^[2 8192 "‹ƒ˜
- …š…†ƒ† ƒ" "Š ƒ‘›•¡" "„Šƒ…†„‹„……„ " "‰†ð" "’ ì" 19 "¶Å…" "•ÞŒ" "§™‹• " "ˆ”Ζ" 19 19 19 "¬Ó" "ÿ" 19 1 1 19 19 19 19 "ÍƒŠ¦" 1 1 "冄ƒ‡‡" "ÿ" "à " "¼Ä" "šÙŒ" 19 "ÖšŒ„"] #^^[2 12288 "„ƒ™‰„……ƒÀ" "™ƒÚ„" 1 "À¤œ" "±œƒ" "±Œ„°" "÷„…" "ÞŸ" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 16384 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 "ÀÀ" 1 1 1 1] 1 1 1 1 #^^[2 36864 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
-#^^[3 40832 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]] #^^[2 40960 1 1 1 1 1 1 1 1 1 "·¹" 1 1 "ƒß„Š" "ŸÐŽ" "¢Þ" "ˆ÷" "ƒ„™„Œº„ˆ" "Ä›’Ž" "¦ˆ™‹®" "ƒ°„Ã" "©†Œˆ³" "°ƒ…ªˆ‰" 1 "å„’" 1 1 1 1 1 1 1 1] 1 1 #^^[2 53248 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 #^^[2 61440 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 "Š ¦°" 7 7 7 "¾À" "ý" "Š†‡‰ ‰ ƒ„" "ÿ" "ƒ…  Š†š†š‹š" "àƒ‡Š…"]] #^^[1 65536 #^^[2 65536 1 1 "¾À" "‹…Œá" 1 1 1 1 1 1 1 1 1 1 1 1 2 2 "Ÿà" 2 "ƒ…„¨ƒ„À" 2 "¹‡À" 2 2 2 2 2 "àŸ" 2 2 2] #^^[2 69632 "¶‹”š" "±„Å" "ƒ¤…ˆË" "´‰Á" 1 1 1 1 1 1 1 1 1 "«†È" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 73728 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 77824 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 1 #^^[2 90112 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 "„í"] 1 1 1 1 #^^[2 110592 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 #^^[2 118784 1 1 "烉ˆ…" "ƒ‡ž„Ò" "ƒº" 1 "ש" 1 1 1 1 1 1 "Û¤" "•¹°" "‰¹Š²" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 122880 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 "„›Š„†„ƒ„‡„„" "Š‘…ƒ…‘´Ž" 2 2] #^^[2 126976 "¬„Ð" "”ŒŽ " "‹ß”" 1 1 1 "¡†Æƒ" "”Œ¥…•‘" "¿¾" "ø„ƒ" "¾„Œ˜˜" "û…" "Á„‹°" "ƺ" "ôŒ" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]] #^^[1 131072 1 1 1 1 1 1 1 1 1 1 #^^[2 172032 1 1 1 1 1 1 1 1 1 1 1 1 1
-#^^[3 173696 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 176128 1 1 1 1 1 1 1 1 1 1 1 1 1 1
-#^^[3 177920 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1
-#^^[3 178176 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 1 1 #^^[2 192512 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]] 1 1 1 1 1 1 1 1 1 1 1 #^^[1 917504 #^^[2 917504 "žà" 1 16 "ð" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[1 983040 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 #^^[2 1044480 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
-#^^[3 1048448 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]]] #^^[1 1048576 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 #^^[2 1110016 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
-#^^[3 1113984 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]]] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 bidi-class 0 1 #[(val) "\301\236A\207" [val ((L . "Left-to-Right") (LRE . "Left-to-Right Embedding") (LRO . "Left-to-Right Override") (R . "Right-to-Left") (AL . "Right-to-Left Arabic") (RLE . "Right-to-Left Embedding") (RLO . "Right-to-Left Override") (PDF . "Pop Directional Format") (EN . "European Number") (ES . "European Number Separator") (ET . "European Number Terminator") (AN . "Arabic Number") (CS . "Common Number Separator") (NSM . "Non-Spacing Mark") (BN . "Boundary Neutral") (B . "Paragraph Separator") (S . "Segment Separator") (WS . "Whitespace") (ON . "Other Neutrals"))] 2] [nil L R EN AN BN B AL LRE LRO RLE RLO PDF ES ET CS NSM S WS ON LRI RLI FSI PDI]]
- "Unicode bidi class.
-Property value is one of the following symbols:
- L, LRE, LRO, R, AL, RLE, RLO, PDF, EN, ES, ET,
- AN, CS, NSM, BN, B, S, WS, ON")
-;; Local Variables:
-;; coding: utf-8
-;; version-control: never
-;; no-byte-compile: t
-;; End:
-
-;; uni-bidi.el ends here
diff --git a/lisp/international/uni-category.el b/lisp/international/uni-category.el
deleted file mode 100644
index 45148c91746..00000000000
--- a/lisp/international/uni-category.el
+++ /dev/null
@@ -1,38 +0,0 @@
-;; Copyright (C) 1991-2013 Unicode, Inc.
-;; This file was generated from the Unicode data files at
-;; http://www.unicode.org/Public/UNIDATA/.
-;; See lisp/international/README for the copyright and permission notice.
-(define-char-code-property 'general-category
- #^[30 nil char-code-property-table
-#^^[3 0 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 23 18 18 18 20 18 18 18 14 15 18 19 18 13 18 18 9 9 9 9 9 9 9 9 9 9 18 18 19 19 19 18 18 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 14 18 15 21 12 21 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 14 19 15 19 26] #^^[1 0 #^^[2 0
-#^^[3 0 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 23 18 18 18 20 18 18 18 14 15 18 19 18 13 18 18 9 9 9 9 9 9 9 9 9 9 18 18 19 19 19 18 18 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 14 18 15 21 12 21 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 14 19 15 19 26] " „   ƒ—‡˜ˆ" "" "ƒ„ƒƒƒƒ„ƒ" "‡„±" "”›’„ŒŽ…‡‘" "ðƒ" "„ƒ‘‰£ƒƒ…ƒ" "°°" "…" "‰¦†Ÿ" "ˆ „­ ˆ›…ƒ‹" "…ƒ‹ Š• Š„" "Ô‡†„ Šƒ" "Žž›³" "¦‹Ž Š¡‰ƒ…" "–„‰ƒ…™ƒ¡" " ‹·›" "ƒ¶ƒˆ„‡Š І‡" "ˆ–‡ƒ„ƒ„ˆ„ƒ Š †„" "†„–‡ƒ„ƒƒ‡„‡ ŠƒŠ" "‰ƒ–‡…ƒ… ŠŽ" "ˆ–‡…„ˆ„ƒ Š †ˆ" "†ƒƒ„ƒƒƒƒƒŒ„ƒƒƒ†Ž Š ƒ†…" "ƒˆƒ—Š…ƒƒ„ƒ„‡† Šˆ ‡" "ˆƒ—Š……‡‡ Š" "ˆƒ©ƒ„ƒƒˆˆ Š †ƒ†" "’ƒ˜‰‡ƒ„ƒƒˆ’‹" "°‡„†ˆ Ф" "†„‡ƒ„†…† Š„ " "ƒƒ† Š Šˆ¤„Ž" "……‹¤ˆ†…„¥"] #^^[2 4096 "«„† І†„ƒƒ‡ƒ„‹" "† Šƒ¦…«ƒ" 5 5 "É„‡„ " "‰„¡„‡„¨" "‘„É ”ƒ" "Š†Õ‹" " ÿ" 5 5 5 "í‘" "šƒËƒ
-ƒ" "„ƒ‹’ƒ‰’ŒƒŒ" "´‡ˆ‹ƒƒ І І" "† „ƒ І£´ˆ" "©…ÆŠ" "ƒƒ„ƒ„†ƒ„ƒ Šž…‹" "¬„‘‡† Š ƒ¢" "—µ‡ˆ†Š" " І І‡†Ò" "„¯……‡„ ЇЉ‰ƒ" "ž„ Ьƒƒˆ„" "¤ˆˆƒ… Šƒƒ Šž†" "Àˆˆƒ‡„„‰" "¬¿‡" "›¥§•„" "" "‰" "ˆˆ††ˆˆˆˆ††ˆˆˆŽ" "ˆˆˆˆˆˆ…„ƒƒ„ƒ„„ƒˆ…ƒƒ„"] #^^[2 8192 "‹… †ˆ…‰„ ƒ‹ Š…Š  †ƒ" " Šƒƒ›•„ƒŒ" "„ƒƒ…†„„„…„ 
- " "
-ƒ
-„ †……„‡ŸŸŒ" 19 19 "ˆ”‡Ñƒ" "›™¨†’Œ" "§™‹•  " " œÎ –" 22 "·‰¶ˆ" "ï" 22 "ç Š" " ”¬…Ÿ" 22 22 19 "ƒ¿ " 19 19 "°•†ƒŠ¦" 30 "¯¯ƒ„†" "†ƒ…„ " "¦…¸‡Ž" "—‰‡‡‡‡‡‡‡‡ " "ƒ‰  …Š Ä" "šÙŒ" 22 "ÖšŒ„"] #^^[2 12288 "ƒ
- 
-‰„ …
-ƒ¿" "— Úƒ" "…©ƒÏ" " „Š›…¤Œ" "Ÿ Šž ˆ  " " Ч ¿" 22 22 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5] #^^[2 16384 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 "¶ŠÀ" 5 5 5 5] 5 5 5 5 #^^[2 36864 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
-#^^[3 40832 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30]] #^^[2 40960 "•ê" 5 5 5 5 5 5 5 5 "ƒ·‰¨†" 5 5 "Œƒ Š”ƒŠ" "‡Æ
-Іˆ" "—‰ƒˆ" "ŒÍ…" "ƒ„—„„ ††´„ˆ" "²‰ І’†ƒ„" " Šœˆ—‹‹ƒ" "ƒ¯„„ Š„ " "©†‰ƒˆ Š„†ƒ„" "°ƒ…˜‹‰" "†††‰‡‡Ñ" "À£ І" 5 5 5 5 5 5 5 5] 5 5 #^^[2 53248 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 "¤Œ—„±„" 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30] 29 #^^[2 61440 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 5 5 "î" "Ú¦" "‡Œ……Š…º" "²‘­" 5 5 "¾°" "¶¨Œ" "‡†‡‰ „ ƒƒ„ ƒ ƒ„…Š" "ý" "ƒƒ  Šƒš šŠ" "žŸƒ†††ƒƒ„Šƒ"]] #^^[1 65536 #^^[2 65536 "Œš“Ž¢" "û…" "ƒ„ ­ƒ‰
-µ „‡" "Š …Œ´­" 30 "ƒ±¯" "Ÿ „Œ‘
-ˆ
-µ" "ž¤„ˆ
-…ª" "¨¨°" "ž ŠÖ" 30 30 30 30 30 30 "†¬ƒ— ˆ " 30 "– †ƒš…À" "¸†À" "ƒ…„„ƒ›„ƒ„ ˆˆ‰‡ " 30 "¶ƒ‡– ˆ“… ˆ" 30 "É·" 30 30 30 "à Ÿ" 30 30 30] #^^[2 69632 "µ‡„ ” А" "­ƒ„„Ž™‡ І" "ƒ¤…ˆ Š„¼" "°ƒ‰„„‡ Ц" 30 30 30 30 30 30 30 30 30 "«†ˆ ж" 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30] #^^[2 73728 5 5 5 5 5 5 "ï‘" 30 "
-㍄Œ" 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30] #^^[2 77824 5 5 5 5 5 5 5 5 "¯Ñ" 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30] 30 30 #^^[2 90112 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 5 5 5 5 "¹Ç" 30 30 30 30 30 30 30 30 30 "Å‹®" "„à"] 30 30 30 30 #^^[2 110592 "þ" 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30] 30 #^^[2 118784 22 "öŠ" "§¼ƒƒ†ˆ…" "ƒ‡ž„°¢" "ƒº" 30 "׉ ’Ž" 30 "ššš‡’˜" "š„ˆ„‡‹š–" "„„ˆ‡š„…ƒ‡š”" "†šššš’" "ˆšššš" "Šœ™™†™„" "•†™™†™" "‰†™™† ²" 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30] #^^[2 122880 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 "„›Š„†„ƒ„‡„„" "Š‘…ƒ…‘´Ž" 30 30] #^^[2 126976 "¬„Ð" "”ŒŽ " " ‹…Ÿ¼„" "›Ëš" "ƒ«…‰‡®" 30 "¡†Æƒ" "”Œ¥…•‘" "¿¾" "ø„ƒ" "¾„Œ˜˜" "û…" "Á„‹°" "ƺ" "ôŒ" 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30]] #^^[1 131072 5 5 5 5 5 5 5 5 5 5 #^^[2 172032 5 5 5 5 5 5 5 5 5 5 5 5 5
-#^^[3 173696 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30] 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5] #^^[2 176128 5 5 5 5 5 5 5 5 5 5 5 5 5 5
-#^^[3 177920 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 30 30 30 30 30 30 30 30 30 30 30 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5] 5
-#^^[3 178176 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30] 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30] 30 30 30 #^^[2 192512 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 5 5 5 5 "žâ" 30 30 30 30 30 30 30 30 30 30 30]] 30 30 30 30 30 30 30 30 30 30 30 #^^[1 917504 #^^[2 917504 "žà" 30 6 "ð" 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30] 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30] #^^[1 983040 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 #^^[2 1044480 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29
-#^^[3 1048448 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 30 30]]] #^^[1 1048576 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 #^^[2 1110016 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29
-#^^[3 1113984 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 30 30]]] 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 general-category 0 1 #[(val) "\301\236A\207" [val ((nil . "Uknown") (Lu . "Letter, Uppercase") (Ll . "Letter, Lowercase") (Lt . "Letter, Titlecase") (Lm . "Letter, Modifier") (Lo . "Letter, Other") (Mn . "Mark, Nonspacing") (Mc . "Mark, Spacing Combining") (Me . "Mark, Enclosing") (Nd . "Number, Decimal Digit") (Nl . "Number, Letter") (No . "Number, Other") (Pc . "Punctuation, Connector") (Pd . "Punctuation, Dash") (Ps . "Punctuation, Open") (Pe . "Punctuation, Close") (Pi . "Punctuation, Initial quote") (Pf . "Punctuation, Final quote") (Po . "Punctuation, Other") (Sm . "Symbol, Math") (Sc . "Symbol, Currency") (Sk . "Symbol, Modifier") (So . "Symbol, Other") (Zs . "Separator, Space") (Zl . "Separator, Line") (Zp . "Separator, Paragraph") (Cc . "Other, Control") (Cf . "Other, Format") (Cs . "Other, Surrogate") (Co . "Other, Private Use") (Cn . "Other, Not Assigned"))] 2] [nil Lu Ll Lt Lm Lo Mn Mc Me Nd Nl No Pc Pd Ps Pe Pi Pf Po Sm Sc Sk So Zs Zl Zp Cc Cf Cs Co Cn]]
- "Unicode general category.
-Property value is one of the following symbols:
- Lu, Ll, Lt, Lm, Lo, Mn, Mc, Me, Nd, Nl, No, Pc, Pd, Ps, Pe, Pi, Pf, Po,
- Sm, Sc, Sk, So, Zs, Zl, Zp, Cc, Cf, Cs, Co, Cn")
-;; Local Variables:
-;; coding: utf-8
-;; version-control: never
-;; no-byte-compile: t
-;; End:
-
-;; uni-category.el ends here
diff --git a/lisp/international/uni-combining.el b/lisp/international/uni-combining.el
deleted file mode 100644
index a98d8fbd8de..00000000000
--- a/lisp/international/uni-combining.el
+++ /dev/null
@@ -1,26 +0,0 @@
-;; Copyright (C) 1991-2013 Unicode, Inc.
-;; This file was generated from the Unicode data files at
-;; http://www.unicode.org/Public/UNIDATA/.
-;; See lisp/international/README for the copyright and permission notice.
-(define-char-code-property 'canonical-combining-class
- #^[1 nil char-code-property-table 1 #^^[1 0 #^^[2 0 1 1 1 1 1 1 "•„…„‹…„ˆƒƒƒ„
-
-
-
- " 1 1 "ƒ…ø" 1 "‘„ƒ ††  ¸" "ˆ° !\"#$…%" "Ö‡„’" "‘&žƒƒµ" "뇌" "–„‰ƒ…«ƒ¤" "䃃 !\"ƒ„" "¼'(ƒ«" "¼'(²" "¼'(²" "¼'(²" "¼'(²" "Í(²" "Í(‡)*©" "¼'(²" "Í(²" "Ê(µ" "¸++(,„´" "¸--Ž.„´" "˜›·/01…0„" "0(¾¹"] #^^[2 4096 "·'((Å" "ò" 1 1 1 1 "݃ " 1 1 1 1 1 1 1 "”(Ÿ(Ë" "Ò(Š¢" 1 "© Ö" "¹ Ä" 1 "—Ç(”ˆ" 1 "´'(¦‡Œ" "ª((º'‹((Œ" "·'È" "Ѓ…„‡„†‹" 1 "À‡
-2–• " 1 1 1 1] #^^[2 8192 1 "Єƒ„ƒ„" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 "" "ÿ(" "à " 1 1 1 1] #^^[2 12288 "ª3  44Ð" "™55å" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 16384 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 1 1 1 #^^[2 36864 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
-#^^[3 40832 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]] #^^[2 40960 1 1 1 1 1 1 1 1 1 1 1 1 "" "ŸÐŽ" 1 1 "†(ù" "Ä(›’Ž" "«ƒ¥(¬" "³'Œ(¿" 1 "°…´(‰" 1 "í(’" 1 1 1 1 1 1 1 1] 1 1 #^^[2 53248 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 #^^[2 61440 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 "ž6á" 1 1 1 1 1 " ‡Ù" 1 1 1]] #^^[1 65536 #^^[2 65536 1 1 1 "ý" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 "¨„(À" 1 1 1 1 1 1 1 1 1 1 1] #^^[2 69632 "Æ(¹" "¹('Å" "ƒ°((Ë" "À(¿" 1 1 1 1 1 1 1 1 1 "¶('È" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 73728 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 77824 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 1 #^^[2 90112 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 1 1 1 #^^[2 110592 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 #^^[2 118784 1 1 "僃7…ˆ…" "ƒ…ž„Ò" "ƒ»" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 122880 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 126976 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]] #^^[1 131072 1 1 1 1 1 1 1 1 1 1 #^^[2 172032 1 1 1 1 1 1 1 1 1 1 1 1 1
-#^^[3 173696 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 176128 1 1 1 1 1 1 1 1 1 1 1 1 1 1
-#^^[3 177920 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1
-#^^[3 178176 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 1 1 #^^[2 192512 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]] 1 1 1 1 1 1 1 1 1 1 1 #^^[1 917504 #^^[2 917504 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[1 983040 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 #^^[2 1044480 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
-#^^[3 1048448 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]]] #^^[1 1048576 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 #^^[2 1110016 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
-#^^[3 1113984 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]]] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 canonical-combining-class 0 1 #[(val) "\301\236A\207" [val ((0 . "Spacing, split, enclosing, reordrant, and Tibetan subjoined") (1 . "Overlays and interior") (7 . "Nuktas") (8 . "Hiragana/Katakana voicing marks") (9 . "Viramas") (10 . "Start of fixed position classes") (199 . "End of fixed position classes") (200 . "Below left attached") (202 . "Below attached") (204 . "Below right attached") (208 . "Left attached (reordrant around single base character)") (210 . "Right attached") (212 . "Above left attached") (214 . "Above attached") (216 . "Above right attached") (218 . "Below left") (220 . "Below") (222 . "Below right") (224 . "Left (reordrant around single base character)") (226 . "Right") (228 . "Above left") (230 . "Above") (232 . "Above right") (233 . "Double below") (234 . "Double above") (240 . "Below (iota subscript)"))] 2] [nil 0 230 232 220 216 202 1 240 233 234 222 228 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 30 31 32 27 28 29 33 34 35 36 7 9 84 91 103 107 118 122 129 130 132 214 218 224 8 26 226]]
- "Unicode canonical combining class.
-Property value is an integer.")
-;; Local Variables:
-;; coding: utf-8
-;; version-control: never
-;; no-byte-compile: t
-;; End:
-
-;; uni-combining.el ends here
diff --git a/lisp/international/uni-comment.el b/lisp/international/uni-comment.el
deleted file mode 100644
index ca1a4be2195..00000000000
--- a/lisp/international/uni-comment.el
+++ /dev/null
Binary files differ
diff --git a/lisp/international/uni-decimal.el b/lisp/international/uni-decimal.el
deleted file mode 100644
index d135ea1f93d..00000000000
--- a/lisp/international/uni-decimal.el
+++ /dev/null
Binary files differ
diff --git a/lisp/international/uni-decomposition.el b/lisp/international/uni-decomposition.el
deleted file mode 100644
index 0c7dd10b425..00000000000
--- a/lisp/international/uni-decomposition.el
+++ /dev/null
Binary files differ
diff --git a/lisp/international/uni-digit.el b/lisp/international/uni-digit.el
deleted file mode 100644
index d4e06c6242c..00000000000
--- a/lisp/international/uni-digit.el
+++ /dev/null
Binary files differ
diff --git a/lisp/international/uni-lowercase.el b/lisp/international/uni-lowercase.el
deleted file mode 100644
index 5ddac66707e..00000000000
--- a/lisp/international/uni-lowercase.el
+++ /dev/null
Binary files differ
diff --git a/lisp/international/uni-mirrored.el b/lisp/international/uni-mirrored.el
deleted file mode 100644
index b7ebdbb729f..00000000000
--- a/lisp/international/uni-mirrored.el
+++ /dev/null
Binary files differ
diff --git a/lisp/international/uni-name.el b/lisp/international/uni-name.el
deleted file mode 100644
index 3444ba9db64..00000000000
--- a/lisp/international/uni-name.el
+++ /dev/null
Binary files differ
diff --git a/lisp/international/uni-numeric.el b/lisp/international/uni-numeric.el
deleted file mode 100644
index 9d88cf4ec89..00000000000
--- a/lisp/international/uni-numeric.el
+++ /dev/null
Binary files differ
diff --git a/lisp/international/uni-old-name.el b/lisp/international/uni-old-name.el
deleted file mode 100644
index efc15c76a7a..00000000000
--- a/lisp/international/uni-old-name.el
+++ /dev/null
Binary files differ
diff --git a/lisp/international/uni-titlecase.el b/lisp/international/uni-titlecase.el
deleted file mode 100644
index 27724577017..00000000000
--- a/lisp/international/uni-titlecase.el
+++ /dev/null
Binary files differ
diff --git a/lisp/international/uni-uppercase.el b/lisp/international/uni-uppercase.el
deleted file mode 100644
index 9ce518abb5e..00000000000
--- a/lisp/international/uni-uppercase.el
+++ /dev/null
Binary files differ
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 3abb03a084a..b411396cc70 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -637,6 +637,8 @@ Each set is a vector of the form:
;; isearch is invoked.
(defvar isearch-input-method-local-p nil)
+(defvar isearch--saved-overriding-local-map nil)
+
;; Minor-mode-alist changes - kind of redundant with the
;; echo area, but if isearching in multiple windows, it can be useful.
@@ -904,6 +906,9 @@ convert the search string to a regexp used by regexp search functions."
(setq overriding-terminal-local-map isearch-mode-map)
(run-hooks 'isearch-mode-hook)
+ ;; Remember the initial map possibly modified
+ ;; by external packages in isearch-mode-hook. (Bug#16035)
+ (setq isearch--saved-overriding-local-map overriding-terminal-local-map)
;; Pushing the initial state used to be before running isearch-mode-hook,
;; but a hook might set `isearch-push-state-function' used in
@@ -912,8 +917,8 @@ convert the search string to a regexp used by regexp search functions."
(isearch-update)
- (add-hook 'pre-command-hook 'isearch-pre-command-hook nil t)
- (add-hook 'post-command-hook 'isearch-post-command-hook nil t)
+ (add-hook 'pre-command-hook 'isearch-pre-command-hook)
+ (add-hook 'post-command-hook 'isearch-post-command-hook)
(add-hook 'mouse-leave-buffer-hook 'isearch-done)
(add-hook 'kbd-macro-termination-hook 'isearch-done)
@@ -992,8 +997,8 @@ NOPUSH is t and EDIT is t."
(unless (equal (car command-history) command)
(setq command-history (cons command command-history)))))
- (remove-hook 'pre-command-hook 'isearch-pre-command-hook t)
- (remove-hook 'post-command-hook 'isearch-post-command-hook t)
+ (remove-hook 'pre-command-hook 'isearch-pre-command-hook)
+ (remove-hook 'post-command-hook 'isearch-post-command-hook)
(remove-hook 'mouse-leave-buffer-hook 'isearch-done)
(remove-hook 'kbd-macro-termination-hook 'isearch-done)
(setq isearch-lazy-highlight-start nil)
@@ -2235,7 +2240,7 @@ before the command is executed globally with terminated Isearch."
(cond
;; Don't exit Isearch if we're in the middle of some
;; set-temporary-overlay-map thingy like universal-argument--mode.
- ((not (eq overriding-terminal-local-map isearch-mode-map)))
+ ((not (eq overriding-terminal-local-map isearch--saved-overriding-local-map)))
;; Don't exit Isearch for isearch key bindings.
((commandp (lookup-key isearch-mode-map key nil)))
;; Optionally edit the search string instead of exiting.
diff --git a/lisp/json.el b/lisp/json.el
index aaa7bb0c499..21523c1aa8b 100644
--- a/lisp/json.el
+++ b/lisp/json.el
@@ -126,9 +126,10 @@ without indentation.")
(mapconcat 'identity strings separator))
(defun json-alist-p (list)
- "Non-null if and only if LIST is an alist."
+ "Non-null if and only if LIST is an alist with simple keys."
(while (consp list)
- (setq list (if (consp (car list))
+ (setq list (if (and (consp (car list))
+ (atom (caar list)))
(cdr list)
'not-alist)))
(null list))
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index 64c3d565e98..62015a04b85 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -840,13 +840,11 @@ for details on preparing Emacs for automatic allout activation.
;;;***
-;;;### (autoloads nil "allout-widgets" "allout-widgets.el" (20996
-;;;;;; 49577 892030 0))
+;;;### (autoloads nil "allout-widgets" "allout-widgets.el" (21124
+;;;;;; 45367 88860 0))
;;; Generated autoloads from allout-widgets.el
(push (purecopy '(allout-widgets 1 0)) package--builtin-versions)
-(let ((loads (get 'allout-widgets 'custom-loads))) (if (member '"allout-widgets" loads) nil (put 'allout-widgets 'custom-loads (cons '"allout-widgets" loads))))
-
(autoload 'allout-widgets-setup "allout-widgets" "\
Commission or decommission allout-widgets-mode along with allout-mode.
@@ -1158,8 +1156,8 @@ Returns list of symbols and documentation found.
;;;***
-;;;### (autoloads nil "arc-mode" "arc-mode.el" (21040 17194 398147
-;;;;;; 0))
+;;;### (autoloads nil "arc-mode" "arc-mode.el" (21123 58191 550148
+;;;;;; 88000))
;;; Generated autoloads from arc-mode.el
(autoload 'archive-mode "arc-mode" "\
@@ -1558,8 +1556,8 @@ This is similar to `autoarg-mode' but rebinds the keypad keys
;;;***
-;;;### (autoloads nil "autoconf" "progmodes/autoconf.el" (20874 62962
-;;;;;; 290468 0))
+;;;### (autoloads nil "autoconf" "progmodes/autoconf.el" (21116 51266
+;;;;;; 54795 0))
;;; Generated autoloads from progmodes/autoconf.el
(autoload 'autoconf-mode "autoconf" "\
@@ -2720,8 +2718,8 @@ Like `bug-reference-mode', but only buttonize in comments and strings.
;;;***
-;;;### (autoloads nil "bytecomp" "emacs-lisp/bytecomp.el" (21104
-;;;;;; 56491 538513 0))
+;;;### (autoloads nil "bytecomp" "emacs-lisp/bytecomp.el" (21145
+;;;;;; 51520 109004 0))
;;; Generated autoloads from emacs-lisp/bytecomp.el
(put 'byte-compile-dynamic 'safe-local-variable 'booleanp)
(put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp)
@@ -2878,7 +2876,7 @@ from the cursor position.
;;;***
-;;;### (autoloads nil "calc" "calc/calc.el" (21040 17194 398147 0))
+;;;### (autoloads nil "calc" "calc/calc.el" (21128 42425 434886 0))
;;; Generated autoloads from calc/calc.el
(define-key ctl-x-map "*" 'calc-dispatch)
@@ -3684,8 +3682,8 @@ See the documentation of `define-ccl-program' for the detail of CCL program.
;;;***
-;;;### (autoloads nil "cconv" "emacs-lisp/cconv.el" (21069 17449
-;;;;;; 167398 0))
+;;;### (autoloads nil "cconv" "emacs-lisp/cconv.el" (21120 48308
+;;;;;; 922449 0))
;;; Generated autoloads from emacs-lisp/cconv.el
(autoload 'cconv-closure-convert "cconv" "\
@@ -3711,10 +3709,10 @@ Add the warnings that closure conversion would encounter.
;;;***
-;;;### (autoloads nil "cfengine" "progmodes/cfengine.el" (20958 34345
-;;;;;; 952538 0))
+;;;### (autoloads nil "cfengine" "progmodes/cfengine.el" (21128 42425
+;;;;;; 434886 0))
;;; Generated autoloads from progmodes/cfengine.el
-(push (purecopy '(cfengine 1 2)) package--builtin-versions)
+(push (purecopy '(cfengine 1 3)) package--builtin-versions)
(autoload 'cfengine3-mode "cfengine" "\
Major mode for editing CFEngine3 input.
@@ -4046,8 +4044,8 @@ and runs the normal hook `command-history-hook'.
;;;***
-;;;### (autoloads nil "cl-indent" "emacs-lisp/cl-indent.el" (20879
-;;;;;; 27694 495748 0))
+;;;### (autoloads nil "cl-indent" "emacs-lisp/cl-indent.el" (21112
+;;;;;; 20657 455367 0))
;;; Generated autoloads from emacs-lisp/cl-indent.el
(autoload 'common-lisp-indent-function "cl-indent" "\
@@ -4217,7 +4215,7 @@ If FRAME cannot display COLOR, return nil.
;;;***
-;;;### (autoloads nil "comint" "comint.el" (21104 56491 538513 0))
+;;;### (autoloads nil "comint" "comint.el" (21145 51520 109004 0))
;;; Generated autoloads from comint.el
(defvar comint-output-filter-functions '(ansi-color-process-output comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt) "\
@@ -4350,8 +4348,8 @@ on third call it again advances points to the next difference and so on.
;;;***
-;;;### (autoloads nil "compile" "progmodes/compile.el" (21096 1265
-;;;;;; 644069 0))
+;;;### (autoloads nil "compile" "progmodes/compile.el" (21131 18620
+;;;;;; 480626 0))
;;; Generated autoloads from progmodes/compile.el
(defvar compilation-mode-hook nil "\
@@ -4779,8 +4777,8 @@ If FIX is non-nil, run `copyright-fix-years' instead.
;;;***
-;;;### (autoloads nil "cperl-mode" "progmodes/cperl-mode.el" (21041
-;;;;;; 38058 75002 0))
+;;;### (autoloads nil "cperl-mode" "progmodes/cperl-mode.el" (21111
+;;;;;; 33338 390427 0))
;;; Generated autoloads from progmodes/cperl-mode.el
(put 'cperl-indent-level 'safe-local-variable 'integerp)
(put 'cperl-brace-offset 'safe-local-variable 'integerp)
@@ -5751,8 +5749,8 @@ There is some minimal font-lock support (see vars
;;;***
-;;;### (autoloads nil "debug" "emacs-lisp/debug.el" (21040 17194
-;;;;;; 398147 0))
+;;;### (autoloads nil "debug" "emacs-lisp/debug.el" (21145 51520
+;;;;;; 109004 0))
;;; Generated autoloads from emacs-lisp/debug.el
(setq debugger 'debug)
@@ -6296,8 +6294,8 @@ This requires the external program `diff' to be in your `exec-path'.
;;;***
-;;;### (autoloads nil "diff-mode" "vc/diff-mode.el" (20814 53928
-;;;;;; 50501 0))
+;;;### (autoloads nil "diff-mode" "vc/diff-mode.el" (21136 36544
+;;;;;; 158478 0))
;;; Generated autoloads from vc/diff-mode.el
(autoload 'diff-mode "diff-mode" "\
@@ -6694,7 +6692,7 @@ Locate SOA record and increment the serial field.
;;;***
-;;;### (autoloads nil "doc-view" "doc-view.el" (21061 23341 46416
+;;;### (autoloads nil "doc-view" "doc-view.el" (21144 30651 337793
;;;;;; 0))
;;; Generated autoloads from doc-view.el
@@ -8181,77 +8179,6 @@ Emacs Lisp mode) that support ElDoc.")
;;;***
-;;;### (autoloads nil "electric" "electric.el" (21075 56234 349623
-;;;;;; 0))
-;;; Generated autoloads from electric.el
-
-(defvar electric-indent-chars '(10) "\
-Characters that should cause automatic reindentation.")
-
-(defvar electric-indent-mode nil "\
-Non-nil if Electric-Indent mode is enabled.
-See the command `electric-indent-mode' for a description of this minor mode.
-Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `electric-indent-mode'.")
-
-(custom-autoload 'electric-indent-mode "electric" nil)
-
-(autoload 'electric-indent-mode "electric" "\
-Toggle on-the-fly reindentation (Electric Indent mode).
-With a prefix argument ARG, enable Electric Indent mode if ARG is
-positive, and disable it otherwise. If called from Lisp, enable
-the mode if ARG is omitted or nil.
-
-This is a global minor mode. When enabled, it reindents whenever
-the hook `electric-indent-functions' returns non-nil, or you
-insert a character from `electric-indent-chars'.
-
-\(fn &optional ARG)" t nil)
-
-(defvar electric-pair-mode nil "\
-Non-nil if Electric-Pair mode is enabled.
-See the command `electric-pair-mode' for a description of this minor mode.
-Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `electric-pair-mode'.")
-
-(custom-autoload 'electric-pair-mode "electric" nil)
-
-(autoload 'electric-pair-mode "electric" "\
-Toggle automatic parens pairing (Electric Pair mode).
-With a prefix argument ARG, enable Electric Pair mode if ARG is
-positive, and disable it otherwise. If called from Lisp, enable
-the mode if ARG is omitted or nil.
-
-Electric Pair mode is a global minor mode. When enabled, typing
-an open parenthesis automatically inserts the corresponding
-closing parenthesis. (Likewise for brackets, etc.)
-
-See options `electric-pair-pairs' and `electric-pair-skip-self'.
-
-\(fn &optional ARG)" t nil)
-
-(defvar electric-layout-mode nil "\
-Non-nil if Electric-Layout mode is enabled.
-See the command `electric-layout-mode' for a description of this minor mode.
-Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `electric-layout-mode'.")
-
-(custom-autoload 'electric-layout-mode "electric" nil)
-
-(autoload 'electric-layout-mode "electric" "\
-Automatically insert newlines around some chars.
-With a prefix argument ARG, enable Electric Layout mode if ARG is
-positive, and disable it otherwise. If called from Lisp, enable
-the mode if ARG is omitted or nil.
-The variable `electric-layout-rules' says when and how to insert newlines.
-
-\(fn &optional ARG)" t nil)
-
-;;;***
-
;;;### (autoloads nil "elide-head" "elide-head.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from elide-head.el
@@ -8440,8 +8367,8 @@ Emerge two RCS revisions of a file, with another revision as ancestor.
;;;***
-;;;### (autoloads nil "enriched" "textmodes/enriched.el" (20709 26818
-;;;;;; 907104 0))
+;;;### (autoloads nil "enriched" "textmodes/enriched.el" (21136 36544
+;;;;;; 158478 0))
;;; Generated autoloads from textmodes/enriched.el
(autoload 'enriched-mode "enriched" "\
@@ -8456,7 +8383,7 @@ if ARG is omitted or nil.
Turning the mode on or off runs `enriched-mode-hook'.
More information about Enriched mode is available in the file
-etc/enriched.doc in the Emacs distribution directory.
+\"enriched.txt\" in `data-directory'.
Commands:
@@ -8867,8 +8794,8 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL.
;;;***
-;;;### (autoloads nil "erc-button" "erc/erc-button.el" (21050 53033
-;;;;;; 774595 0))
+;;;### (autoloads nil "erc-button" "erc/erc-button.el" (21139 12727
+;;;;;; 345232 0))
;;; Generated autoloads from erc/erc-button.el
(autoload 'erc-button-mode "erc-button" nil t)
@@ -9196,8 +9123,8 @@ with args, toggle notify status of people.
;;;***
-;;;### (autoloads nil "erc-pcomplete" "erc/erc-pcomplete.el" (20709
-;;;;;; 26818 907104 0))
+;;;### (autoloads nil "erc-pcomplete" "erc/erc-pcomplete.el" (21112
+;;;;;; 20657 455367 0))
;;; Generated autoloads from erc/erc-pcomplete.el
(autoload 'erc-completion-mode "erc-pcomplete" nil t)
@@ -9326,7 +9253,7 @@ Add a file to `erc-xdcc-files'.
;;;***
-;;;### (autoloads nil "ert" "emacs-lisp/ert.el" (21099 38568 469572
+;;;### (autoloads nil "ert" "emacs-lisp/ert.el" (21112 43970 768678
;;;;;; 0))
;;; Generated autoloads from emacs-lisp/ert.el
@@ -10075,7 +10002,7 @@ fourth arg NOSEP non-nil inhibits this.
;;;***
-;;;### (autoloads nil "eww" "net/eww.el" (21086 26537 509049 0))
+;;;### (autoloads nil "eww" "net/eww.el" (21141 54458 609734 0))
;;; Generated autoloads from net/eww.el
(autoload 'eww "eww" "\
@@ -10592,7 +10519,7 @@ the name is considered already unique; only the second substitution
;;;***
-;;;### (autoloads nil "filenotify" "filenotify.el" (20999 25770 522517
+;;;### (autoloads nil "filenotify" "filenotify.el" (21142 14078 948441
;;;;;; 0))
;;; Generated autoloads from filenotify.el
@@ -11601,8 +11528,8 @@ Argument is a character, naming the register.
;;;***
-;;;### (autoloads nil "gdb-mi" "progmodes/gdb-mi.el" (21042 58928
-;;;;;; 39127 0))
+;;;### (autoloads nil "gdb-mi" "progmodes/gdb-mi.el" (21129 63287
+;;;;;; 644820 0))
;;; Generated autoloads from progmodes/gdb-mi.el
(defvar gdb-enable-debug nil "\
@@ -11971,8 +11898,8 @@ CLEAN is obsolete and ignored.
;;;***
-;;;### (autoloads nil "gnus-art" "gnus/gnus-art.el" (21040 17194
-;;;;;; 398147 0))
+;;;### (autoloads nil "gnus-art" "gnus/gnus-art.el" (21141 54458
+;;;;;; 609734 0))
;;; Generated autoloads from gnus/gnus-art.el
(autoload 'gnus-article-prepare-display "gnus-art" "\
@@ -12203,8 +12130,8 @@ Pop up a frame and enter GROUP.
;;;***
-;;;### (autoloads nil "gnus-html" "gnus/gnus-html.el" (21042 58928
-;;;;;; 39127 0))
+;;;### (autoloads nil "gnus-html" "gnus/gnus-html.el" (21141 54458
+;;;;;; 609734 0))
;;; Generated autoloads from gnus/gnus-html.el
(autoload 'gnus-article-html "gnus-html" "\
@@ -12616,7 +12543,7 @@ A value of nil says to use the default GnuTLS value.")
;;;***
-;;;### (autoloads nil "gomoku" "play/gomoku.el" (20992 52525 458637
+;;;### (autoloads nil "gomoku" "play/gomoku.el" (21139 62016 336404
;;;;;; 0))
;;; Generated autoloads from play/gomoku.el
@@ -12879,7 +12806,7 @@ the form \"WINDOW-ID PIXMAP-ID\". Value is non-nil if successful.
;;;***
-;;;### (autoloads nil "gud" "progmodes/gud.el" (21049 14338 391345
+;;;### (autoloads nil "gud" "progmodes/gud.el" (21126 691 872266
;;;;;; 0))
;;; Generated autoloads from progmodes/gud.el
@@ -12968,8 +12895,7 @@ it if ARG is omitted or nil.
;;;***
-;;;### (autoloads nil "gv" "emacs-lisp/gv.el" (21031 51082 798722
-;;;;;; 0))
+;;;### (autoloads nil "gv" "emacs-lisp/gv.el" (21114 9531 52922 0))
;;; Generated autoloads from emacs-lisp/gv.el
(autoload 'gv-get "gv" "\
@@ -14243,8 +14169,8 @@ Convert HTML to plain text in the current buffer.
;;;***
-;;;### (autoloads nil "htmlfontify" "htmlfontify.el" (21105 28578
-;;;;;; 135432 0))
+;;;### (autoloads nil "htmlfontify" "htmlfontify.el" (21124 45614
+;;;;;; 800155 912000))
;;; Generated autoloads from htmlfontify.el
(push (purecopy '(htmlfontify 0 21)) package--builtin-versions)
@@ -15408,7 +15334,7 @@ on these modes.
;;;***
-;;;### (autoloads nil "imenu" "imenu.el" (20784 36406 653593 0))
+;;;### (autoloads nil "imenu" "imenu.el" (21145 51520 109004 0))
;;; Generated autoloads from imenu.el
(defvar imenu-sort-function nil "\
@@ -16133,8 +16059,8 @@ Add submenus to the File menu, to convert to and from various formats.
;;;***
-;;;### (autoloads nil "ispell" "textmodes/ispell.el" (21062 44200
-;;;;;; 584479 0))
+;;;### (autoloads nil "ispell" "textmodes/ispell.el" (21118 6587
+;;;;;; 141205 0))
;;; Generated autoloads from textmodes/ispell.el
(put 'ispell-check-comments 'safe-local-variable (lambda (a) (memq a '(nil t exclusive))))
@@ -16367,7 +16293,7 @@ You can bind this to the key C-c i in GNUS or mail by adding to
;;;***
-;;;### (autoloads nil "iswitchb" "iswitchb.el" (20824 3367 300658
+;;;### (autoloads nil "iswitchb" "iswitchb.el" (21120 48308 922449
;;;;;; 0))
;;; Generated autoloads from iswitchb.el
@@ -16495,7 +16421,8 @@ by `jka-compr-installed'.
;;;***
-;;;### (autoloads nil "js" "progmodes/js.el" (20998 4934 952905 0))
+;;;### (autoloads nil "js" "progmodes/js.el" (21139 12727 345232
+;;;;;; 0))
;;; Generated autoloads from progmodes/js.el
(push (purecopy '(js 9)) package--builtin-versions)
@@ -16507,7 +16434,7 @@ Major mode for editing JavaScript.
;;;***
-;;;### (autoloads nil "json" "json.el" (20998 4934 952905 0))
+;;;### (autoloads nil "json" "json.el" (21139 12727 345232 0))
;;; Generated autoloads from json.el
(push (purecopy '(json 1 4)) package--builtin-versions)
@@ -16944,7 +16871,7 @@ See `linum-mode' for more information on Linum mode.
;;;***
-;;;### (autoloads nil "loadhist" "loadhist.el" (20709 26818 907104
+;;;### (autoloads nil "loadhist" "loadhist.el" (21126 691 872266
;;;;;; 0))
;;; Generated autoloads from loadhist.el
@@ -17028,7 +16955,7 @@ except that FILTER is not optional.
;;;***
-;;;### (autoloads nil "log-edit" "vc/log-edit.el" (20721 17977 14204
+;;;### (autoloads nil "log-edit" "vc/log-edit.el" (21147 6837 926168
;;;;;; 0))
;;; Generated autoloads from vc/log-edit.el
@@ -17675,7 +17602,7 @@ Previous contents of that buffer are killed first.
;;;***
-;;;### (autoloads nil "man" "man.el" (21100 59431 520894 0))
+;;;### (autoloads nil "man" "man.el" (21116 51266 54795 0))
;;; Generated autoloads from man.el
(defalias 'manual-entry 'man)
@@ -17786,7 +17713,7 @@ recursion depth in the minibuffer prompt. This is only useful if
;;;***
-;;;### (autoloads nil "message" "gnus/message.el" (21048 11307 937592
+;;;### (autoloads nil "message" "gnus/message.el" (21132 39477 543900
;;;;;; 0))
;;; Generated autoloads from gnus/message.el
@@ -19206,8 +19133,8 @@ Start newsticker plainview.
;;;***
-;;;### (autoloads nil "newst-reader" "net/newst-reader.el" (20709
-;;;;;; 26818 907104 0))
+;;;### (autoloads nil "newst-reader" "net/newst-reader.el" (21145
+;;;;;; 51520 109004 0))
;;; Generated autoloads from net/newst-reader.el
(autoload 'newsticker-show-news "newst-reader" "\
@@ -19267,7 +19194,7 @@ Generate NOV databases in all nndiary directories.
;;;***
-;;;### (autoloads nil "nndoc" "gnus/nndoc.el" (20709 26818 907104
+;;;### (autoloads nil "nndoc" "gnus/nndoc.el" (21135 15680 63905
;;;;;; 0))
;;; Generated autoloads from gnus/nndoc.el
@@ -19452,8 +19379,8 @@ the variable `nxml-enabled-unicode-blocks'.
;;;***
-;;;### (autoloads nil "octave" "progmodes/octave.el" (21098 17703
-;;;;;; 588969 0))
+;;;### (autoloads nil "octave" "progmodes/octave.el" (21135 48053
+;;;;;; 151871 0))
;;; Generated autoloads from progmodes/octave.el
(autoload 'octave-mode "octave" "\
@@ -19527,7 +19454,7 @@ with no args, if that value is non-nil.
;;;***
-;;;### (autoloads nil "org" "org/org.el" (20783 15545 430927 0))
+;;;### (autoloads nil "org" "org/org.el" (21128 42425 434886 0))
;;; Generated autoloads from org/org.el
(autoload 'org-babel-do-load-languages "org" "\
@@ -19535,6 +19462,15 @@ Load the languages defined in `org-babel-load-languages'.
\(fn SYM VALUE)" nil nil)
+(autoload 'org-babel-load-file "org" "\
+Load Emacs Lisp source code blocks in the Org-mode FILE.
+This function exports the source code using `org-babel-tangle'
+and then loads the resulting file using `load-file'. With prefix
+arg (noninteractively: 2nd arg) COMPILE the tangled Emacs Lisp
+file to byte-code before it is loaded.
+
+\(fn FILE &optional COMPILE)" t nil)
+
(autoload 'org-version "org" "\
Show the org-mode version in the echo area.
With prefix argument HERE, insert it at point.
@@ -19630,6 +19566,7 @@ With \\[universal-argument] prefix arg, switch to startup visibility.
With a numeric prefix, show all headlines up to that level.
\(fn &optional ARG)" t nil)
+(put 'orgstruct-heading-prefix-regexp 'safe-local-variable 'stringp)
(autoload 'orgstruct-mode "org" "\
Toggle the minor mode `orgstruct-mode'.
@@ -19638,22 +19575,6 @@ modes. The following keys behave as if Org-mode were active, if
the cursor is on a headline, or on a plain list item (both as
defined by Org-mode).
-M-up Move entry/item up
-M-down Move entry/item down
-M-left Promote
-M-right Demote
-M-S-up Move entry/item up
-M-S-down Move entry/item down
-M-S-left Promote subtree
-M-S-right Demote subtree
-M-q Fill paragraph and items like in Org-mode
-C-c ^ Sort entries
-C-c - Cycle list bullet
-TAB Cycle item visibility
-M-RET Insert new heading/item
-S-M-RET Insert new TODO heading / Checkbox item
-C-c C-c Set tags / toggle checkbox
-
\(fn &optional ARG)" t nil)
(autoload 'turn-on-orgstruct "org" "\
@@ -19679,10 +19600,16 @@ call CMD.
This link is added to `org-stored-links' and can later be inserted
into an org-buffer with \\[org-insert-link].
-For some link types, a prefix arg is interpreted:
-For links to usenet articles, arg negates `org-gnus-prefer-web-links'.
+For some link types, a prefix arg is interpreted.
+For links to Usenet articles, arg negates `org-gnus-prefer-web-links'.
For file links, arg negates `org-context-in-file-links'.
+A double prefix arg force skipping storing functions that are not
+part of Org's core.
+
+A triple prefix arg force storing a link for each line in the
+active region.
+
\(fn ARG)" t nil)
(autoload 'org-insert-link-global "org" "\
@@ -19748,8 +19675,8 @@ Call the customize function with org as argument.
;;;***
-;;;### (autoloads nil "org-agenda" "org/org-agenda.el" (20847 51240
-;;;;;; 240216 0))
+;;;### (autoloads nil "org-agenda" "org/org-agenda.el" (21128 42425
+;;;;;; 434886 0))
;;; Generated autoloads from org/org-agenda.el
(autoload 'org-toggle-sticky-agenda "org-agenda" "\
@@ -19842,7 +19769,7 @@ agenda-day The day in the agenda where this is listed
\(fn CMD-KEY &rest PARAMETERS)" nil t)
(autoload 'org-store-agenda-views "org-agenda" "\
-
+Store agenda views.
\(fn &rest PARAMETERS)" t nil)
@@ -19863,7 +19790,10 @@ the number of days. SPAN defaults to `org-agenda-span'.
START-DAY defaults to TODAY, or to the most recent match for the weekday
given in `org-agenda-start-on-weekday'.
-\(fn &optional ARG START-DAY SPAN)" t nil)
+When WITH-HOUR is non-nil, only include scheduled and deadline
+items if they have an hour specification like [h]h:mm.
+
+\(fn &optional ARG START-DAY SPAN WITH-HOUR)" t nil)
(autoload 'org-search-view "org-agenda" "\
Show all entries that contain a phrase or words or regular expressions.
@@ -19951,8 +19881,8 @@ all files listed in `org-agenda-files' will be checked automatically:
&%%(org-diary)
-If you don't give any arguments (as in the example above), the default
-arguments (:deadline :scheduled :timestamp :sexp) are used.
+If you don't give any arguments (as in the example above), the default value
+of `org-agenda-entry-types' is used: (:deadline :scheduled :timestamp :sexp).
So the example above may also be written as
&%%(org-diary :deadline :timestamp :sexp :scheduled)
@@ -19963,6 +19893,14 @@ function from a program - use `org-agenda-get-day-entries' instead.
\(fn &rest ARGS)" nil nil)
+(autoload 'org-agenda-set-restriction-lock "org-agenda" "\
+Set restriction lock for agenda, to current subtree or file.
+Restriction will be the file if TYPE is `file', or if type is the
+universal prefix '(4), or if the cursor is before the first headline
+in the file. Otherwise, restriction will be to the current subtree.
+
+\(fn &optional TYPE)" t nil)
+
(autoload 'org-calendar-goto-agenda "org-agenda" "\
Compute the Org-mode agenda for the calendar date displayed at the cursor.
This is a command that has to be installed in `calendar-mode-map'.
@@ -19994,7 +19932,8 @@ will only add headlines containing IMPORTANT or headlines
belonging to the \"Work\" category.
ARGS are symbols indicating what kind of entries to consider.
-By default `org-agenda-to-appt' will use :deadline, :scheduled
+By default `org-agenda-to-appt' will use :deadline*, :scheduled*
+\(i.e., deadlines and scheduled items with a hh:mm specification)
and :timestamp entries. See the docstring of `org-diary' for
details and examples.
@@ -20005,34 +19944,12 @@ to override `appt-message-warning-time'.
;;;***
-;;;### (autoloads nil "org-beamer" "org/org-beamer.el" (20709 26818
-;;;;;; 907104 0))
-;;; Generated autoloads from org/org-beamer.el
-
-(autoload 'org-beamer-sectioning "org-beamer" "\
-Return the sectioning entry for the current headline.
-LEVEL is the reduced level of the headline.
-TEXT is the text of the headline, everything except the leading stars.
-The return value is a cons cell. The car is the headline text, usually
-just TEXT, but possibly modified if options have been extracted from the
-text. The cdr is the sectioning entry, similar to what is given
-in org-export-latex-classes.
-
-\(fn LEVEL TEXT)" nil nil)
-
-(autoload 'org-beamer-mode "org-beamer" "\
-Special support for editing Org-mode files made to export to beamer.
-
-\(fn &optional ARG)" t nil)
-
-;;;***
-
-;;;### (autoloads nil "org-capture" "org/org-capture.el" (20723 59703
-;;;;;; 12265 0))
+;;;### (autoloads nil "org-capture" "org/org-capture.el" (21123 24503
+;;;;;; 570934 0))
;;; Generated autoloads from org/org-capture.el
(autoload 'org-capture-string "org-capture" "\
-
+Capture STRING with the template selected by KEYS.
\(fn STRING &optional KEYS)" t nil)
@@ -20052,24 +19969,26 @@ stored.
When called with a `C-0' (zero) prefix, insert a template at point.
-Lisp programs can set KEYS to a string associated with a template
+ELisp programs can set KEYS to a string associated with a template
in `org-capture-templates'. In this case, interactive selection
will be bypassed.
If `org-capture-use-agenda-date' is non-nil, capturing from the
-agenda will use the date at point as the default date.
+agenda will use the date at point as the default date. Then, a
+`C-1' prefix will tell the capture process to use the HH:MM time
+of the day at point (if any) or the current HH:MM time.
\(fn &optional GOTO KEYS)" t nil)
(autoload 'org-capture-import-remember-templates "org-capture" "\
-Set org-capture-templates to be similar to `org-remember-templates'.
+Set `org-capture-templates' to be similar to `org-remember-templates'.
\(fn)" t nil)
;;;***
-;;;### (autoloads nil "org-colview" "org/org-colview.el" (20717 20920
-;;;;;; 410005 0))
+;;;### (autoloads nil "org-colview" "org/org-colview.el" (21123 24503
+;;;;;; 570934 0))
;;; Generated autoloads from org/org-colview.el
(autoload 'org-columns "org-colview" "\
@@ -20112,8 +20031,8 @@ Turn on or update column view in the agenda.
;;;***
-;;;### (autoloads nil "org-compat" "org/org-compat.el" (20723 59703
-;;;;;; 12265 0))
+;;;### (autoloads nil "org-compat" "org/org-compat.el" (21123 24503
+;;;;;; 570934 0))
;;; Generated autoloads from org/org-compat.el
(autoload 'org-check-version "org-compat" "\
@@ -20123,8 +20042,19 @@ Try very hard to provide sensible version strings.
;;;***
-;;;### (autoloads nil "org-version" "org/org-version.el" (20783 15545
-;;;;;; 430927 0))
+;;;### (autoloads nil "org-macs" "org/org-macs.el" (21123 24503 570934
+;;;;;; 0))
+;;; Generated autoloads from org/org-macs.el
+
+(autoload 'org-load-noerror-mustsuffix "org-macs" "\
+Load FILE with optional arguments NOERROR and MUSTSUFFIX. Drop the MUSTSUFFIX argument for XEmacs, which doesn't recognize it.
+
+\(fn FILE)" nil t)
+
+;;;***
+
+;;;### (autoloads nil "org-version" "org/org-version.el" (21123 24503
+;;;;;; 570934 0))
;;; Generated autoloads from org/org-version.el
(autoload 'org-release "org-version" "\
@@ -20206,8 +20136,8 @@ See the command `outline-mode' for more information on this mode.
;;;***
-;;;### (autoloads nil "package" "emacs-lisp/package.el" (21104 56491
-;;;;;; 538513 0))
+;;;### (autoloads nil "package" "emacs-lisp/package.el" (21133 20713
+;;;;;; 577800 0))
;;; Generated autoloads from emacs-lisp/package.el
(push (purecopy '(package 1 0 1)) package--builtin-versions)
@@ -20583,8 +20513,7 @@ Includes files as well as host names followed by a colon.
;;;***
-;;;### (autoloads nil "pcmpl-x" "pcmpl-x.el" (20837 15398 184639
-;;;;;; 0))
+;;;### (autoloads nil "pcmpl-x" "pcmpl-x.el" (21135 15680 63905 0))
;;; Generated autoloads from pcmpl-x.el
(autoload 'pcomplete/tlmgr "pcmpl-x" "\
@@ -20601,6 +20530,11 @@ long options.
(defalias 'pcomplete/ack-grep 'pcomplete/ack)
+(autoload 'pcomplete/ag "pcmpl-x" "\
+Completion for the `ag' command.
+
+\(fn)" nil nil)
+
;;;***
;;;### (autoloads nil "pcomplete" "pcomplete.el" (20709 26818 907104
@@ -21629,8 +21563,8 @@ Open profile FILENAME.
;;;***
-;;;### (autoloads nil "prolog" "progmodes/prolog.el" (21099 38568
-;;;;;; 469572 0))
+;;;### (autoloads nil "prolog" "progmodes/prolog.el" (21112 54200
+;;;;;; 857404 0))
;;; Generated autoloads from progmodes/prolog.el
(autoload 'prolog-mode "prolog" "\
@@ -21646,8 +21580,6 @@ To find out what version of Prolog mode you are running, enter
Commands:
\\{prolog-mode-map}
-Entry to this mode calls the value of `prolog-mode-hook'
-if that value is non-nil.
\(fn)" t nil)
@@ -21724,7 +21656,7 @@ Typing \\<ps-run-mode-map>\\[ps-run-goto-error] when the cursor is at the number
;;;***
-;;;### (autoloads nil "ps-print" "ps-print.el" (21105 26139 752484
+;;;### (autoloads nil "ps-print" "ps-print.el" (21122 3638 533479
;;;;;; 0))
;;; Generated autoloads from ps-print.el
(push (purecopy '(ps-print 7 3 5)) package--builtin-versions)
@@ -21929,8 +21861,8 @@ If EXTENSION is any other symbol, it is ignored.
;;;***
-;;;### (autoloads nil "python" "progmodes/python.el" (21104 56491
-;;;;;; 538513 0))
+;;;### (autoloads nil "python" "progmodes/python.el" (21144 30651
+;;;;;; 337793 0))
;;; Generated autoloads from progmodes/python.el
(push (purecopy '(python 0 24 2)) package--builtin-versions)
@@ -21959,8 +21891,6 @@ process buffer for a list of commands.)
Major mode for editing Python files.
\\{python-mode-map}
-Entry to this mode calls the value of `python-mode-hook'
-if that value is non-nil.
\(fn)" t nil)
@@ -21985,8 +21915,8 @@ them into characters should be done separately.
;;;***
-;;;### (autoloads nil "quail" "international/quail.el" (21061 23341
-;;;;;; 46416 0))
+;;;### (autoloads nil "quail" "international/quail.el" (21113 26590
+;;;;;; 654875 0))
;;; Generated autoloads from international/quail.el
(autoload 'quail-title "quail" "\
@@ -22215,6 +22145,34 @@ of each directory.
;;;***
+;;;### (autoloads nil "quail/hangul" "leim/quail/hangul.el" (21141
+;;;;;; 54458 609734 0))
+;;; Generated autoloads from leim/quail/hangul.el
+
+(autoload 'hangul-input-method-activate "quail/hangul" "\
+Activate Hangul input method INPUT-METHOD.
+FUNC is a function to handle input key.
+HELP-TEXT is a text set in `hangul-input-method-help-text'.
+
+\(fn INPUT-METHOD FUNC HELP-TEXT &rest ARGS)" nil nil)
+
+;;;***
+
+;;;### (autoloads nil "quail/uni-input" "leim/quail/uni-input.el"
+;;;;;; (21141 54458 609734 0))
+;;; Generated autoloads from leim/quail/uni-input.el
+
+(autoload 'ucs-input-activate "quail/uni-input" "\
+Activate UCS input method.
+With ARG, activate UCS input method if and only if ARG is positive.
+
+While this input method is active, the variable
+`input-method-function' is bound to the function `ucs-input-method'.
+
+\(fn &optional ARG)" nil nil)
+
+;;;***
+
;;;### (autoloads nil "quickurl" "net/quickurl.el" (21040 17194 398147
;;;;;; 0))
;;; Generated autoloads from net/quickurl.el
@@ -22287,7 +22245,7 @@ Display `quickurl-list' as a formatted list using `quickurl-list-mode'.
;;;***
-;;;### (autoloads nil "rcirc" "net/rcirc.el" (20992 52525 458637
+;;;### (autoloads nil "rcirc" "net/rcirc.el" (21113 26590 654875
;;;;;; 0))
;;; Generated autoloads from net/rcirc.el
@@ -22326,18 +22284,6 @@ if ARG is omitted or nil.
;;;***
-;;;### (autoloads nil "rcompile" "net/rcompile.el" (20709 26818 907104
-;;;;;; 0))
-;;; Generated autoloads from net/rcompile.el
-
-(autoload 'remote-compile "rcompile" "\
-Compile the current buffer's directory on HOST. Log in as USER.
-See \\[compile].
-
-\(fn HOST USER COMMAND)" t nil)
-
-;;;***
-
;;;### (autoloads nil "re-builder" "emacs-lisp/re-builder.el" (20984
;;;;;; 58408 354075 0))
;;; Generated autoloads from emacs-lisp/re-builder.el
@@ -22384,7 +22330,7 @@ were operated on recently.
;;;***
-;;;### (autoloads nil "rect" "rect.el" (21104 56491 538513 0))
+;;;### (autoloads nil "rect" "rect.el" (21120 48308 922449 0))
;;; Generated autoloads from rect.el
(autoload 'delete-rectangle "rect" "\
@@ -22516,10 +22462,11 @@ with a prefix argument, prompt for START-AT and FORMAT.
\(fn START END START-AT &optional FORMAT)" t nil)
-(autoload 'rectangle-mark "rect" "\
+(autoload 'rectangle-mark-mode "rect" "\
Toggle the region as rectangular.
+Activates the region if needed. Only lasts until the region is deactivated.
-\(fn)" t nil)
+\(fn &optional ARG)" t nil)
;;;***
@@ -22675,7 +22622,7 @@ Here are all local bindings.
;;;***
;;;### (autoloads nil "reftex-parse" "textmodes/reftex-parse.el"
-;;;;;; (20921 39978 248467 0))
+;;;;;; (21107 58096 588457 0))
;;; Generated autoloads from textmodes/reftex-parse.el
(autoload 'reftex-all-document-files "reftex-parse" "\
@@ -23419,18 +23366,13 @@ for modes derived from Text mode, like Mail mode.
;;;***
-;;;### (autoloads nil "ruby-mode" "progmodes/ruby-mode.el" (21107
-;;;;;; 32686 465643 0))
+;;;### (autoloads nil "ruby-mode" "progmodes/ruby-mode.el" (21135
+;;;;;; 48053 151871 0))
;;; Generated autoloads from progmodes/ruby-mode.el
(push (purecopy '(ruby-mode 1 2)) package--builtin-versions)
(autoload 'ruby-mode "ruby-mode" "\
-Major mode for editing Ruby scripts.
-\\[ruby-indent-line] properly indents subexpressions of multi-line
-class, module, def, if, while, for, do, and case statements, taking
-nesting into account.
-
-The variable `ruby-indent-level' controls the amount of indentation.
+Major mode for editing Ruby code.
\\{ruby-mode-map}
@@ -23813,8 +23755,8 @@ histories, which is probably undesirable.
;;;***
-;;;### (autoloads nil "scheme" "progmodes/scheme.el" (20924 16196
-;;;;;; 967284 0))
+;;;### (autoloads nil "scheme" "progmodes/scheme.el" (21112 54200
+;;;;;; 857404 0))
;;; Generated autoloads from progmodes/scheme.el
(autoload 'scheme-mode "scheme" "\
@@ -23834,8 +23776,6 @@ Commands:
Delete converts tabs to spaces as it moves back.
Blank lines separate paragraphs. Semicolons start comments.
\\{scheme-mode-map}
-Entry to this mode calls the value of `scheme-mode-hook'
-if that value is non-nil.
\(fn)" t nil)
@@ -23979,7 +23919,7 @@ Semantic mode.
;;;***
;;;### (autoloads nil "semantic/bovine/grammar" "cedet/semantic/bovine/grammar.el"
-;;;;;; (20895 15912 444844 0))
+;;;;;; (21145 51520 109004 0))
;;; Generated autoloads from cedet/semantic/bovine/grammar.el
(autoload 'bovine-grammar-mode "semantic/bovine/grammar" "\
@@ -23990,7 +23930,7 @@ Major mode for editing Bovine grammars.
;;;***
;;;### (autoloads nil "semantic/wisent/grammar" "cedet/semantic/wisent/grammar.el"
-;;;;;; (20879 27694 495748 0))
+;;;;;; (21145 51520 109004 0))
;;; Generated autoloads from cedet/semantic/wisent/grammar.el
(autoload 'wisent-grammar-mode "semantic/wisent/grammar" "\
@@ -24349,18 +24289,44 @@ only these files will be asked to be saved.
;;;***
-;;;### (autoloads nil "ses" "ses.el" (20999 25770 522517 0))
+;;;### (autoloads nil "ses" "ses.el" (21132 39477 543900 0))
;;; Generated autoloads from ses.el
(autoload 'ses-mode "ses" "\
Major mode for Simple Emacs Spreadsheet.
-See \"ses-example.ses\" (in `data-directory') for more info.
-Key definitions:
+When you invoke SES in a new buffer, it is divided into cells
+that you can enter data into. You can navigate the cells with
+the arrow keys and add more cells with the tab key. The contents
+of these cells can be numbers, text, or Lisp expressions. (To
+enter text, enclose it in double quotes.)
+
+In an expression, you can use cell coordinates to refer to the
+contents of another cell. For example, you can sum a range of
+cells with `(+ A1 A2 A3)'. There are specialized functions like
+`ses+' (addition for ranges with empty cells), `ses-average' (for
+performing calculations on cells), and `ses-range' and `ses-select'
+\(for extracting ranges of cells).
+
+Each cell also has a print function that controls how it is
+displayed.
+
+Each SES buffer is divided into a print area and a data area.
+Normally, you can simply use SES to look at and manipulate the print
+area, and let SES manage the data area outside the visible region.
+
+See \"ses-example.ses\" (in `data-directory') for an example
+spreadsheet, and the Info node `(ses)Top.'
+
+In the following, note the separate keymaps for cell editing mode
+and print mode specifications. Key definitions:
+
\\{ses-mode-map}
-These key definitions are active only in the print area (the visible part):
+These key definitions are active only in the print area (the visible
+part):
\\{ses-mode-print-map}
-These are active only in the minibuffer, when entering or editing a formula:
+These are active only in the minibuffer, when entering or editing a
+formula:
\\{ses-mode-edit-map}
\(fn)" t nil)
@@ -24433,8 +24399,8 @@ To work around that, do:
;;;***
-;;;### (autoloads nil "sh-script" "progmodes/sh-script.el" (21097
-;;;;;; 42046 44658 0))
+;;;### (autoloads nil "sh-script" "progmodes/sh-script.el" (21118
+;;;;;; 6587 141205 0))
;;; Generated autoloads from progmodes/sh-script.el
(push (purecopy '(sh-script 2 0 6)) package--builtin-versions)
(put 'sh-shell 'safe-local-variable 'symbolp)
@@ -24850,8 +24816,8 @@ symmetrical ones, and the same character twice for the others.
;;;***
-;;;### (autoloads nil "smerge-mode" "vc/smerge-mode.el" (21022 27213
-;;;;;; 317995 0))
+;;;### (autoloads nil "smerge-mode" "vc/smerge-mode.el" (21139 62016
+;;;;;; 336404 0))
;;; Generated autoloads from vc/smerge-mode.el
(autoload 'smerge-ediff "smerge-mode" "\
@@ -26947,8 +26913,8 @@ tetris-mode keybindings:
;;;***
-;;;### (autoloads nil "tex-mode" "textmodes/tex-mode.el" (20774 53405
-;;;;;; 754743 8000))
+;;;### (autoloads nil "tex-mode" "textmodes/tex-mode.el" (21136 36544
+;;;;;; 158478 0))
;;; Generated autoloads from textmodes/tex-mode.el
(defvar tex-shell-file-name nil "\
@@ -27402,7 +27368,7 @@ Compose Thai characters in the current buffer.
;;;***
-;;;### (autoloads nil "thingatpt" "thingatpt.el" (20999 25770 522517
+;;;### (autoloads nil "thingatpt" "thingatpt.el" (21114 9531 52922
;;;;;; 0))
;;; Generated autoloads from thingatpt.el
@@ -27600,7 +27566,7 @@ This function performs no refilling of the changed text.
;;;***
-;;;### (autoloads nil "time" "time.el" (20998 4934 952905 0))
+;;;### (autoloads nil "time" "time.el" (21145 51520 109004 0))
;;; Generated autoloads from time.el
(defvar display-time-day-and-date nil "\
@@ -27926,7 +27892,7 @@ relative only to the time worked today, and not to past time.
;;;***
;;;### (autoloads nil "titdic-cnv" "international/titdic-cnv.el"
-;;;;;; (20929 34089 117790 0))
+;;;;;; (21145 51520 109004 0))
;;; Generated autoloads from international/titdic-cnv.el
(autoload 'titdic-convert "titdic-cnv" "\
@@ -28227,7 +28193,7 @@ changing the window configuration.
;;;***
-;;;### (autoloads nil "tramp" "net/tramp.el" (21103 35626 321341
+;;;### (autoloads nil "tramp" "net/tramp.el" (21141 54458 609734
;;;;;; 0))
;;; Generated autoloads from net/tramp.el
@@ -28247,7 +28213,7 @@ It can have the following values:
(custom-autoload 'tramp-syntax "tramp" t)
-(defconst tramp-file-name-regexp-unified (if (memq system-type '(cygwin windows-nt)) "\\`/\\([^[/|:]\\{2,\\}\\|[^/|]\\{2,\\}]\\):" "\\`/\\([^[/|:]+\\|[^/|]+]\\):") "\
+(defconst tramp-file-name-regexp-unified (if (memq system-type '(cygwin windows-nt)) "\\`/\\(\\[.*\\]\\|[^/|:]\\{2,\\}[^/|]*\\):" "\\`/[^/|:][^/|]*:") "\
Value for `tramp-file-name-regexp' for unified remoting.
Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and
Tramp. See `tramp-file-name-structure' for more explanations.
@@ -29435,7 +29401,7 @@ If FILE-NAME is non-nil, save the result to FILE-NAME.
;;;***
-;;;### (autoloads nil "vc" "vc/vc.el" (21098 17703 588969 0))
+;;;### (autoloads nil "vc" "vc/vc.el" (21141 54458 609734 0))
;;; Generated autoloads from vc/vc.el
(defvar vc-checkout-hook nil "\
@@ -29819,8 +29785,8 @@ These are the commands available for use in the file status buffer:
;;;***
-;;;### (autoloads nil "vc-dispatcher" "vc/vc-dispatcher.el" (21041
-;;;;;; 38058 75002 0))
+;;;### (autoloads nil "vc-dispatcher" "vc/vc-dispatcher.el" (21143
+;;;;;; 9782 474230 0))
;;; Generated autoloads from vc/vc-dispatcher.el
(autoload 'vc-do-command "vc-dispatcher" "\
@@ -29843,7 +29809,7 @@ case, and the process object in the asynchronous case.
;;;***
-;;;### (autoloads nil "vc-git" "vc/vc-git.el" (21067 62128 15681
+;;;### (autoloads nil "vc-git" "vc/vc-git.el" (21139 12727 345232
;;;;;; 0))
;;; Generated autoloads from vc/vc-git.el
(defun vc-git-registered (file)
@@ -29883,7 +29849,7 @@ Name of the monotone directory's format file.")
;;;***
-;;;### (autoloads nil "vc-rcs" "vc/vc-rcs.el" (21071 59176 747909
+;;;### (autoloads nil "vc-rcs" "vc/vc-rcs.el" (21113 26590 654875
;;;;;; 0))
;;; Generated autoloads from vc/vc-rcs.el
@@ -29990,7 +29956,7 @@ Key bindings:
;;;***
;;;### (autoloads nil "verilog-mode" "progmodes/verilog-mode.el"
-;;;;;; (21091 44456 774347 0))
+;;;;;; (21124 45367 88860 0))
;;; Generated autoloads from progmodes/verilog-mode.el
(autoload 'verilog-mode "verilog-mode" "\
@@ -31983,45 +31949,42 @@ Zone out, completely.
;;;;;; "calc/calc-fin.el" "calc/calc-forms.el" "calc/calc-frac.el"
;;;;;; "calc/calc-funcs.el" "calc/calc-graph.el" "calc/calc-help.el"
;;;;;; "calc/calc-incom.el" "calc/calc-keypd.el" "calc/calc-lang.el"
-;;;;;; "calc/calc-loaddefs.el" "calc/calc-macs.el" "calc/calc-map.el"
-;;;;;; "calc/calc-math.el" "calc/calc-menu.el" "calc/calc-misc.el"
-;;;;;; "calc/calc-mode.el" "calc/calc-mtx.el" "calc/calc-nlfit.el"
-;;;;;; "calc/calc-poly.el" "calc/calc-prog.el" "calc/calc-rewr.el"
-;;;;;; "calc/calc-rules.el" "calc/calc-sel.el" "calc/calc-stat.el"
-;;;;;; "calc/calc-store.el" "calc/calc-stuff.el" "calc/calc-trail.el"
-;;;;;; "calc/calc-units.el" "calc/calc-vec.el" "calc/calc-yank.el"
-;;;;;; "calc/calcalg2.el" "calc/calcalg3.el" "calc/calccomp.el"
-;;;;;; "calc/calcsel2.el" "calendar/cal-bahai.el" "calendar/cal-coptic.el"
-;;;;;; "calendar/cal-french.el" "calendar/cal-html.el" "calendar/cal-islam.el"
-;;;;;; "calendar/cal-iso.el" "calendar/cal-julian.el" "calendar/cal-loaddefs.el"
-;;;;;; "calendar/cal-mayan.el" "calendar/cal-menu.el" "calendar/cal-move.el"
-;;;;;; "calendar/cal-persia.el" "calendar/cal-tex.el" "calendar/cal-x.el"
-;;;;;; "calendar/diary-loaddefs.el" "calendar/hol-loaddefs.el" "cdl.el"
-;;;;;; "cedet/cedet-cscope.el" "cedet/cedet-files.el" "cedet/cedet-global.el"
-;;;;;; "cedet/cedet-idutils.el" "cedet/ede/auto.el" "cedet/ede/autoconf-edit.el"
-;;;;;; "cedet/ede/base.el" "cedet/ede/cpp-root.el" "cedet/ede/custom.el"
-;;;;;; "cedet/ede/emacs.el" "cedet/ede/files.el" "cedet/ede/generic.el"
-;;;;;; "cedet/ede/linux.el" "cedet/ede/loaddefs.el" "cedet/ede/locate.el"
-;;;;;; "cedet/ede/make.el" "cedet/ede/makefile-edit.el" "cedet/ede/pconf.el"
-;;;;;; "cedet/ede/pmake.el" "cedet/ede/proj-archive.el" "cedet/ede/proj-aux.el"
-;;;;;; "cedet/ede/proj-comp.el" "cedet/ede/proj-elisp.el" "cedet/ede/proj-info.el"
-;;;;;; "cedet/ede/proj-misc.el" "cedet/ede/proj-obj.el" "cedet/ede/proj-prog.el"
-;;;;;; "cedet/ede/proj-scheme.el" "cedet/ede/proj-shared.el" "cedet/ede/proj.el"
-;;;;;; "cedet/ede/shell.el" "cedet/ede/simple.el" "cedet/ede/source.el"
-;;;;;; "cedet/ede/speedbar.el" "cedet/ede/srecode.el" "cedet/ede/system.el"
-;;;;;; "cedet/ede/util.el" "cedet/semantic/analyze.el" "cedet/semantic/analyze/complete.el"
-;;;;;; "cedet/semantic/analyze/debug.el" "cedet/semantic/analyze/fcn.el"
-;;;;;; "cedet/semantic/analyze/refs.el" "cedet/semantic/bovine.el"
-;;;;;; "cedet/semantic/bovine/c-by.el" "cedet/semantic/bovine/c.el"
-;;;;;; "cedet/semantic/bovine/debug.el" "cedet/semantic/bovine/el.el"
-;;;;;; "cedet/semantic/bovine/gcc.el" "cedet/semantic/bovine/make-by.el"
-;;;;;; "cedet/semantic/bovine/make.el" "cedet/semantic/bovine/scm-by.el"
-;;;;;; "cedet/semantic/bovine/scm.el" "cedet/semantic/chart.el"
-;;;;;; "cedet/semantic/complete.el" "cedet/semantic/ctxt.el" "cedet/semantic/db-debug.el"
-;;;;;; "cedet/semantic/db-ebrowse.el" "cedet/semantic/db-el.el"
-;;;;;; "cedet/semantic/db-file.el" "cedet/semantic/db-find.el" "cedet/semantic/db-global.el"
-;;;;;; "cedet/semantic/db-javascript.el" "cedet/semantic/db-mode.el"
-;;;;;; "cedet/semantic/db-ref.el" "cedet/semantic/db-typecache.el"
+;;;;;; "calc/calc-macs.el" "calc/calc-map.el" "calc/calc-math.el"
+;;;;;; "calc/calc-menu.el" "calc/calc-misc.el" "calc/calc-mode.el"
+;;;;;; "calc/calc-mtx.el" "calc/calc-nlfit.el" "calc/calc-poly.el"
+;;;;;; "calc/calc-prog.el" "calc/calc-rewr.el" "calc/calc-rules.el"
+;;;;;; "calc/calc-sel.el" "calc/calc-stat.el" "calc/calc-store.el"
+;;;;;; "calc/calc-stuff.el" "calc/calc-trail.el" "calc/calc-units.el"
+;;;;;; "calc/calc-vec.el" "calc/calc-yank.el" "calc/calcalg2.el"
+;;;;;; "calc/calcalg3.el" "calc/calccomp.el" "calc/calcsel2.el"
+;;;;;; "calendar/cal-bahai.el" "calendar/cal-coptic.el" "calendar/cal-french.el"
+;;;;;; "calendar/cal-html.el" "calendar/cal-islam.el" "calendar/cal-iso.el"
+;;;;;; "calendar/cal-julian.el" "calendar/cal-loaddefs.el" "calendar/cal-mayan.el"
+;;;;;; "calendar/cal-menu.el" "calendar/cal-move.el" "calendar/cal-persia.el"
+;;;;;; "calendar/cal-tex.el" "calendar/cal-x.el" "calendar/diary-loaddefs.el"
+;;;;;; "calendar/hol-loaddefs.el" "cdl.el" "cedet/cedet-cscope.el"
+;;;;;; "cedet/cedet-files.el" "cedet/cedet-global.el" "cedet/cedet-idutils.el"
+;;;;;; "cedet/ede/auto.el" "cedet/ede/autoconf-edit.el" "cedet/ede/base.el"
+;;;;;; "cedet/ede/cpp-root.el" "cedet/ede/custom.el" "cedet/ede/emacs.el"
+;;;;;; "cedet/ede/files.el" "cedet/ede/generic.el" "cedet/ede/linux.el"
+;;;;;; "cedet/ede/locate.el" "cedet/ede/make.el" "cedet/ede/makefile-edit.el"
+;;;;;; "cedet/ede/pconf.el" "cedet/ede/pmake.el" "cedet/ede/proj-archive.el"
+;;;;;; "cedet/ede/proj-aux.el" "cedet/ede/proj-comp.el" "cedet/ede/proj-elisp.el"
+;;;;;; "cedet/ede/proj-info.el" "cedet/ede/proj-misc.el" "cedet/ede/proj-obj.el"
+;;;;;; "cedet/ede/proj-prog.el" "cedet/ede/proj-scheme.el" "cedet/ede/proj-shared.el"
+;;;;;; "cedet/ede/proj.el" "cedet/ede/shell.el" "cedet/ede/simple.el"
+;;;;;; "cedet/ede/source.el" "cedet/ede/speedbar.el" "cedet/ede/srecode.el"
+;;;;;; "cedet/ede/system.el" "cedet/ede/util.el" "cedet/semantic/analyze.el"
+;;;;;; "cedet/semantic/analyze/complete.el" "cedet/semantic/analyze/debug.el"
+;;;;;; "cedet/semantic/analyze/fcn.el" "cedet/semantic/analyze/refs.el"
+;;;;;; "cedet/semantic/bovine.el" "cedet/semantic/bovine/c.el" "cedet/semantic/bovine/debug.el"
+;;;;;; "cedet/semantic/bovine/el.el" "cedet/semantic/bovine/gcc.el"
+;;;;;; "cedet/semantic/bovine/make.el" "cedet/semantic/bovine/scm.el"
+;;;;;; "cedet/semantic/chart.el" "cedet/semantic/complete.el" "cedet/semantic/ctxt.el"
+;;;;;; "cedet/semantic/db-debug.el" "cedet/semantic/db-ebrowse.el"
+;;;;;; "cedet/semantic/db-el.el" "cedet/semantic/db-file.el" "cedet/semantic/db-find.el"
+;;;;;; "cedet/semantic/db-global.el" "cedet/semantic/db-javascript.el"
+;;;;;; "cedet/semantic/db-mode.el" "cedet/semantic/db-ref.el" "cedet/semantic/db-typecache.el"
;;;;;; "cedet/semantic/db.el" "cedet/semantic/debug.el" "cedet/semantic/decorate.el"
;;;;;; "cedet/semantic/decorate/include.el" "cedet/semantic/decorate/mode.el"
;;;;;; "cedet/semantic/dep.el" "cedet/semantic/doc.el" "cedet/semantic/ede-grammar.el"
@@ -32029,52 +31992,49 @@ Zone out, completely.
;;;;;; "cedet/semantic/fw.el" "cedet/semantic/grammar-wy.el" "cedet/semantic/grammar.el"
;;;;;; "cedet/semantic/html.el" "cedet/semantic/ia-sb.el" "cedet/semantic/ia.el"
;;;;;; "cedet/semantic/idle.el" "cedet/semantic/imenu.el" "cedet/semantic/java.el"
-;;;;;; "cedet/semantic/lex-spp.el" "cedet/semantic/lex.el" "cedet/semantic/loaddefs.el"
-;;;;;; "cedet/semantic/mru-bookmark.el" "cedet/semantic/sb.el" "cedet/semantic/scope.el"
-;;;;;; "cedet/semantic/senator.el" "cedet/semantic/sort.el" "cedet/semantic/symref.el"
-;;;;;; "cedet/semantic/symref/cscope.el" "cedet/semantic/symref/filter.el"
-;;;;;; "cedet/semantic/symref/global.el" "cedet/semantic/symref/grep.el"
-;;;;;; "cedet/semantic/symref/idutils.el" "cedet/semantic/symref/list.el"
-;;;;;; "cedet/semantic/tag-file.el" "cedet/semantic/tag-ls.el" "cedet/semantic/tag-write.el"
+;;;;;; "cedet/semantic/lex-spp.el" "cedet/semantic/lex.el" "cedet/semantic/mru-bookmark.el"
+;;;;;; "cedet/semantic/sb.el" "cedet/semantic/scope.el" "cedet/semantic/senator.el"
+;;;;;; "cedet/semantic/sort.el" "cedet/semantic/symref.el" "cedet/semantic/symref/cscope.el"
+;;;;;; "cedet/semantic/symref/filter.el" "cedet/semantic/symref/global.el"
+;;;;;; "cedet/semantic/symref/grep.el" "cedet/semantic/symref/idutils.el"
+;;;;;; "cedet/semantic/symref/list.el" "cedet/semantic/tag-file.el"
+;;;;;; "cedet/semantic/tag-ls.el" "cedet/semantic/tag-write.el"
;;;;;; "cedet/semantic/tag.el" "cedet/semantic/texi.el" "cedet/semantic/util-modes.el"
;;;;;; "cedet/semantic/util.el" "cedet/semantic/wisent.el" "cedet/semantic/wisent/comp.el"
;;;;;; "cedet/semantic/wisent/java-tags.el" "cedet/semantic/wisent/javascript.el"
-;;;;;; "cedet/semantic/wisent/javat-wy.el" "cedet/semantic/wisent/js-wy.el"
-;;;;;; "cedet/semantic/wisent/python-wy.el" "cedet/semantic/wisent/python.el"
-;;;;;; "cedet/semantic/wisent/wisent.el" "cedet/srecode/args.el"
-;;;;;; "cedet/srecode/compile.el" "cedet/srecode/cpp.el" "cedet/srecode/ctxt.el"
-;;;;;; "cedet/srecode/dictionary.el" "cedet/srecode/document.el"
+;;;;;; "cedet/semantic/wisent/python.el" "cedet/semantic/wisent/wisent.el"
+;;;;;; "cedet/srecode/args.el" "cedet/srecode/compile.el" "cedet/srecode/cpp.el"
+;;;;;; "cedet/srecode/ctxt.el" "cedet/srecode/dictionary.el" "cedet/srecode/document.el"
;;;;;; "cedet/srecode/el.el" "cedet/srecode/expandproto.el" "cedet/srecode/extract.el"
;;;;;; "cedet/srecode/fields.el" "cedet/srecode/filters.el" "cedet/srecode/find.el"
;;;;;; "cedet/srecode/getset.el" "cedet/srecode/insert.el" "cedet/srecode/java.el"
-;;;;;; "cedet/srecode/loaddefs.el" "cedet/srecode/map.el" "cedet/srecode/mode.el"
-;;;;;; "cedet/srecode/semantic.el" "cedet/srecode/srt-wy.el" "cedet/srecode/srt.el"
-;;;;;; "cedet/srecode/table.el" "cedet/srecode/template.el" "cedet/srecode/texi.el"
-;;;;;; "cus-dep.el" "dframe.el" "dired-aux.el" "dired-x.el" "dos-fns.el"
-;;;;;; "dos-vars.el" "dos-w32.el" "dynamic-setting.el" "emacs-lisp/authors.el"
-;;;;;; "emacs-lisp/avl-tree.el" "emacs-lisp/bindat.el" "emacs-lisp/byte-opt.el"
-;;;;;; "emacs-lisp/cl-extra.el" "emacs-lisp/cl-loaddefs.el" "emacs-lisp/cl-macs.el"
+;;;;;; "cedet/srecode/map.el" "cedet/srecode/mode.el" "cedet/srecode/semantic.el"
+;;;;;; "cedet/srecode/srt.el" "cedet/srecode/table.el" "cedet/srecode/template.el"
+;;;;;; "cedet/srecode/texi.el" "cus-dep.el" "dframe.el" "dired-aux.el"
+;;;;;; "dired-x.el" "dos-fns.el" "dos-vars.el" "dos-w32.el" "dynamic-setting.el"
+;;;;;; "emacs-lisp/authors.el" "emacs-lisp/avl-tree.el" "emacs-lisp/bindat.el"
+;;;;;; "emacs-lisp/byte-opt.el" "emacs-lisp/cl-extra.el" "emacs-lisp/cl-macs.el"
;;;;;; "emacs-lisp/cl-seq.el" "emacs-lisp/cl.el" "emacs-lisp/eieio-base.el"
;;;;;; "emacs-lisp/eieio-datadebug.el" "emacs-lisp/eieio-speedbar.el"
-;;;;;; "emacs-lisp/find-gc.el" "emacs-lisp/gulp.el" "emacs-lisp/lisp-mnt.el"
-;;;;;; "emacs-lisp/package-x.el" "emacs-lisp/smie.el" "emacs-lisp/tcover-ses.el"
-;;;;;; "emacs-lisp/tcover-unsafep.el" "emulation/cua-gmrk.el" "emulation/cua-rect.el"
-;;;;;; "emulation/edt-lk201.el" "emulation/edt-mapper.el" "emulation/edt-pc.el"
-;;;;;; "emulation/edt-vt100.el" "emulation/tpu-extras.el" "emulation/viper-cmd.el"
-;;;;;; "emulation/viper-ex.el" "emulation/viper-init.el" "emulation/viper-keym.el"
-;;;;;; "emulation/viper-macs.el" "emulation/viper-mous.el" "emulation/viper-util.el"
-;;;;;; "erc/erc-backend.el" "erc/erc-goodies.el" "erc/erc-ibuffer.el"
-;;;;;; "eshell/em-alias.el" "eshell/em-banner.el" "eshell/em-basic.el"
-;;;;;; "eshell/em-cmpl.el" "eshell/em-dirs.el" "eshell/em-glob.el"
-;;;;;; "eshell/em-hist.el" "eshell/em-ls.el" "eshell/em-pred.el"
-;;;;;; "eshell/em-prompt.el" "eshell/em-rebind.el" "eshell/em-script.el"
-;;;;;; "eshell/em-smart.el" "eshell/em-term.el" "eshell/em-tramp.el"
-;;;;;; "eshell/em-unix.el" "eshell/em-xtra.el" "eshell/esh-arg.el"
-;;;;;; "eshell/esh-cmd.el" "eshell/esh-ext.el" "eshell/esh-groups.el"
-;;;;;; "eshell/esh-io.el" "eshell/esh-module.el" "eshell/esh-opt.el"
-;;;;;; "eshell/esh-proc.el" "eshell/esh-util.el" "eshell/esh-var.el"
-;;;;;; "ezimage.el" "format-spec.el" "fringe.el" "generic-x.el"
-;;;;;; "gnus/compface.el" "gnus/gnus-async.el" "gnus/gnus-bcklg.el"
+;;;;;; "emacs-lisp/find-gc.el" "emacs-lisp/gulp.el" "emacs-lisp/helpers.el"
+;;;;;; "emacs-lisp/lisp-mnt.el" "emacs-lisp/package-x.el" "emacs-lisp/smie.el"
+;;;;;; "emacs-lisp/tcover-ses.el" "emacs-lisp/tcover-unsafep.el"
+;;;;;; "emulation/cua-gmrk.el" "emulation/cua-rect.el" "emulation/edt-lk201.el"
+;;;;;; "emulation/edt-mapper.el" "emulation/edt-pc.el" "emulation/edt-vt100.el"
+;;;;;; "emulation/tpu-extras.el" "emulation/viper-cmd.el" "emulation/viper-ex.el"
+;;;;;; "emulation/viper-init.el" "emulation/viper-keym.el" "emulation/viper-macs.el"
+;;;;;; "emulation/viper-mous.el" "emulation/viper-util.el" "erc/erc-backend.el"
+;;;;;; "erc/erc-goodies.el" "erc/erc-ibuffer.el" "eshell/em-alias.el"
+;;;;;; "eshell/em-banner.el" "eshell/em-basic.el" "eshell/em-cmpl.el"
+;;;;;; "eshell/em-dirs.el" "eshell/em-glob.el" "eshell/em-hist.el"
+;;;;;; "eshell/em-ls.el" "eshell/em-pred.el" "eshell/em-prompt.el"
+;;;;;; "eshell/em-rebind.el" "eshell/em-script.el" "eshell/em-smart.el"
+;;;;;; "eshell/em-term.el" "eshell/em-tramp.el" "eshell/em-unix.el"
+;;;;;; "eshell/em-xtra.el" "eshell/esh-arg.el" "eshell/esh-cmd.el"
+;;;;;; "eshell/esh-ext.el" "eshell/esh-io.el" "eshell/esh-module.el"
+;;;;;; "eshell/esh-opt.el" "eshell/esh-proc.el" "eshell/esh-util.el"
+;;;;;; "eshell/esh-var.el" "ezimage.el" "format-spec.el" "fringe.el"
+;;;;;; "generic-x.el" "gnus/compface.el" "gnus/gnus-async.el" "gnus/gnus-bcklg.el"
;;;;;; "gnus/gnus-cite.el" "gnus/gnus-cus.el" "gnus/gnus-demon.el"
;;;;;; "gnus/gnus-dup.el" "gnus/gnus-eform.el" "gnus/gnus-ems.el"
;;;;;; "gnus/gnus-icalendar.el" "gnus/gnus-int.el" "gnus/gnus-logic.el"
@@ -32096,22 +32056,28 @@ Zone out, completely.
;;;;;; "gnus/smime.el" "gnus/spam-stat.el" "gnus/spam-wash.el" "hex-util.el"
;;;;;; "hfy-cmap.el" "ibuf-ext.el" "international/cp51932.el" "international/eucjp-ms.el"
;;;;;; "international/fontset.el" "international/iso-ascii.el" "international/ja-dic-cnv.el"
-;;;;;; "international/ja-dic-utl.el" "international/ogonek.el" "international/uni-bidi.el"
-;;;;;; "international/uni-category.el" "international/uni-combining.el"
-;;;;;; "international/uni-comment.el" "international/uni-decimal.el"
-;;;;;; "international/uni-decomposition.el" "international/uni-digit.el"
-;;;;;; "international/uni-lowercase.el" "international/uni-mirrored.el"
-;;;;;; "international/uni-name.el" "international/uni-numeric.el"
-;;;;;; "international/uni-old-name.el" "international/uni-titlecase.el"
-;;;;;; "international/uni-uppercase.el" "kermit.el" "language/hanja-util.el"
-;;;;;; "language/thai-word.el" "ldefs-boot.el" "loadup.el" "mail/blessmail.el"
-;;;;;; "mail/mailheader.el" "mail/mspools.el" "mail/rfc2368.el"
-;;;;;; "mail/rfc822.el" "mail/rmail-spam-filter.el" "mail/rmailedit.el"
-;;;;;; "mail/rmailkwd.el" "mail/rmailmm.el" "mail/rmailmsc.el" "mail/rmailsort.el"
-;;;;;; "mail/rmailsum.el" "mail/undigest.el" "mh-e/mh-acros.el"
-;;;;;; "mh-e/mh-alias.el" "mh-e/mh-buffers.el" "mh-e/mh-compat.el"
-;;;;;; "mh-e/mh-funcs.el" "mh-e/mh-gnus.el" "mh-e/mh-identity.el"
-;;;;;; "mh-e/mh-inc.el" "mh-e/mh-junk.el" "mh-e/mh-letter.el" "mh-e/mh-limit.el"
+;;;;;; "international/ja-dic-utl.el" "international/ogonek.el" "kermit.el"
+;;;;;; "language/hanja-util.el" "language/thai-word.el" "ldefs-boot.el"
+;;;;;; "leim/quail/arabic.el" "leim/quail/croatian.el" "leim/quail/cyril-jis.el"
+;;;;;; "leim/quail/cyrillic.el" "leim/quail/czech.el" "leim/quail/ethiopic.el"
+;;;;;; "leim/quail/georgian.el" "leim/quail/greek.el" "leim/quail/hanja-jis.el"
+;;;;;; "leim/quail/hanja.el" "leim/quail/hanja3.el" "leim/quail/hebrew.el"
+;;;;;; "leim/quail/indian.el" "leim/quail/ipa-praat.el" "leim/quail/ipa.el"
+;;;;;; "leim/quail/japanese.el" "leim/quail/lao.el" "leim/quail/latin-alt.el"
+;;;;;; "leim/quail/latin-ltx.el" "leim/quail/latin-post.el" "leim/quail/latin-pre.el"
+;;;;;; "leim/quail/lrt.el" "leim/quail/persian.el" "leim/quail/py-punct.el"
+;;;;;; "leim/quail/pypunct-b5.el" "leim/quail/rfc1345.el" "leim/quail/sgml-input.el"
+;;;;;; "leim/quail/sisheng.el" "leim/quail/slovak.el" "leim/quail/symbol-ksc.el"
+;;;;;; "leim/quail/thai.el" "leim/quail/tibetan.el" "leim/quail/viqr.el"
+;;;;;; "leim/quail/vntelex.el" "leim/quail/vnvni.el" "leim/quail/welsh.el"
+;;;;;; "loadup.el" "mail/blessmail.el" "mail/mailheader.el" "mail/mspools.el"
+;;;;;; "mail/rfc2368.el" "mail/rfc822.el" "mail/rmail-spam-filter.el"
+;;;;;; "mail/rmailedit.el" "mail/rmailkwd.el" "mail/rmailmm.el"
+;;;;;; "mail/rmailmsc.el" "mail/rmailsort.el" "mail/rmailsum.el"
+;;;;;; "mail/undigest.el" "mh-e/mh-acros.el" "mh-e/mh-alias.el"
+;;;;;; "mh-e/mh-buffers.el" "mh-e/mh-compat.el" "mh-e/mh-funcs.el"
+;;;;;; "mh-e/mh-gnus.el" "mh-e/mh-identity.el" "mh-e/mh-inc.el"
+;;;;;; "mh-e/mh-junk.el" "mh-e/mh-letter.el" "mh-e/mh-limit.el"
;;;;;; "mh-e/mh-loaddefs.el" "mh-e/mh-mime.el" "mh-e/mh-print.el"
;;;;;; "mh-e/mh-scan.el" "mh-e/mh-search.el" "mh-e/mh-seq.el" "mh-e/mh-show.el"
;;;;;; "mh-e/mh-speed.el" "mh-e/mh-thread.el" "mh-e/mh-tool-bar.el"
@@ -32132,35 +32098,32 @@ Zone out, completely.
;;;;;; "nxml/rng-pttrn.el" "nxml/rng-uri.el" "nxml/rng-util.el"
;;;;;; "nxml/xsd-regexp.el" "org/ob-C.el" "org/ob-R.el" "org/ob-asymptote.el"
;;;;;; "org/ob-awk.el" "org/ob-calc.el" "org/ob-clojure.el" "org/ob-comint.el"
-;;;;;; "org/ob-css.el" "org/ob-ditaa.el" "org/ob-dot.el" "org/ob-emacs-lisp.el"
-;;;;;; "org/ob-eval.el" "org/ob-exp.el" "org/ob-fortran.el" "org/ob-gnuplot.el"
-;;;;;; "org/ob-haskell.el" "org/ob-io.el" "org/ob-java.el" "org/ob-js.el"
-;;;;;; "org/ob-keys.el" "org/ob-latex.el" "org/ob-ledger.el" "org/ob-lilypond.el"
-;;;;;; "org/ob-lisp.el" "org/ob-lob.el" "org/ob-matlab.el" "org/ob-maxima.el"
-;;;;;; "org/ob-mscgen.el" "org/ob-ocaml.el" "org/ob-octave.el" "org/ob-org.el"
-;;;;;; "org/ob-perl.el" "org/ob-picolisp.el" "org/ob-plantuml.el"
-;;;;;; "org/ob-python.el" "org/ob-ref.el" "org/ob-ruby.el" "org/ob-sass.el"
-;;;;;; "org/ob-scala.el" "org/ob-scheme.el" "org/ob-screen.el" "org/ob-sh.el"
-;;;;;; "org/ob-shen.el" "org/ob-sql.el" "org/ob-sqlite.el" "org/ob-table.el"
-;;;;;; "org/ob-tangle.el" "org/ob.el" "org/org-archive.el" "org/org-ascii.el"
-;;;;;; "org/org-attach.el" "org/org-bbdb.el" "org/org-bibtex.el"
-;;;;;; "org/org-clock.el" "org/org-crypt.el" "org/org-ctags.el"
-;;;;;; "org/org-datetree.el" "org/org-docbook.el" "org/org-docview.el"
+;;;;;; "org/ob-core.el" "org/ob-css.el" "org/ob-ditaa.el" "org/ob-dot.el"
+;;;;;; "org/ob-emacs-lisp.el" "org/ob-eval.el" "org/ob-exp.el" "org/ob-fortran.el"
+;;;;;; "org/ob-gnuplot.el" "org/ob-haskell.el" "org/ob-io.el" "org/ob-java.el"
+;;;;;; "org/ob-js.el" "org/ob-keys.el" "org/ob-latex.el" "org/ob-ledger.el"
+;;;;;; "org/ob-lilypond.el" "org/ob-lisp.el" "org/ob-lob.el" "org/ob-makefile.el"
+;;;;;; "org/ob-matlab.el" "org/ob-maxima.el" "org/ob-mscgen.el"
+;;;;;; "org/ob-ocaml.el" "org/ob-octave.el" "org/ob-org.el" "org/ob-perl.el"
+;;;;;; "org/ob-picolisp.el" "org/ob-plantuml.el" "org/ob-python.el"
+;;;;;; "org/ob-ref.el" "org/ob-ruby.el" "org/ob-sass.el" "org/ob-scala.el"
+;;;;;; "org/ob-scheme.el" "org/ob-screen.el" "org/ob-sh.el" "org/ob-shen.el"
+;;;;;; "org/ob-sql.el" "org/ob-sqlite.el" "org/ob-table.el" "org/ob-tangle.el"
+;;;;;; "org/ob.el" "org/org-archive.el" "org/org-attach.el" "org/org-bbdb.el"
+;;;;;; "org/org-bibtex.el" "org/org-clock.el" "org/org-crypt.el"
+;;;;;; "org/org-ctags.el" "org/org-datetree.el" "org/org-docview.el"
;;;;;; "org/org-element.el" "org/org-entities.el" "org/org-eshell.el"
-;;;;;; "org/org-exp-blocks.el" "org/org-exp.el" "org/org-faces.el"
-;;;;;; "org/org-feed.el" "org/org-footnote.el" "org/org-freemind.el"
-;;;;;; "org/org-gnus.el" "org/org-habit.el" "org/org-html.el" "org/org-icalendar.el"
-;;;;;; "org/org-id.el" "org/org-indent.el" "org/org-info.el" "org/org-inlinetask.el"
-;;;;;; "org/org-install.el" "org/org-irc.el" "org/org-jsinfo.el"
-;;;;;; "org/org-latex.el" "org/org-list.el" "org/org-loaddefs.el"
-;;;;;; "org/org-lparse.el" "org/org-mac-message.el" "org/org-macs.el"
-;;;;;; "org/org-mew.el" "org/org-mhe.el" "org/org-mks.el" "org/org-mobile.el"
-;;;;;; "org/org-mouse.el" "org/org-odt.el" "org/org-pcomplete.el"
-;;;;;; "org/org-plot.el" "org/org-protocol.el" "org/org-publish.el"
-;;;;;; "org/org-remember.el" "org/org-rmail.el" "org/org-special-blocks.el"
-;;;;;; "org/org-src.el" "org/org-table.el" "org/org-taskjuggler.el"
-;;;;;; "org/org-timer.el" "org/org-vm.el" "org/org-w3m.el" "org/org-wl.el"
-;;;;;; "org/org-xoxo.el" "play/gametree.el" "play/meese.el" "progmodes/ada-prj.el"
+;;;;;; "org/org-faces.el" "org/org-feed.el" "org/org-footnote.el"
+;;;;;; "org/org-gnus.el" "org/org-habit.el" "org/org-id.el" "org/org-indent.el"
+;;;;;; "org/org-info.el" "org/org-inlinetask.el" "org/org-install.el"
+;;;;;; "org/org-irc.el" "org/org-list.el" "org/org-macro.el" "org/org-mhe.el"
+;;;;;; "org/org-mobile.el" "org/org-mouse.el" "org/org-pcomplete.el"
+;;;;;; "org/org-plot.el" "org/org-protocol.el" "org/org-rmail.el"
+;;;;;; "org/org-src.el" "org/org-table.el" "org/org-timer.el" "org/org-w3m.el"
+;;;;;; "org/ox-ascii.el" "org/ox-beamer.el" "org/ox-html.el" "org/ox-icalendar.el"
+;;;;;; "org/ox-latex.el" "org/ox-man.el" "org/ox-md.el" "org/ox-odt.el"
+;;;;;; "org/ox-org.el" "org/ox-publish.el" "org/ox-texinfo.el" "org/ox.el"
+;;;;;; "play/gametree.el" "play/meese.el" "progmodes/ada-prj.el"
;;;;;; "progmodes/cc-align.el" "progmodes/cc-awk.el" "progmodes/cc-bytecomp.el"
;;;;;; "progmodes/cc-cmds.el" "progmodes/cc-defs.el" "progmodes/cc-fonts.el"
;;;;;; "progmodes/cc-langs.el" "progmodes/cc-menus.el" "progmodes/ebnf-abn.el"
@@ -32174,16 +32137,16 @@ Zone out, completely.
;;;;;; "textmodes/refbib.el" "textmodes/refer.el" "textmodes/reftex-auc.el"
;;;;;; "textmodes/reftex-dcr.el" "textmodes/reftex-ref.el" "textmodes/reftex-sel.el"
;;;;;; "textmodes/reftex-toc.el" "textmodes/texnfo-upd.el" "timezone.el"
-;;;;;; "tooltip.el" "tree-widget.el" "uniquify.el" "url/url-about.el"
-;;;;;; "url/url-cookie.el" "url/url-dired.el" "url/url-domsuf.el"
-;;;;;; "url/url-expand.el" "url/url-ftp.el" "url/url-future.el"
-;;;;;; "url/url-history.el" "url/url-imap.el" "url/url-methods.el"
-;;;;;; "url/url-nfs.el" "url/url-proxy.el" "url/url-vars.el" "vc/ediff-diff.el"
-;;;;;; "vc/ediff-init.el" "vc/ediff-merg.el" "vc/ediff-ptch.el"
-;;;;;; "vc/ediff-vers.el" "vc/ediff-wind.el" "vc/pcvs-info.el" "vc/pcvs-parse.el"
-;;;;;; "vc/pcvs-util.el" "vc/vc-dav.el" "vcursor.el" "vt-control.el"
-;;;;;; "vt100-led.el" "w32-common-fns.el" "w32-fns.el" "w32-vars.el"
-;;;;;; "x-dnd.el") (21107 32938 48648 817000))
+;;;;;; "tooltip.el" "tree-widget.el" "url/url-about.el" "url/url-cookie.el"
+;;;;;; "url/url-dired.el" "url/url-domsuf.el" "url/url-expand.el"
+;;;;;; "url/url-ftp.el" "url/url-future.el" "url/url-history.el"
+;;;;;; "url/url-imap.el" "url/url-methods.el" "url/url-nfs.el" "url/url-proxy.el"
+;;;;;; "url/url-vars.el" "vc/ediff-diff.el" "vc/ediff-init.el" "vc/ediff-merg.el"
+;;;;;; "vc/ediff-ptch.el" "vc/ediff-vers.el" "vc/ediff-wind.el"
+;;;;;; "vc/pcvs-info.el" "vc/pcvs-parse.el" "vc/pcvs-util.el" "vc/vc-dav.el"
+;;;;;; "vcursor.el" "vt-control.el" "vt100-led.el" "w32-common-fns.el"
+;;;;;; "w32-fns.el" "w32-vars.el" "x-dnd.el") (21147 7118 261519
+;;;;;; 169000))
;;;***
diff --git a/lisp/leim/.gitignore b/lisp/leim/.gitignore
new file mode 100644
index 00000000000..57b77bad9ca
--- /dev/null
+++ b/lisp/leim/.gitignore
@@ -0,0 +1,2 @@
+ja-dic/
+leim-list.el
diff --git a/leim/quail/.gitignore b/lisp/leim/quail/.gitignore
index c3f9e36f0db..c3f9e36f0db 100644
--- a/leim/quail/.gitignore
+++ b/lisp/leim/quail/.gitignore
diff --git a/leim/quail/arabic.el b/lisp/leim/quail/arabic.el
index 6b6e5122690..6b6e5122690 100644
--- a/leim/quail/arabic.el
+++ b/lisp/leim/quail/arabic.el
diff --git a/leim/quail/croatian.el b/lisp/leim/quail/croatian.el
index 0ca998d284c..0ca998d284c 100644
--- a/leim/quail/croatian.el
+++ b/lisp/leim/quail/croatian.el
diff --git a/leim/quail/cyril-jis.el b/lisp/leim/quail/cyril-jis.el
index ab98f9f6dc6..ab98f9f6dc6 100644
--- a/leim/quail/cyril-jis.el
+++ b/lisp/leim/quail/cyril-jis.el
diff --git a/leim/quail/cyrillic.el b/lisp/leim/quail/cyrillic.el
index f98cd695b07..f98cd695b07 100644
--- a/leim/quail/cyrillic.el
+++ b/lisp/leim/quail/cyrillic.el
diff --git a/leim/quail/czech.el b/lisp/leim/quail/czech.el
index 56778927083..56778927083 100644
--- a/leim/quail/czech.el
+++ b/lisp/leim/quail/czech.el
diff --git a/leim/quail/ethiopic.el b/lisp/leim/quail/ethiopic.el
index d99f649e5e7..d99f649e5e7 100644
--- a/leim/quail/ethiopic.el
+++ b/lisp/leim/quail/ethiopic.el
diff --git a/leim/quail/georgian.el b/lisp/leim/quail/georgian.el
index 7aa00c54cd7..7aa00c54cd7 100644
--- a/leim/quail/georgian.el
+++ b/lisp/leim/quail/georgian.el
diff --git a/leim/quail/greek.el b/lisp/leim/quail/greek.el
index 291592e4736..291592e4736 100644
--- a/leim/quail/greek.el
+++ b/lisp/leim/quail/greek.el
diff --git a/leim/quail/hangul.el b/lisp/leim/quail/hangul.el
index b50917af335..ba20d42ed8b 100644
--- a/leim/quail/hangul.el
+++ b/lisp/leim/quail/hangul.el
@@ -508,6 +508,7 @@ When a Korean input method is off, convert the following hangul character."
(defvar hangul-input-method-help-text nil)
(make-variable-buffer-local 'hangul-input-method-help-text)
+;;;###autoload
(defun hangul-input-method-activate (input-method func help-text &rest args)
"Activate Hangul input method INPUT-METHOD.
FUNC is a function to handle input key.
@@ -542,4 +543,8 @@ HELP-TEXT is a text set in `hangul-input-method-help-text'."
(provide 'hangul)
+;; Local Variables:
+;; generated-autoload-load-name: "quail/hangul"
+;; End:
+
;;; hangul.el ends here
diff --git a/leim/quail/hanja-jis.el b/lisp/leim/quail/hanja-jis.el
index 2c7eebb8345..2c7eebb8345 100644
--- a/leim/quail/hanja-jis.el
+++ b/lisp/leim/quail/hanja-jis.el
diff --git a/leim/quail/hanja.el b/lisp/leim/quail/hanja.el
index 7b98161ddb5..7b98161ddb5 100644
--- a/leim/quail/hanja.el
+++ b/lisp/leim/quail/hanja.el
diff --git a/leim/quail/hanja3.el b/lisp/leim/quail/hanja3.el
index 788683d6a73..788683d6a73 100644
--- a/leim/quail/hanja3.el
+++ b/lisp/leim/quail/hanja3.el
diff --git a/leim/quail/hebrew.el b/lisp/leim/quail/hebrew.el
index fe06b27a922..fe06b27a922 100644
--- a/leim/quail/hebrew.el
+++ b/lisp/leim/quail/hebrew.el
diff --git a/leim/quail/indian.el b/lisp/leim/quail/indian.el
index d953a219104..d953a219104 100644
--- a/leim/quail/indian.el
+++ b/lisp/leim/quail/indian.el
diff --git a/leim/quail/ipa-praat.el b/lisp/leim/quail/ipa-praat.el
index 40b58aacf97..40b58aacf97 100644
--- a/leim/quail/ipa-praat.el
+++ b/lisp/leim/quail/ipa-praat.el
diff --git a/leim/quail/ipa.el b/lisp/leim/quail/ipa.el
index 8b921faa1e2..8b921faa1e2 100644
--- a/leim/quail/ipa.el
+++ b/lisp/leim/quail/ipa.el
diff --git a/leim/quail/japanese.el b/lisp/leim/quail/japanese.el
index 6dd19e9c60a..6dd19e9c60a 100644
--- a/leim/quail/japanese.el
+++ b/lisp/leim/quail/japanese.el
diff --git a/leim/quail/lao.el b/lisp/leim/quail/lao.el
index 52357afd8dd..52357afd8dd 100644
--- a/leim/quail/lao.el
+++ b/lisp/leim/quail/lao.el
diff --git a/leim/quail/latin-alt.el b/lisp/leim/quail/latin-alt.el
index 6841947524f..6841947524f 100644
--- a/leim/quail/latin-alt.el
+++ b/lisp/leim/quail/latin-alt.el
diff --git a/leim/quail/latin-ltx.el b/lisp/leim/quail/latin-ltx.el
index d76f59ebbce..d76f59ebbce 100644
--- a/leim/quail/latin-ltx.el
+++ b/lisp/leim/quail/latin-ltx.el
diff --git a/leim/quail/latin-post.el b/lisp/leim/quail/latin-post.el
index 7fa3d88e8c6..7fa3d88e8c6 100644
--- a/leim/quail/latin-post.el
+++ b/lisp/leim/quail/latin-post.el
diff --git a/leim/quail/latin-pre.el b/lisp/leim/quail/latin-pre.el
index c6085f34290..c6085f34290 100644
--- a/leim/quail/latin-pre.el
+++ b/lisp/leim/quail/latin-pre.el
diff --git a/leim/quail/lrt.el b/lisp/leim/quail/lrt.el
index ec88020493c..ec88020493c 100644
--- a/leim/quail/lrt.el
+++ b/lisp/leim/quail/lrt.el
diff --git a/leim/quail/persian.el b/lisp/leim/quail/persian.el
index 5eeb0e3d208..5eeb0e3d208 100644
--- a/leim/quail/persian.el
+++ b/lisp/leim/quail/persian.el
diff --git a/leim/quail/py-punct.el b/lisp/leim/quail/py-punct.el
index 3e537c4f043..3e537c4f043 100644
--- a/leim/quail/py-punct.el
+++ b/lisp/leim/quail/py-punct.el
diff --git a/leim/quail/pypunct-b5.el b/lisp/leim/quail/pypunct-b5.el
index 37c12659cc3..37c12659cc3 100644
--- a/leim/quail/pypunct-b5.el
+++ b/lisp/leim/quail/pypunct-b5.el
diff --git a/leim/quail/rfc1345.el b/lisp/leim/quail/rfc1345.el
index 3981b76eda8..3981b76eda8 100644
--- a/leim/quail/rfc1345.el
+++ b/lisp/leim/quail/rfc1345.el
diff --git a/leim/quail/sgml-input.el b/lisp/leim/quail/sgml-input.el
index 9545bb8b1aa..9545bb8b1aa 100644
--- a/leim/quail/sgml-input.el
+++ b/lisp/leim/quail/sgml-input.el
diff --git a/leim/quail/sisheng.el b/lisp/leim/quail/sisheng.el
index 2717ce50768..2717ce50768 100644
--- a/leim/quail/sisheng.el
+++ b/lisp/leim/quail/sisheng.el
diff --git a/leim/quail/slovak.el b/lisp/leim/quail/slovak.el
index 10d111421cc..10d111421cc 100644
--- a/leim/quail/slovak.el
+++ b/lisp/leim/quail/slovak.el
diff --git a/leim/quail/symbol-ksc.el b/lisp/leim/quail/symbol-ksc.el
index 5556173a420..5556173a420 100644
--- a/leim/quail/symbol-ksc.el
+++ b/lisp/leim/quail/symbol-ksc.el
diff --git a/leim/quail/thai.el b/lisp/leim/quail/thai.el
index 37171042643..37171042643 100644
--- a/leim/quail/thai.el
+++ b/lisp/leim/quail/thai.el
diff --git a/leim/quail/tibetan.el b/lisp/leim/quail/tibetan.el
index 774b4ad0d6b..774b4ad0d6b 100644
--- a/leim/quail/tibetan.el
+++ b/lisp/leim/quail/tibetan.el
diff --git a/leim/quail/uni-input.el b/lisp/leim/quail/uni-input.el
index aacae3d979a..0ec4f8581ef 100644
--- a/leim/quail/uni-input.el
+++ b/lisp/leim/quail/uni-input.el
@@ -85,6 +85,7 @@
(set-buffer-modified-p modified-p)
(run-hooks 'input-method-after-insert-chunk-hook)))))
+;;;###autoload
(defun ucs-input-activate (&optional arg)
"Activate UCS input method.
With ARG, activate UCS input method if and only if ARG is positive.
@@ -124,10 +125,14 @@ Input method: ucs (mode line indicator:U+)
Input as Unicode: U<hex> or u<hex>, where <hex> is a four-digit hex number.")))
-;; The file ../leim-ext.el contains the following call.
+;; The file leim-list.el contains the following call.
;; (register-input-method "ucs" "UTF-8" 'ucs-input-activate "U+"
;; "Unicode input as hex in the form Uxxxx.")
(provide 'uni-input)
+;; Local Variables:
+;; generated-autoload-load-name: "quail/uni-input"
+;; End:
+
;;; uni-input.el ends here
diff --git a/leim/quail/viqr.el b/lisp/leim/quail/viqr.el
index c5c1c940181..c5c1c940181 100644
--- a/leim/quail/viqr.el
+++ b/lisp/leim/quail/viqr.el
diff --git a/leim/quail/vntelex.el b/lisp/leim/quail/vntelex.el
index 7b7b4925bbb..7b7b4925bbb 100644
--- a/leim/quail/vntelex.el
+++ b/lisp/leim/quail/vntelex.el
diff --git a/leim/quail/vnvni.el b/lisp/leim/quail/vnvni.el
index b130962f8f3..b130962f8f3 100644
--- a/leim/quail/vnvni.el
+++ b/lisp/leim/quail/vnvni.el
diff --git a/leim/quail/welsh.el b/lisp/leim/quail/welsh.el
index fa72dc5c27e..fa72dc5c27e 100644
--- a/leim/quail/welsh.el
+++ b/lisp/leim/quail/welsh.el
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 98e3b877144..b72ddc0955b 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -1,7 +1,7 @@
;;; loadup.el --- load up standardly loaded Lisp files for Emacs
-;; Copyright (C) 1985-1986, 1992, 1994, 2001-2013 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1985-1986, 1992, 1994, 2001-2013
+;; Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: internal
@@ -51,8 +51,9 @@
;; in deciding whether to modify it.
(if (or (equal (nth 3 command-line-args) "bootstrap")
(equal (nth 4 command-line-args) "bootstrap")
- (equal (nth 3 command-line-args) "unidata-gen.el")
- (equal (nth 4 command-line-args) "unidata-gen-files")
+ ;; FIXME this is irritatingly fragile.
+ (equal (nth 4 command-line-args) "unidata-gen.el")
+ (equal (nth 7 command-line-args) "unidata-gen-files")
;; In case CANNOT_DUMP.
(string-match "src/bootstrap-emacs" (nth 0 command-line-args)))
(let ((dir (car load-path)))
@@ -62,7 +63,8 @@
(expand-file-name "emacs-lisp" dir)
(expand-file-name "language" dir)
(expand-file-name "international" dir)
- (expand-file-name "textmodes" dir)))))
+ (expand-file-name "textmodes" dir)
+ (expand-file-name "vc" dir)))))
(if (eq t purify-flag)
;; Hash consing saved around 11% of pure space in my tests.
@@ -98,6 +100,8 @@
(load "env")
(load "format")
(load "bindings")
+;; This sets temporary-file-directory, used by eg
+;; auto-save-file-name-transforms in files.el.
(load "cus-start")
(load "window") ; Needed here for `replace-buffer-in-windows'.
(setq load-source-file-function 'load-with-code-conversion)
@@ -276,14 +280,20 @@
(load "vc/vc-hooks")
(load "vc/ediff-hook")
+(load "uniquify")
+(load "electric")
(if (not (eq system-type 'ms-dos)) (load "tooltip"))
-;If you want additional libraries to be preloaded and their
-;doc strings kept in the DOC file rather than in core,
-;you may load them with a "site-load.el" file.
-;But you must also cause them to be scanned when the DOC file
-;is generated.
-;For other systems, you must edit ../src/Makefile.in.
+;; This file doesn't exist when building a development version of Emacs
+;; from the repository. It is generated just after temacs is built.
+(load "leim/leim-list.el" t)
+
+;; If you want additional libraries to be preloaded and their
+;; doc strings kept in the DOC file rather than in core,
+;; you may load them with a "site-load.el" file.
+;; But you must also cause them to be scanned when the DOC file
+;; is generated.
+;; For other systems, you must edit ../src/Makefile.in.
(load "site-load" t)
;; Make sure default-directory is unibyte when dumping. This is
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 0940e90212e..178f87c768b 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -190,6 +190,24 @@ that can be used as the COLLECTION argument to `try-completion' and
(current-buffer)))
(complete-with-action action (funcall fun string) string pred)))))
+(defun completion-table-with-cache (fun &optional ignore-case)
+ "Create dynamic completion table from FUN, with cache.
+This wraps `completion-table-dynamic', but saves the last
+argument-result pair from FUN, so that several lookups with the
+same argument (or with an argument that starts with the first one)
+only need to call FUN once. Most useful when FUN performs a relatively
+slow operation, such as calling an external process (see Bug#11906).
+When IGNORE-CASE is non-nil, FUN is expected to be case-insensitive."
+ (let* (last-arg last-result
+ (new-fun
+ (lambda (arg)
+ (if (and last-arg (string-prefix-p last-arg arg ignore-case))
+ last-result
+ (prog1
+ (setq last-result (funcall fun arg))
+ (setq last-arg arg))))))
+ (completion-table-dynamic new-fun)))
+
(defmacro lazy-completion-table (var fun)
"Initialize variable VAR as a lazy completion table.
If the completion table VAR is used for the first time (e.g., by passing VAR
@@ -1067,7 +1085,8 @@ scroll the window of possible completions."
;; If end is in view, scroll up to the beginning.
(set-window-start window (point-min) nil)
;; Else scroll down one screen.
- (scroll-other-window))
+ (with-selected-window window
+ (scroll-up)))
nil)))
;; If we're cycling, keep on cycling.
((and completion-cycling completion-all-sorted-completions)
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 91a17f0d980..ec38f46f2be 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -392,93 +392,111 @@ must be one of the symbols `header', `mode', or `vertical'."
(window (posn-window start))
(frame (window-frame window))
(minibuffer-window (minibuffer-window frame))
+ (on-link (and mouse-1-click-follows-link
+ (mouse-on-link-p start)))
(side (and (eq line 'vertical)
(or (cdr (assq 'vertical-scroll-bars
(frame-parameters frame)))
'right)))
(draggable t)
- event position growth dragged)
+ height finished event position growth dragged)
(cond
((eq line 'header)
;; Check whether header-line can be dragged at all.
(if (window-at-side-p window 'top)
(setq draggable nil)
+ (setq height (/ (window-header-line-height window) 2))
(setq window (window-in-direction 'above window t))))
((eq line 'mode)
;; Check whether mode-line can be dragged at all.
- (and (window-at-side-p window 'bottom)
- ;; Allow resizing the minibuffer window if it's on the same
- ;; frame as and immediately below the clicked window, and
- ;; it's active or `resize-mini-windows' is nil.
- (not (and (eq (window-frame minibuffer-window) frame)
- (= (nth 1 (window-edges minibuffer-window))
- (nth 3 (window-edges window)))
- (or (not resize-mini-windows)
- (eq minibuffer-window
- (active-minibuffer-window)))))
- (setq draggable nil)))
+ (if (and (window-at-side-p window 'bottom)
+ ;; Allow resizing the minibuffer window if it's on the same
+ ;; frame as and immediately below the clicked window, and
+ ;; it's active or `resize-mini-windows' is nil.
+ (not (and (eq (window-frame minibuffer-window) frame)
+ (= (nth 1 (window-pixel-edges minibuffer-window))
+ (nth 3 (window-pixel-edges window)))
+ (or (not resize-mini-windows)
+ (eq minibuffer-window
+ (active-minibuffer-window))))))
+ (setq draggable nil)
+ (setq height (/ (window-mode-line-height window) 2))))
((eq line 'vertical)
- ;; Get the window to adjust for the vertical case. If the
- ;; scroll bar is on the window's right or there's no scroll bar
- ;; at all, adjust the window where the start-event occurred. If
- ;; the scroll bar is on the start-event window's left, adjust
- ;; the window on the left of it.
- (unless (eq side 'right)
+ ;; Get the window to adjust for the vertical case. If the scroll
+ ;; bar is on the window's right or we drag a vertical divider,
+ ;; adjust the window where the start-event occurred. If the
+ ;; scroll bar is on the start-event window's left or there are no
+ ;; scrollbars, adjust the window on the left of it.
+ (unless (or (eq side 'right)
+ (not (zerop (window-right-divider-width window))))
(setq window (window-in-direction 'left window t)))))
;; Start tracking.
(track-mouse
- ;; Loop reading events and sampling the position of the mouse,
- ;; until there is a non-mouse-movement event. Also,
- ;; scroll-bar-movement events are the same as mouse movement for
- ;; our purposes. (Why? -- cyd)
- ;; If you change this, check that all of the following still work:
- ;; Resizing windows by dragging mode-lines and header lines,
- ;; and vertical lines (in windows without scroll bars).
- ;; Doing this should not select another window, even if
- ;; mouse-autoselect-window is non-nil.
- ;; Mouse-1 clicks in Info header lines should advance position
- ;; by one node at a time if mouse-1-click-follows-link is non-nil,
- ;; otherwise they should just select the window.
- (while (progn
- (setq event (read-event))
- (memq (car-safe event)
- '(mouse-movement scroll-bar-movement
- switch-frame select-window)))
- (setq position (mouse-position))
+ ;; Loop reading events and sampling the position of the mouse.
+ (while (not finished)
+ (setq event (read-event))
+ (setq position (mouse-pixel-position))
;; Do nothing if
;; - there is a switch-frame event.
;; - the mouse isn't in the frame that we started in
;; - the mouse isn't in any Emacs frame
+ ;; Drag if
+ ;; - there is a mouse-movement event
+ ;; - there is a scroll-bar-movement event (Why? -- cyd)
+ ;; (same as mouse movement for our purposes)
+ ;; Quit if
+ ;; - there is a keyboard event or some other unknown event.
(cond
+ ((not (consp event))
+ (setq finished t))
((memq (car event) '(switch-frame select-window))
nil)
- ((not (and (eq (car position) frame)
- (cadr position)))
+ ((not (memq (car event) '(mouse-movement scroll-bar-movement)))
+ (when (consp event)
+ ;; Do not unread a drag-mouse-1 event to avoid selecting
+ ;; some other window. For vertical line dragging do not
+ ;; unread mouse-1 events either (but only if we dragged at
+ ;; least once to allow mouse-1 clicks get through).
+ (unless (and dragged
+ (if (eq line 'vertical)
+ (memq (car event) '(drag-mouse-1 mouse-1))
+ (eq (car event) 'drag-mouse-1)))
+ (push event unread-command-events)))
+ (setq finished t))
+ ((not (and (eq (car position) frame)
+ (cadr position)))
nil)
((eq line 'vertical)
- ;; Drag vertical divider.
+ ;; Drag vertical divider. This must be probably fixed like
+ ;; for the mode-line.
(setq growth (- (cadr position)
(if (eq side 'right) 0 2)
- (nth 2 (window-edges window))
+ (nth 2 (window-pixel-edges window))
-1))
(unless (zerop growth)
- (setq dragged t))
- (adjust-window-trailing-edge window growth t))
+ (setq dragged t)
+ (adjust-window-trailing-edge window growth t t)))
(draggable
;; Drag horizontal divider.
(setq growth
(if (eq line 'mode)
- (- (cddr position) (nth 3 (window-edges window)) -1)
+ (- (+ (cddr position) height)
+ (nth 3 (window-pixel-edges window)))
;; The window's top includes the header line!
- (- (nth 3 (window-edges window)) (cddr position))))
+ (- (+ (nth 3 (window-pixel-edges window)) height)
+ (cddr position))))
(unless (zerop growth)
- (setq dragged t))
- (adjust-window-trailing-edge window (if (eq line 'mode)
- growth
- (- growth)))))))
+ (setq dragged t)
+ (adjust-window-trailing-edge
+ window (if (eq line 'mode) growth (- growth)) nil t))))))
;; Process the terminating event.
- (unless dragged
+ (when (and (mouse-event-p event) on-link (not dragged)
+ (mouse--remap-link-click-p start-event event))
+ ;; If mouse-2 has never been done by the user, it doesn't have
+ ;; the necessary property to be interpreted correctly.
+ (put 'mouse-2 'event-kind 'mouse-click)
+ (setcar event 'mouse-2)
(push event unread-command-events))))
(defun mouse-drag-mode-line (start-event)
@@ -1936,6 +1954,8 @@ choose a font."
(global-set-key [vertical-scroll-bar C-mouse-2] 'mouse-split-window-vertically)
(global-set-key [vertical-line C-mouse-2] 'mouse-split-window-vertically)
(global-set-key [vertical-line down-mouse-1] 'mouse-drag-vertical-line)
+(global-set-key [right-divider down-mouse-1] 'mouse-drag-vertical-line)
+(global-set-key [bottom-divider down-mouse-1] 'mouse-drag-mode-line)
(global-set-key [vertical-line mouse-1] 'mouse-select-window)
(provide 'mouse)
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index a05452c430c..a3f19b626f2 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -521,7 +521,7 @@ denoting the bus address. SERVICE must be a known service name.
The function returns a keyword, indicating the result of the
operation. One of the following keywords is returned:
-`:released': Service has become the primary owner of the name.
+`:released': We successfully released the service.
`:non-existent': Service name does not exist on this bus.
@@ -530,12 +530,13 @@ queue of this service."
(maphash
(lambda (key value)
- (dolist (elt value)
- (ignore-errors
- (when (and (equal bus (cadr key)) (string-equal service (cadr elt)))
- (unless
- (puthash key (delete elt value) dbus-registered-objects-table)
- (remhash key dbus-registered-objects-table))))))
+ (unless (equal :serial (car key))
+ (dolist (elt value)
+ (ignore-errors
+ (when (and (equal bus (cadr key)) (string-equal service (cadr elt)))
+ (unless
+ (puthash key (delete elt value) dbus-registered-objects-table)
+ (remhash key dbus-registered-objects-table)))))))
dbus-registered-objects-table)
(let ((reply (dbus-call-method
bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus
@@ -827,10 +828,18 @@ STRING shall be UTF8 coded."
(dolist (elt (string-to-list string) (append '(:array) result))
(setq result (append result (list :byte elt)))))))
-(defun dbus-byte-array-to-string (byte-array)
+(defun dbus-byte-array-to-string (byte-array &optional multibyte)
"Transforms BYTE-ARRAY into UTF8 coded string.
-BYTE-ARRAY must be a list of structure (c1 c2 ...)."
- (apply 'string byte-array))
+BYTE-ARRAY must be a list of structure (c1 c2 ...), or a byte
+array as produced by `dbus-string-to-byte-array'. The resulting
+string is unibyte encoded, unless MULTIBYTE is non-nil."
+ (apply
+ (if multibyte 'string 'unibyte-string)
+ (if (equal byte-array '(:array :signature "y"))
+ nil
+ (let (result)
+ (dolist (elt byte-array result)
+ (when (characterp elt) (setq result (append result `(,elt)))))))))
(defun dbus-escape-as-identifier (string)
"Escape an arbitrary STRING so it follows the rules for a C identifier.
@@ -848,7 +857,7 @@ and a smaller allowed set. As a special case, \"\" is escaped to
\"_\".
Returns the escaped string. Algorithm taken from
-telepathy-glib's `tp-escape-as-identifier'."
+telepathy-glib's `tp_escape_as_identifier'."
(if (zerop (length string))
"_"
(replace-regexp-in-string
@@ -857,13 +866,13 @@ telepathy-glib's `tp-escape-as-identifier'."
string)))
(defun dbus-unescape-from-identifier (string)
- "Retrieve the original string from the encoded STRING.
-STRING must have been coded with `dbus-escape-as-identifier'"
+ "Retrieve the original string from the encoded STRING as unibyte string.
+STRING must have been encoded with `dbus-escape-as-identifier'."
(if (string-equal string "_")
""
(replace-regexp-in-string
"_.."
- (lambda (x) (format "%c" (string-to-number (substring x 1) 16)))
+ (lambda (x) (byte-to-string (string-to-number (substring x 1) 16)))
string)))
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 573715e8fcf..9d1c3a26949 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -56,6 +56,33 @@
:group 'eww
:type 'string)
+(defcustom eww-use-external-browser-for-content-type
+ "\\`\\(video/\\|audio/\\|application/ogg\\)"
+ "Always use external browser for specified content-type."
+ :version "24.4"
+ :group 'eww
+ :type '(choice (const :tag "Never" nil)
+ regexp))
+
+(defcustom eww-form-checkbox-selected-symbol "[X]"
+ "Symbol used to represent a selected checkbox.
+See also `eww-form-checkbox-symbol'."
+ :version "24.4"
+ :group 'eww
+ :type '(choice (const "[X]")
+ (const "☒") ; Unicode BALLOT BOX WITH X
+ (const "☑") ; Unicode BALLOT BOX WITH CHECK
+ string))
+
+(defcustom eww-form-checkbox-symbol "[ ]"
+ "Symbol used to represent a checkbox.
+See also `eww-form-checkbox-selected-symbol'."
+ :version "24.4"
+ :group 'eww
+ :type '(choice (const "[ ]")
+ (const "☐") ; Unicode BALLOT BOX
+ string))
+
(defface eww-form-submit
'((((type x w32 ns) (class color)) ; Like default mode line
:box (:line-width 2 :style released-button)
@@ -89,6 +116,8 @@
:group 'eww)
(defvar eww-current-url nil)
+(defvar eww-current-dom nil)
+(defvar eww-current-source nil)
(defvar eww-current-title ""
"Title of current page.")
(defvar eww-history nil)
@@ -101,23 +130,33 @@
(defvar eww-start-url nil)
(defvar eww-contents-url nil)
+(defvar eww-local-regex "localhost"
+ "When this regex is found in the URL, it's not a keyword but an address.")
+
+(defvar eww-link-keymap
+ (let ((map (copy-keymap shr-map)))
+ (define-key map "\r" 'eww-follow-link)
+ map))
+
;;;###autoload
(defun eww (url)
"Fetch URL and render the page.
If the input doesn't look like an URL or a domain name, the
word(s) will be searched for via `eww-search-prefix'."
(interactive "sEnter URL or keywords: ")
- (if (and (= (length (split-string url)) 1)
- (> (length (split-string url "\\.")) 1))
- (progn
- (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url)
- (setq url (concat "http://" url)))
- ;; some site don't redirect final /
- (when (string= (url-filename (url-generic-parse-url url)) "")
- (setq url (concat url "/"))))
- (unless (string-match-p "\\'file:" url)
- (setq url (concat eww-search-prefix
- (replace-regexp-in-string " " "+" url)))))
+ (cond ((string-match-p "\\`file:" url))
+ (t
+ (if (and (= (length (split-string url)) 1)
+ (or (> (length (split-string url "\\.")) 1)
+ (string-match eww-local-regex url)))
+ (progn
+ (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url)
+ (setq url (concat "http://" url)))
+ ;; some site don't redirect final /
+ (when (string= (url-filename (url-generic-parse-url url)) "")
+ (setq url (concat url "/"))))
+ (setq url (concat eww-search-prefix
+ (replace-regexp-in-string " " "+" url))))))
(url-retrieve url 'eww-render (list url)))
;;;###autoload
@@ -137,9 +176,6 @@ word(s) will be searched for via `eww-search-prefix'."
(set (make-local-variable 'eww-start-url) nil)
(set (make-local-variable 'eww-contents-url) nil)
(let* ((headers (eww-parse-headers))
- (shr-target-id
- (and (string-match "#\\(.*\\)" url)
- (match-string 1 url)))
(content-type
(mail-header-parse-content-type
(or (cdr (assoc "content-type" headers))
@@ -153,24 +189,22 @@ word(s) will be searched for via `eww-search-prefix'."
(data-buffer (current-buffer)))
(unwind-protect
(progn
+ (setq eww-current-title "")
(cond
+ ((and eww-use-external-browser-for-content-type
+ (string-match-p eww-use-external-browser-for-content-type
+ (car content-type)))
+ (eww-browse-with-external-browser url))
((equal (car content-type) "text/html")
- (eww-display-html charset url))
- ((string-match "^image/" (car content-type))
- (eww-display-image))
+ (eww-display-html charset url nil point))
+ ((string-match-p "\\`image/" (car content-type))
+ (eww-display-image)
+ (eww-update-header-line-format))
(t
- (eww-display-raw)))
+ (eww-display-raw)
+ (eww-update-header-line-format)))
(setq eww-current-url url
- eww-history-position 0)
- (eww-update-header-line-format)
- (cond
- (point
- (goto-char point))
- (shr-target-id
- (let ((point (next-single-property-change
- (point-min) 'shr-target-id)))
- (when point
- (goto-char (1+ point)))))))
+ eww-history-position 0))
(kill-buffer data-buffer))))
(defun eww-parse-headers ()
@@ -202,7 +236,7 @@ word(s) will be searched for via `eww-search-prefix'."
(declare-function libxml-parse-html-region "xml.c"
(start end &optional base-url))
-(defun eww-display-html (charset url)
+(defun eww-display-html (charset url &optional document point)
(or (fboundp 'libxml-parse-html-region)
(error "This function requires Emacs to be compiled with libxml2"))
(unless (eq charset 'utf8)
@@ -210,13 +244,17 @@ word(s) will be searched for via `eww-search-prefix'."
(decode-coding-region (point) (point-max) charset)
(coding-system-error nil)))
(let ((document
- (list
- 'base (list (cons 'href url))
- (libxml-parse-html-region (point) (point-max)))))
+ (or document
+ (list
+ 'base (list (cons 'href url))
+ (libxml-parse-html-region (point) (point-max))))))
+ (setq eww-current-source (buffer-substring (point) (point-max)))
(eww-setup-buffer)
+ (setq eww-current-dom document)
(let ((inhibit-read-only t)
(after-change-functions nil)
(shr-width nil)
+ (shr-target-id (url-target (url-generic-parse-url url)))
(shr-external-rendering-functions
'((title . eww-tag-title)
(form . eww-tag-form)
@@ -226,8 +264,20 @@ word(s) will be searched for via `eww-search-prefix'."
(select . eww-tag-select)
(link . eww-tag-link)
(a . eww-tag-a))))
- (shr-insert-document document))
- (goto-char (point-min))))
+ (shr-insert-document document)
+ (cond
+ (point
+ (goto-char point))
+ (shr-target-id
+ (let ((point (next-single-property-change
+ (point-min) 'shr-target-id)))
+ (when point
+ (goto-char (1+ point)))))
+ (t
+ (goto-char (point-min)))))
+ (setq eww-current-url url
+ eww-history-position 0)
+ (eww-update-header-line-format)))
(defun eww-handle-link (cont)
(let* ((rel (assq :rel cont))
@@ -259,7 +309,9 @@ word(s) will be searched for via `eww-search-prefix'."
(defun eww-tag-a (cont)
(eww-handle-link cont)
- (shr-tag-a cont))
+ (let ((start (point)))
+ (shr-tag-a cont)
+ (put-text-property start (point) 'keymap eww-link-keymap)))
(defun eww-update-header-line-format ()
(if eww-header-line-format
@@ -325,10 +377,22 @@ word(s) will be searched for via `eww-search-prefix'."
(unless (eq major-mode 'eww-mode)
(eww-mode)))
+(defun eww-view-source ()
+ (interactive)
+ (let ((buf (get-buffer-create "*eww-source*"))
+ (source eww-current-source))
+ (with-current-buffer buf
+ (delete-region (point-min) (point-max))
+ (insert (or eww-current-source "no source"))
+ (goto-char (point-min))
+ (when (featurep 'html-mode)
+ (html-mode)))
+ (view-buffer buf)))
+
(defvar eww-mode-map
(let ((map (make-sparse-keymap)))
(suppress-keymap map)
- (define-key map "q" 'eww-quit)
+ (define-key map "q" 'quit-window)
(define-key map "g" 'eww-reload)
(define-key map [tab] 'shr-next-link)
(define-key map [backtab] 'shr-previous-link)
@@ -345,6 +409,7 @@ word(s) will be searched for via `eww-search-prefix'."
(define-key map "d" 'eww-download)
(define-key map "w" 'eww-copy-page-url)
(define-key map "C" 'url-cookie-list)
+ (define-key map "v" 'eww-view-source)
(define-key map "b" 'eww-add-bookmark)
(define-key map "B" 'eww-list-bookmarks)
@@ -361,6 +426,7 @@ word(s) will be searched for via `eww-search-prefix'."
:active (not (zerop eww-history-position))]
["Browse with external browser" eww-browse-with-external-browser t]
["Download" eww-download t]
+ ["View page source" eww-view-source]
["Copy page URL" eww-copy-page-url t]
["Add bookmark" eww-add-bookmark t]
["List bookmarks" eww-copy-page-url t]
@@ -373,6 +439,8 @@ word(s) will be searched for via `eww-search-prefix'."
\\{eww-mode-map}"
;; FIXME? This seems a strange default.
(set (make-local-variable 'eww-current-url) 'author)
+ (set (make-local-variable 'eww-current-dom) nil)
+ (set (make-local-variable 'eww-current-source) nil)
(set (make-local-variable 'browse-url-browser-function) 'eww-browse-url)
(set (make-local-variable 'after-change-functions) 'eww-process-text-input)
(set (make-local-variable 'eww-history) nil)
@@ -385,6 +453,8 @@ word(s) will be searched for via `eww-search-prefix'."
(push (list :url eww-current-url
:title eww-current-title
:point (point)
+ :dom eww-current-dom
+ :source eww-current-source
:text (buffer-string))
eww-history))
@@ -395,12 +465,6 @@ word(s) will be searched for via `eww-search-prefix'."
(eww-save-history))
(eww url))
-(defun eww-quit ()
- "Exit the Emacs Web Wowser."
- (interactive)
- (setq eww-history nil)
- (kill-buffer (current-buffer)))
-
(defun eww-back-url ()
"Go to the previously displayed page."
(interactive)
@@ -422,9 +486,12 @@ word(s) will be searched for via `eww-search-prefix'."
(let ((inhibit-read-only t))
(erase-buffer)
(insert (plist-get elem :text))
+ (setq eww-current-source (plist-get elem :source))
+ (setq eww-current-dom (plist-get elem :dom))
(goto-char (plist-get elem :point))
(setq eww-current-url (plist-get elem :url)
- eww-current-title (plist-get elem :title))))
+ eww-current-title (plist-get elem :title))
+ (eww-update-header-line-format)))
(defun eww-next-url ()
"Go to the page marked `next'.
@@ -579,8 +646,8 @@ appears in a <link> or <a> tag."
(defun eww-form-checkbox (cont)
(let ((start (point)))
(if (cdr (assq :checked cont))
- (insert "[X]")
- (insert "[ ]"))
+ (insert eww-form-checkbox-selected-symbol)
+ (insert eww-form-checkbox-symbol))
(add-face-text-property start (point) 'eww-form-checkbox)
(put-text-property start (point) 'eww-form
(list :eww-form eww-form
@@ -612,12 +679,19 @@ appears in a <link> or <a> tag."
:name (cdr (assq :name cont))))
(insert " ")))
+(defconst eww-text-input-types '("text" "password" "textarea"
+ "color" "date" "datetime" "datetime-local"
+ "email" "month" "number" "search" "tel"
+ "time" "url" "week")
+ "List of input types which represent a text input.
+See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
+
(defun eww-process-text-input (beg end length)
(let* ((form (get-text-property (min (1+ end) (point-max)) 'eww-form))
(properties (text-properties-at end))
(type (plist-get form :type)))
(when (and form
- (member type '("text" "password" "textarea")))
+ (member type eww-text-input-types))
(cond
((zerop length)
;; Delete some space at the end.
@@ -724,8 +798,14 @@ appears in a <link> or <a> tag."
:eww-form eww-form))
(options nil)
(start (point))
- (max 0))
- (dolist (elem cont)
+ (max 0)
+ opelem)
+ (if (eq (car (car cont)) 'optgroup)
+ (dolist (groupelem cont)
+ (unless (cdr (assq :disabled (cdr groupelem)))
+ (setq opelem (append opelem (cdr (cdr groupelem))))))
+ (setq opelem cont))
+ (dolist (elem opelem)
(when (eq (car elem) 'option)
(when (cdr (assq :selected (cdr elem)))
(nconc menu (list :value
@@ -801,9 +881,9 @@ appears in a <link> or <a> tag."
(if (plist-get input :checked)
(progn
(plist-put input :checked nil)
- (eww-update-field "[ ]"))
+ (eww-update-field eww-form-checkbox-symbol))
(plist-put input :checked t)
- (eww-update-field "[X]"))))
+ (eww-update-field eww-form-checkbox-selected-symbol))))
;; Radio button. Switch all other buttons off.
(let ((name (plist-get input :name)))
(save-excursion
@@ -813,9 +893,9 @@ appears in a <link> or <a> tag."
(if (not (eq (cdr elem) input))
(progn
(plist-put input :checked nil)
- (eww-update-field "[ ]"))
+ (eww-update-field eww-form-checkbox-symbol))
(plist-put input :checked t)
- (eww-update-field "[X]")))))
+ (eww-update-field eww-form-checkbox-selected-symbol)))))
(forward-char 1)))))
(defun eww-inputs (form)
@@ -903,11 +983,41 @@ appears in a <link> or <a> tag."
"?"
(mm-url-encode-www-form-urlencoded values))))))
-(defun eww-browse-with-external-browser ()
+(defun eww-browse-with-external-browser (&optional url)
"Browse the current URL with an external browser.
The browser to used is specified by the `shr-external-browser' variable."
(interactive)
- (funcall shr-external-browser eww-current-url))
+ (funcall shr-external-browser (or url eww-current-url)))
+
+(defun eww-follow-link (&optional external mouse-event)
+ "Browse the URL under point.
+If EXTERNAL, browse the URL using `shr-external-browser'."
+ (interactive (list current-prefix-arg last-nonmenu-event))
+ (mouse-set-point mouse-event)
+ (let ((url (get-text-property (point) 'shr-url)))
+ (cond
+ ((not url)
+ (message "No link under point"))
+ ((string-match "^mailto:" url)
+ (browse-url-mail url))
+ (external
+ (funcall shr-external-browser url))
+ ;; This is a #target url in the same page as the current one.
+ ((and (url-target (url-generic-parse-url url))
+ (eww-same-page-p url eww-current-url))
+ (eww-save-history)
+ (eww-display-html 'utf8 url eww-current-dom))
+ (t
+ (eww-browse-url url)))))
+
+(defun eww-same-page-p (url1 url2)
+ "Return non-nil if both URLs represent the same page.
+Differences in #targets are ignored."
+ (let ((obj1 (url-generic-parse-url url1))
+ (obj2 (url-generic-parse-url url2)))
+ (setf (url-target obj1) nil)
+ (setf (url-target obj2) nil)
+ (equal (url-recreate-url obj1) (url-recreate-url obj2))))
(defun eww-copy-page-url ()
(interactive)
@@ -959,14 +1069,16 @@ The browser to used is specified by the `shr-external-browser' variable."
(when (equal eww-current-url
(plist-get bookmark :url))
(error "Already bookmarked")))
- (let ((title (replace-regexp-in-string "[\n\t\r]" " " eww-current-title)))
- (setq title (replace-regexp-in-string "\\` +\\| +\\'" "" title))
- (push (list :url eww-current-url
- :title title
- :time (current-time-string))
- eww-bookmarks))
- (eww-write-bookmarks)
- (message "Bookmarked %s (%s)" eww-current-url eww-current-title))
+ (if (y-or-n-p "bookmark this page? ")
+ (progn
+ (let ((title (replace-regexp-in-string "[\n\t\r]" " " eww-current-title)))
+ (setq title (replace-regexp-in-string "\\` +\\| +\\'" "" title))
+ (push (list :url eww-current-url
+ :title title
+ :time (current-time-string))
+ eww-bookmarks))
+ (eww-write-bookmarks)
+ (message "Bookmarked %s (%s)" eww-current-url eww-current-title))))
(defun eww-write-bookmarks ()
(with-temp-file (expand-file-name "eww-bookmarks" user-emacs-directory)
@@ -1058,7 +1170,7 @@ The browser to used is specified by the `shr-external-browser' variable."
;; just let it remain.
(ignore-errors
(delete-window))
- (eww (plist-get bookmark :url))))
+ (eww-browse-url (plist-get bookmark :url))))
(defun eww-next-bookmark ()
"Go to the next bookmark in the list."
diff --git a/lisp/net/newst-reader.el b/lisp/net/newst-reader.el
index 21bb890f742..4d2e0118ac0 100644
--- a/lisp/net/newst-reader.el
+++ b/lisp/net/newst-reader.el
@@ -101,15 +101,18 @@ window is used when filling. See also `newsticker-justification'."
:group 'newsticker-reader)
(defcustom newsticker-html-renderer
- nil
+ (if (fboundp 'libxml-parse-html-region)
+ #'shr-render-region)
"Function for rendering HTML contents.
If non-nil, newsticker.el will call this function whenever it
-finds HTML-like tags in item descriptions. Possible functions
-are `w3m-region', `w3-region', and `newsticker-htmlr-render'.
+finds HTML-like tags in item descriptions.
+Possible functions include `shr-render-region', `w3m-region', `w3-region', and
+`newsticker-htmlr-render'.
Newsticker automatically loads the respective package w3m, w3, or
htmlr if this option is set."
:type '(choice :tag "Function"
(const :tag "None" nil)
+ (const :tag "SHR" shr-render-region)
(const :tag "w3" w3-region)
(const :tag "w3m" w3m-region)
(const :tag "htmlr" newsticker-htmlr-render))
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index b742172be46..4c256f8d716 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -849,7 +849,6 @@ START, and END. Note that START and END should be markers."
(shr-ensure-paragraph))
(defun shr-urlify (start url &optional title)
- (when (and title (string-match "ctx" title)) (debug))
(shr-add-font start (point) 'shr-link)
(add-text-properties
start (point)
@@ -1097,17 +1096,84 @@ ones, in case fg and bg are nil."
(shr-urlify start (shr-expand-url url)))
(shr-generic cont)))
+(defcustom shr-prefer-media-type-alist '(("webm" . 1.0)
+ ("ogv" . 1.0)
+ ("ogg" . 1.0)
+ ("opus" . 1.0)
+ ("flac" . 0.9)
+ ("wav" . 0.5))
+ "Preferences for media types.
+The key element should be a regexp matched against the type of the source or
+url if no type is specified. The value should be a float in the range 0.0 to
+1.0. Media elements with higher value are preferred."
+ :version "24.4"
+ :group 'shr
+ :type '(alist :key-type regexp :value-type float))
+
+(defun shr--get-media-pref (elem)
+ "Determine the preference for ELEM.
+The preference is a float determined from `shr-prefer-media-type'."
+ (let ((type (cdr (assq :type elem)))
+ (p 0.0))
+ (unless type
+ (setq type (cdr (assq :src elem))))
+ (when type
+ (dolist (pref shr-prefer-media-type-alist)
+ (when (and
+ (> (cdr pref) p)
+ (string-match-p (car pref) type))
+ (setq p (cdr pref)))))
+ p))
+
+(defun shr--extract-best-source (cont &optional url pref)
+ "Extract the best `:src' property from <source> blocks in CONT."
+ (setq pref (or pref -1.0))
+ (let (new-pref)
+ (dolist (elem cont)
+ (when (and (listp elem)
+ (not (keywordp (car elem)))) ;; skip attributes
+ (when (and (eq (car elem) 'source)
+ (< pref
+ (setq new-pref
+ (shr--get-media-pref elem))))
+ (setq pref new-pref
+ url (cdr (assq :src elem)))
+ (message "new %s %s" url pref))
+ ;; libxml's html parser isn't HTML5 compliant and non terminated
+ ;; source tags might end up as children. So recursion it is...
+ (dolist (child (cdr elem))
+ (when (and (listp child)
+ (not (keywordp (car child))) ;; skip attributes
+ (eq (car child) 'source))
+ (let ((ret (shr--extract-best-source (list child) url pref)))
+ (when (< pref (cdr ret))
+ (setq url (car ret)
+ pref (cdr ret)))))))))
+ (cons url pref))
+
(defun shr-tag-video (cont)
(let ((image (cdr (assq :poster cont)))
- (url (cdr (assq :src cont)))
- (start (point)))
- (shr-tag-img nil image)
+ (url (cdr (assq :src cont)))
+ (start (point)))
+ (unless url
+ (setq url (car (shr--extract-best-source cont))))
+ (if image
+ (shr-tag-img nil image)
+ (shr-insert " [video] "))
+ (shr-urlify start (shr-expand-url url))))
+
+(defun shr-tag-audio (cont)
+ (let ((url (cdr (assq :src cont)))
+ (start (point)))
+ (unless url
+ (setq url (car (shr--extract-best-source cont))))
+ (shr-insert " [audio] ")
(shr-urlify start (shr-expand-url url))))
(defun shr-tag-img (cont &optional url)
(when (or url
(and cont
- (cdr (assq :src cont))))
+ (> (length (cdr (assq :src cont))) 0)))
(when (and (> (current-column) 0)
(not (eq shr-state 'image)))
(insert "\n"))
@@ -1333,7 +1399,7 @@ ones, in case fg and bg are nil."
(if caption `((tr (td ,@caption))))
(if header
(if footer
- ;; hader + body + footer
+ ;; header + body + footer
(if (= nheader nbody)
(if (= nbody nfooter)
`((tr (td (table (tbody ,@header ,@body ,@footer)))))
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index 35f23caa51a..276651576d7 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -85,13 +85,14 @@ When called interactively, a Tramp connection has to be selected."
;; Nothing to do.
(message "No Tramp connection found.")
- ;; Cleanup `tramp-current-connection'. Otherwise, we would be
- ;; suppressed in the test suite.
- (setq tramp-current-connection nil)
-
;; Flush password cache.
(unless keep-password (tramp-clear-passwd vec))
+ ;; Cleanup `tramp-current-connection'. Otherwise, we would be
+ ;; suppressed in the test suite. We use `keep-password' as
+ ;; indicator; it is not worth to add a new argument.
+ (when keep-password (setq tramp-current-connection nil))
+
;; Flush file cache.
(tramp-flush-directory-property vec "")
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 874e50fbfaa..314c1a6f8e7 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -419,8 +419,7 @@ as given in your `~/.profile'."
;;;###tramp-autoload
(defcustom tramp-remote-process-environment
- `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "TMOUT=0"
- "LC_ALL=en_US.utf8" "LC_CTYPE=''"
+ `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "TMOUT=0" "LC_CTYPE=''"
,(format "TERM=%s" tramp-terminal-type)
"EMACS=t" ;; Deprecated.
,(format "INSIDE_EMACS='%s,tramp:%s'" emacs-version tramp-version)
@@ -2493,6 +2492,7 @@ This is like `dired-recursive-delete-directory' for Tramp files."
(filename switches &optional wildcard full-directory-p)
"Like `insert-directory' for Tramp files."
(setq filename (expand-file-name filename))
+ (unless switches (setq switches ""))
(with-parsed-tramp-file-name filename nil
(if (and (featurep 'ls-lisp)
(not (symbol-value 'ls-lisp-use-insert-directory-program)))
@@ -2686,27 +2686,46 @@ the result will be a local, non-Tramp, filename."
(defun tramp-sh-handle-start-file-process (name buffer program &rest args)
"Like `start-file-process' for Tramp files."
(with-parsed-tramp-file-name default-directory nil
- ;; When PROGRAM is nil, we just provide a tty.
- (let ((command
- (when (stringp program)
- (format "cd %s; exec env PS1=%s %s"
- (tramp-shell-quote-argument localname)
- ;; Use a human-friendly prompt, for example for `shell'.
- (tramp-shell-quote-argument
- (format "%s %s"
- (file-remote-p default-directory)
- tramp-initial-end-of-output))
- (mapconcat 'tramp-shell-quote-argument
- (cons program args) " "))))
- (tramp-process-connection-type
- (or (null program) tramp-process-connection-type))
- (bmp (and (buffer-live-p buffer) (buffer-modified-p buffer)))
- (name1 name)
- (i 0)
- ;; We do not want to raise an error when
- ;; `start-file-process' has been started several time in
- ;; `eshell' and friends.
- (tramp-current-connection nil))
+ (let* (;; When PROGRAM matches "*sh", and the first arg is "-c",
+ ;; it might be that the arguments exceed the command line
+ ;; length. Therefore, we modify the command.
+ (heredoc (and (stringp program)
+ (string-match "sh$" program)
+ (string-equal "-c" (car args))
+ (= (length args) 2)))
+ ;; When PROGRAM is nil, we just provide a tty.
+ (args (if (not heredoc) args
+ (let ((i 250))
+ (while (and (< i (length (cadr args)))
+ (string-match " " (cadr args) i))
+ (setcdr
+ args
+ (list (replace-match " \\\\\n" nil nil (cadr args))))
+ (setq i (+ i 250))))
+ (cdr args)))
+ (command
+ (when (stringp program)
+ (format "cd %s; exec %s env PS1=%s %s"
+ (tramp-shell-quote-argument localname)
+ (if heredoc "<<EOF" "")
+ ;; Use a human-friendly prompt, for example for `shell'.
+ (tramp-shell-quote-argument
+ (format "%s %s"
+ (file-remote-p default-directory)
+ tramp-initial-end-of-output))
+ (if heredoc
+ (format "%s\n%s\nEOF" program (car args))
+ (mapconcat 'tramp-shell-quote-argument
+ (cons program args) " ")))))
+ (tramp-process-connection-type
+ (or (null program) tramp-process-connection-type))
+ (bmp (and (buffer-live-p buffer) (buffer-modified-p buffer)))
+ (name1 name)
+ (i 0)
+ ;; We do not want to raise an error when
+ ;; `start-file-process' has been started several time in
+ ;; `eshell' and friends.
+ (tramp-current-connection nil))
(unless buffer
;; BUFFER can be nil. We use a temporary buffer.
@@ -3888,7 +3907,8 @@ process to set up. VEC specifies the connection."
;; Set the environment.
(tramp-message vec 5 "Setting default environment")
- (let ((env (copy-sequence tramp-remote-process-environment))
+ (let ((env (append `(,(tramp-get-remote-locale vec))
+ (copy-sequence tramp-remote-process-environment)))
unset item)
(while env
(setq item (tramp-compat-split-string (car env) "="))
@@ -4826,6 +4846,21 @@ Return ATTR."
x))
remote-path)))))
+(defun tramp-get-remote-locale (vec)
+ (with-tramp-connection-property vec "locale"
+ (tramp-send-command vec "locale -a")
+ (let ((candidates '("en_US.utf8" "C.utf8" "C"))
+ locale)
+ (with-current-buffer (tramp-get-connection-buffer vec)
+ (while candidates
+ (goto-char (point-min))
+ (if (string-match (concat "^" (car candidates) "$") (buffer-string))
+ (setq locale (car candidates)
+ candidates nil)
+ (setq candidates (cdr candidates)))))
+ ;; Return value.
+ (when locale (format "LC_ALL=%s" locale)))))
+
(defun tramp-get-ls-command (vec)
(with-tramp-connection-property vec "ls"
(tramp-message vec 5 "Finding a suitable `ls' command")
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index d0989e79cd3..966a77a2f78 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -884,7 +884,7 @@ See also `tramp-file-name-regexp'.")
;;;###autoload
(defconst tramp-file-name-regexp-unified
(if (memq system-type '(cygwin windows-nt))
- "\\`/[^/|:]\\{2,\\}[^/|]*:"
+ "\\`/\\(\\[.*\\]\\|[^/|:]\\{2,\\}[^/|]*\\):"
"\\`/[^/|:][^/|]*:")
"Value for `tramp-file-name-regexp' for unified remoting.
Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and
diff --git a/lisp/notifications.el b/lisp/notifications.el
index 5c8c8f1dc68..33ae1dee5c1 100644
--- a/lisp/notifications.el
+++ b/lisp/notifications.el
@@ -349,7 +349,7 @@ BUS can be a string denoting a D-Bus connection, the default is `:session'."
notifications-path
notifications-interface
notifications-close-notification-method
- :int32 id))
+ :uint32 id))
(defvar dbus-debug) ; used in the macroexpansion of dbus-ignore-errors
diff --git a/lisp/net/rcompile.el b/lisp/obsolete/rcompile.el
index e7bfbf386f4..6ab015e1658 100644
--- a/lisp/net/rcompile.el
+++ b/lisp/obsolete/rcompile.el
@@ -6,6 +6,7 @@
;; Maintainer: FSF
;; Created: 1993 Oct 6
;; Keywords: tools, processes
+;; Obsolete-since: 24.4
;; This file is part of GNU Emacs.
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index a9d2731892f..fa9dc824c99 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,187 @@
+2013-12-06 Achim Gratz <Stromeko@Stromeko.DE>
+
+ * org-crypt.el: Declare `epg-context´.
+ (org-encrypt-string): Correct indentation.
+
+ * org.el (org-version): Replace `_version´ by `version1´.
+
+2013-12-06 Alexander Vorobiev <alexander.vorobiev@gmail.com> (tiny change)
+
+ * org-compat.el (org-get-x-clipboard): Use w32-get-clipboard-data
+ to get the clipboard data under Windows.
+
+2013-12-06 Bastien Guerry <bzg@gnu.org>
+
+ * ox.el (org-export-with-sub-superscripts):
+ * org.el (org-use-sub-superscripts): Fix version and enhance
+ docstring again.
+
+ * ox.el (org-export-with-sub-superscripts):
+ * org.el (org-use-sub-superscripts): Enhance docstrings.
+
+ * org-macs.el (org-autoload): Delete.
+
+ * org-docview.el ("docview"): Fix declarations and require
+ doc-view directly.
+
+ * org-id.el (org-id-copy)
+ (org-id-get-with-outline-path-completion)
+ (org-id-get-with-outline-drilling, org-id-new):
+
+ * org-colview.el:
+ (org-colview-initial-truncate-line-value)
+ (org-columns-open-link, org-string-to-number):
+ * org-clock.el:
+ (org-clock-put-overlay, org-count-quarter, org-clock-loaded):
+ * org-archive.el (org-get-local-archive-location):
+ * org-agenda.el (org-agenda-todo-custom-ignore-p):
+ Autoload.
+
+ * org.el (org-return-follows-link):
+ * ob-python.el (org-babel-python-command): Don't use :set.
+
+ * ox-odt.el (org-odt-content-template-file): Fix version.
+
+ * ox-texinfo.el (org-texinfo-filename): Fix default value.
+ (org-texinfo-format-headline-function): Use 'ignore as the
+ default value.
+ (org-texinfo-format-drawer-function): Use a function as the
+ default value. Update docstring.
+ (org-texinfo-drawer): Always use
+ `org-texinfo-format-drawer-function' as it is now a function
+ by default.
+ (org-texinfo-headline): Compare
+ `org-texinfo-format-headline-function' against 'ignore.
+ (org-texinfo-inlinetask): Compare
+ `org-texinfo-format-inlinetask-function' against 'ignore.
+
+ * ox-odt.el (org-odt-format-drawer-function): Use a function as
+ the default value. Update docstring.
+ (org-odt-format-headline-function)
+ (org-odt-format-inlinetask-function): Fix default value.
+ (org-odt-drawer): Always use `org-odt-format-drawer-function'
+ as it is now a function by default.
+ (org-odt-format-headline--wrap): Compare
+ `org-odt-format-headline-function' against 'ignore.
+
+ * ox-latex.el (org-latex-format-drawer-function): Use a function
+ as the default value. Update docstring.
+ (org-latex-format-inlinetask-function): Fix default value.
+ (org-latex-drawer): Always use
+ `org-latex-format-drawer-function' as it is now a function by
+ default.
+ (org-latex-inlinetask): Compare
+ `org-latex-format-inlinetask-function' against 'ignore.
+
+ * ox-html.el (org-html-format-drawer-function): Use a function as
+ the default value. Update docstring.
+ (org-html-format-headline-function)
+ (org-html-format-inlinetask-function): Fix default value.
+ (org-html--format-toc-headline)
+ (org-html-format-headline--wrap): Compare
+ `org-html-format-headline-function' against 'ignore.
+ (org-html-inlinetask): Compare
+ `org-html-format-inlinetask-function' against 'ignore.
+
+ * ox-ascii.el (org-ascii-format-drawer-function): Use a
+ function as the default value. Update docstring.
+ (org-ascii-drawer): Always use
+ `org-ascii-format-drawer-function' as it is now a function by
+ default.
+ (org-ascii-format-inlinetask-default): New function.
+ (org-ascii-format-inlinetask-function): Use
+ `org-ascii-format-inlinetask-default' as the default.
+
+ * org.el (org-mouse-1-follows-link): Use :set to set the default
+ value. Update custom type.
+ (org-log-note-headings): Fix order or list items in the custom
+ type.
+ (orgstruct-heading-prefix-regexp): Use an empty string as the
+ default value. Use 'regexp as the custom type.
+ (orgstruct-make-binding): Tiny docstring enhancement. Assume
+ `orgstruct-heading-prefix-regexp' is a string.
+
+ * org-agenda.el (org-agenda-search-view-max-outline-level): Set
+ default value to 0. Update docstring.
+ (org-agenda-deadline-leaders): Fix custom type.
+ (org-search-view): Assume
+ `org-agenda-search-view-max-outline-level' is a number.
+
+ * ob-ruby.el (org-babel-ruby-nil-to): Fix custom type.
+
+ * ob-python.el (org-babel-python-mode): Use :set to set the
+ default value.
+ (org-babel-python-None-to): Fix custom type.
+
+ * ob-plantuml.el (org-plantuml-jar-path): Fix default value.
+ (org-babel-execute:plantuml): Assume `org-plantuml-jar-path' is a
+ string.
+
+ * ob-latex.el (org-babel-latex-htlatex): Fix default value.
+ (org-babel-latex-htlatex-packages): Fix custom type.
+ (org-babel-execute:latex): Assume `org-babel-latex-htlatex' is a
+ string.
+
+ * ox-odt.el (org-odt-display-outline-level): Fix version.
+
+ * ox-odt.el (org-odt-inline-formula-rules)
+ (org-odt-inline-image-rules, org-odt-use-date-fields): Add version
+ and package-version.
+
+ * ox-html.el (org-html-format-drawer-function)
+ (org-html-format-headline-function)
+ (org-html-format-inlinetask-function)
+ (org-html-creator-string): Add version and package-version.
+
+ * ox-html.el (org-html-text-markup-alist): Fix version.
+
+ * org-agenda.el (org-agenda-set-restriction-lock): Autoload.
+
+ * ob-abc.el (org-babel-expand-body:abc): Use dolist.
+ (org-babel-execute:abc): Fix regexp quoting.
+
+ * ob-calc.el (org--var-syms): Rename from `var-syms'.
+
+ * ob-lilypond.el (ly-compile-lilyfile): Remove redundant
+ let-binding.
+
+ * ob-table.el (sbe): Move debug declaration.
+
+ * org-clock.el (org--msg-extra): Rename from `msg-extra'.
+
+2013-12-06 Nicolas Goaziou <n.goaziou@gmail.com>
+
+ * org.el (org-ctrl-c-ctrl-c): When point is on an unsupported
+ object, look for something to do at a higher level instead of
+ bailing out.
+
+ * ox-html.el (org-html-format-latex): Add an argument. Ensure
+ latex header is the same as specified in the original buffer when
+ exporting a LaTeX fragment or environment.
+ (org-html-latex-environment, org-html-latex-fragment): Apply
+ signature change.
+
+ * ox-publish.el (org-publish-cache-ctime-of-src): Return an error
+ when publishing a non-existent file.
+
+ * org-element.el (org-element-paragraph-separate): More accurate
+ regexp.
+
+ * org.el (org-entry-get): Widen buffer in order to retrieve
+ properties, as `org-entry-properties' and
+ `org-entry-get-with-inheritance' already do.
+
+ * ox-html.el (org-html--format-toc-headline): Add missing headline
+ number in TOC entries.
+
+ * org.el (org-entry-properties): Ignore narrowing when retrieving
+ current headline properties.
+
+2013-12-06 Thierry Volpiatto <thierry.volpiatto@gmail.com> (tiny change)
+
+ * org-crypt.el (org-encrypt-string, org-encrypt-entry)
+ (org-decrypt-entry): Fix warning.
+
2013-11-17 Paul Eggert <eggert@cs.ucla.edu>
Spelling fixes.
diff --git a/lisp/org/ob-latex.el b/lisp/org/ob-latex.el
index edc9fe8813f..85918e60bb7 100644
--- a/lisp/org/ob-latex.el
+++ b/lisp/org/ob-latex.el
@@ -50,7 +50,7 @@
'((:results . "latex") (:exports . "results"))
"Default arguments to use when evaluating a LaTeX source block.")
-(defcustom org-babel-latex-htlatex nil
+(defcustom org-babel-latex-htlatex ""
"The htlatex command to enable conversion of latex to SVG or HTML."
:group 'org-babel
:type 'string)
@@ -59,7 +59,7 @@
'("[usenames]{color}" "{tikz}" "{color}" "{listings}" "{amsmath}")
"Packages to use for htlatex export."
:group 'org-babel
- :type '(list string))
+ :type '(list (string)))
(defun org-babel-expand-body:latex (body params)
"Expand BODY according to PARAMS, return the expanded body."
@@ -141,7 +141,7 @@ This function is called by `org-babel-execute-src-block'."
(delete-file transient-pdf-file))))))
((and (or (string-match "\\.svg$" out-file)
(string-match "\\.html$" out-file))
- org-babel-latex-htlatex)
+ (not (string= "" org-babel-latex-htlatex)))
(with-temp-file tex-file
(insert (concat
"\\documentclass[preview]{standalone}
diff --git a/lisp/org/ob-plantuml.el b/lisp/org/ob-plantuml.el
index c17d4448a3c..f992d04da52 100644
--- a/lisp/org/ob-plantuml.el
+++ b/lisp/org/ob-plantuml.el
@@ -40,7 +40,7 @@
'((:results . "file") (:exports . "results"))
"Default arguments for evaluating a plantuml source block.")
-(defcustom org-plantuml-jar-path nil
+(defcustom org-plantuml-jar-path ""
"Path to the plantuml.jar file."
:group 'org-babel
:version "24.1"
@@ -55,7 +55,7 @@ This function is called by `org-babel-execute-src-block'."
(cmdline (cdr (assoc :cmdline params)))
(in-file (org-babel-temp-file "plantuml-"))
(java (or (cdr (assoc :java params)) ""))
- (cmd (if (not org-plantuml-jar-path)
+ (cmd (if (string= "" org-plantuml-jar-path)
(error "`org-plantuml-jar-path' is not set")
(concat "java " java " -jar "
(shell-quote-argument
diff --git a/lisp/org/ob-python.el b/lisp/org/ob-python.el
index 99c35ce2863..3c3f6646877 100644
--- a/lisp/org/ob-python.el
+++ b/lisp/org/ob-python.el
@@ -54,7 +54,7 @@ This will typically be either 'python or 'python-mode."
:group 'org-babel
:version "24.4"
:package-version '(Org . "8.0")
- :type 'function)
+ :type 'symbol)
(defvar org-src-preserve-indentation)
@@ -70,7 +70,7 @@ This will typically be either 'python or 'python-mode."
:group 'org-babel
:version "24.4"
:package-version '(Org . "8.0")
- :type 'string)
+ :type 'symbol)
(defun org-babel-execute:python (body params)
"Execute a block of Python code with Babel.
diff --git a/lisp/org/ob-ruby.el b/lisp/org/ob-ruby.el
index fe1ee0ff098..34b9eaf47ca 100644
--- a/lisp/org/ob-ruby.el
+++ b/lisp/org/ob-ruby.el
@@ -62,9 +62,7 @@
:group 'org-babel
:version "24.4"
:package-version '(Org . "8.0")
- :type 'string)
-
-
+ :type 'symbol)
(defun org-babel-execute:ruby (body params)
"Execute a block of Ruby code with Babel.
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index 5ef92f7aaeb..4dfa3e9e3cf 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -1419,13 +1419,14 @@ When nil, they may also match part of a word."
:version "24.1"
:type 'boolean)
-(defcustom org-agenda-search-view-max-outline-level nil
+(defcustom org-agenda-search-view-max-outline-level 0
"Maximum outline level to display in search view.
E.g. when this is set to 1, the search view will only
-show headlines of level 1."
+show headlines of level 1. When set to 0, the default
+value, don't limit agenda view by outline level."
:group 'org-agenda-search-view
:version "24.4"
- :package-version '(Org . "8.0")
+ :package-version '(Org . "8.3")
:type 'integer)
(defgroup org-agenda-time-grid nil
@@ -1746,10 +1747,9 @@ to capture the number of days."
:version "24.4"
:package-version '(Org . "8.0")
:type '(list
- (string :tag "Deadline today ")
- (choice :tag "Deadline relative"
- (string :tag "Format string")
- (function))))
+ (string :tag "Deadline today ")
+ (string :tag "Deadline in the future ")
+ (string :tag "Deadline in the past ")))
(defcustom org-agenda-remove-times-when-in-prefix t
"Non-nil means remove duplicate time specifications in agenda items.
@@ -4583,7 +4583,7 @@ in `org-agenda-text-search-extra-files'."
(goto-char (max (point-min) (1- (point))))
(while (re-search-forward regexp nil t)
(org-back-to-heading t)
- (while (and org-agenda-search-view-max-outline-level
+ (while (and (not (zerop org-agenda-search-view-max-outline-level))
(> (org-reduced-level (org-outline-level))
org-agenda-search-view-max-outline-level)
(forward-line -1)
@@ -4593,7 +4593,7 @@ in `org-agenda-text-search-extra-files'."
beg1 (point)
end (progn
(outline-next-heading)
- (while (and org-agenda-search-view-max-outline-level
+ (while (and (not (zerop org-agenda-search-view-max-outline-level))
(> (org-reduced-level (org-outline-level))
org-agenda-search-view-max-outline-level)
(forward-line 1)
@@ -5451,6 +5451,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
(>= days n)
(<= days n))))
+;;;###autoload
(defun org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item
(&optional end)
"Do we have a reason to ignore this TODO entry because it has a time stamp?"
diff --git a/lisp/org/org-archive.el b/lisp/org/org-archive.el
index d5bdff16f9b..3dc52c1c990 100644
--- a/lisp/org/org-archive.el
+++ b/lisp/org/org-archive.el
@@ -135,6 +135,7 @@ information."
(match-string 1))
(t org-archive-location))))))
+;;;###autoload
(defun org-add-archive-files (files)
"Splice the archive files into the list of files.
This implies visiting all these files and finding out what the
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 978bde475d4..3238c8ca947 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -1871,6 +1871,7 @@ will be easy to remove."
(overlay-put ov 'end-glyph (make-glyph tx)))
(push ov org-clock-overlays)))
+;;;###autoload
(defun org-clock-remove-overlays (&optional beg end noremove)
"Remove the occur highlights from the buffer.
BEG and END are ignored. If NOREMOVE is nil, remove this function
@@ -2143,6 +2144,7 @@ If you can combine both, the month starting day will have priority."
((= n 3) "3rd")
((= n 4) "4th")))
+;;;###autoload
(defun org-clocktable-shift (dir n)
"Try to shift the :block date of the clocktable at point.
Point must be in the #+BEGIN: line of a clocktable, or this function
@@ -2752,6 +2754,7 @@ This function is made for clock tables."
(defvar org-clock-loaded nil
"Was the clock file loaded?")
+;;;###autoload
(defun org-clock-update-time-maybe ()
"If this is a CLOCK line, update it and return t.
Otherwise, return nil."
diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el
index 523b42186b4..361560dcbaf 100644
--- a/lisp/org/org-colview.el
+++ b/lisp/org/org-colview.el
@@ -323,6 +323,7 @@ for the duration of the command.")
(defvar org-colview-initial-truncate-line-value nil
"Remember the value of `truncate-lines' across colview.")
+;;;###autoload
(defun org-columns-remove-overlays ()
"Remove all currently active column overlays."
(interactive)
@@ -670,6 +671,7 @@ around it."
(let ((value (get-char-property (point) 'org-columns-value)))
(org-open-link-from-string value arg)))
+;;;###autoload
(defun org-columns-get-format-and-top-level ()
(let ((fmt (org-columns-get-format)))
(org-columns-goto-top-level)
@@ -951,6 +953,8 @@ display, or in the #+COLUMNS line of the current buffer."
(defvar org-inlinetask-min-level
(if (featurep 'org-inlinetask) org-inlinetask-min-level 15))
+
+;;;###autoload
(defun org-columns-compute (property)
"Sum the values of property PROPERTY hierarchically, for the entire buffer."
(interactive)
@@ -1054,6 +1058,7 @@ display, or in the #+COLUMNS line of the current buffer."
(setq sum (+ (string-to-number (pop l)) (/ sum 60))))
sum)))
+;;;###autoload
(defun org-columns-number-to-string (n fmt &optional printf)
"Convert a computed column number to a string value, according to FMT."
(cond
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index b714f13a663..a3eb960e134 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -190,10 +190,12 @@ If DELETE is non-nil, delete all those overlays."
found))
(defun org-get-x-clipboard (value)
- "Get the value of the x clipboard, compatible with XEmacs, and GNU Emacs 21."
- (if (eq window-system 'x)
- (let ((x (org-get-x-clipboard-compat value)))
- (if x (org-no-properties x)))))
+ "Get the value of the x or Windows clipboard, compatible with XEmacs, and GNU Emacs 21."
+ (cond ((eq window-system 'x)
+ (let ((x (org-get-x-clipboard-compat value)))
+ (if x (org-no-properties x))))
+ ((and (eq window-system 'w32) (fboundp 'w32-get-clipboard-data))
+ (w32-get-clipboard-data))))
(defsubst org-decompose-region (beg end)
"Decompose from BEG to END."
diff --git a/lisp/org/org-crypt.el b/lisp/org/org-crypt.el
index b02a7ceffbd..2024144fa57 100644
--- a/lisp/org/org-crypt.el
+++ b/lisp/org/org-crypt.el
@@ -73,6 +73,8 @@
compress-algorithm))
(declare-function epg-encrypt-string "epg"
(context plain recipients &optional sign always-trust))
+(defvar epg-context)
+
(defgroup org-crypt nil
"Org Crypt."
@@ -161,8 +163,8 @@ See `org-crypt-disable-auto-save'."
(if (and (string= crypt-key (get-text-property 0 'org-crypt-key str))
(string= (sha1 str) (get-text-property 0 'org-crypt-checksum str)))
(get-text-property 0 'org-crypt-text str)
- (let ((epg-context (epg-make-context nil t t)))
- (epg-encrypt-string epg-context str (epg-list-keys epg-context crypt-key)))))
+ (set (make-local-variable 'epg-context) (epg-make-context nil t t))
+ (epg-encrypt-string epg-context str (epg-list-keys epg-context crypt-key))))
(defun org-encrypt-entry ()
"Encrypt the content of the current headline."
@@ -170,11 +172,11 @@ See `org-crypt-disable-auto-save'."
(require 'epg)
(save-excursion
(org-back-to-heading t)
+ (set (make-local-variable 'epg-context) (epg-make-context nil t t))
(let ((start-heading (point)))
(forward-line)
(when (not (looking-at "-----BEGIN PGP MESSAGE-----"))
(let ((folded (outline-invisible-p))
- (epg-context (epg-make-context nil t t))
(crypt-key (org-crypt-key-for-heading))
(beg (point))
end encrypted-text)
@@ -206,11 +208,11 @@ See `org-crypt-disable-auto-save'."
(forward-line)
(when (looking-at "-----BEGIN PGP MESSAGE-----")
(org-crypt-check-auto-save)
+ (set (make-local-variable 'epg-context) (epg-make-context nil t t))
(let* ((end (save-excursion
(search-forward "-----END PGP MESSAGE-----")
(forward-line)
(point)))
- (epg-context (epg-make-context nil t t))
(encrypted-text (buffer-substring-no-properties (point) end))
(decrypted-text
(decode-coding-string
diff --git a/lisp/org/org-docview.el b/lisp/org/org-docview.el
index 72ccc46d62a..8e61c8ab1df 100644
--- a/lisp/org/org-docview.el
+++ b/lisp/org/org-docview.el
@@ -44,12 +44,10 @@
(require 'org)
+(require 'doc-view)
-(declare-function doc-view-goto-page "ext:doc-view" (page))
-(declare-function image-mode-window-get "ext:image-mode"
- (prop &optional winprops))
-
-(org-autoload "doc-view" '(doc-view-goto-page))
+(declare-function doc-view-goto-page "doc-view" (page))
+(declare-function image-mode-window-get "image-mode" (prop &optional winprops))
(org-add-link-type "docview" 'org-docview-open 'org-docview-export)
(add-hook 'org-store-link-functions 'org-docview-store-link)
diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el
index 55efb500843..61623833f77 100644
--- a/lisp/org/org-element.el
+++ b/lisp/org/org-element.el
@@ -143,10 +143,12 @@
"$" "\\|"
;; Tables (any type).
"\\(?:|\\|\\+-[-+]\\)" "\\|"
- ;; Blocks (any type), Babel calls, drawers (any type),
- ;; fixed-width areas and keywords. Note: this is only an
- ;; indication and need some thorough check.
- "[#:]" "\\|"
+ ;; Blocks (any type), Babel calls and keywords. Note: this
+ ;; is only an indication and need some thorough check.
+ "#\\(?:[+ ]\\|$\\)" "\\|"
+ ;; Drawers (any type) and fixed-width areas. This is also
+ ;; only an indication.
+ ":" "\\|"
;; Horizontal rules.
"-\\{5,\\}[ \t]*$" "\\|"
;; LaTeX environments.
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el
index f1fa05bdc70..37f6e70e821 100644
--- a/lisp/org/org-id.el
+++ b/lisp/org/org-id.el
@@ -233,6 +233,7 @@ With optional argument FORCE, force the creation of a new ID."
(org-entry-put (point) "ID" nil))
(org-id-get (point) 'create))
+;;;###autoload
(defun org-id-copy ()
"Copy the ID of the entry at point to the kill ring.
Create an ID if necessary."
@@ -258,6 +259,7 @@ In any case, the ID of the entry is returned."
(org-id-add-location id (buffer-file-name (buffer-base-buffer)))
id)))))
+;;;###autoload
(defun org-id-get-with-outline-path-completion (&optional targets)
"Use `outline-path-completion' to retrieve the ID of an entry.
TARGETS may be a setting for `org-refile-targets' to define
@@ -274,6 +276,7 @@ If necessary, the ID is created."
(prog1 (org-id-get pom 'create)
(move-marker pom nil))))
+;;;###autoload
(defun org-id-get-with-outline-drilling (&optional targets)
"Use an outline-cycling interface to retrieve the ID of an entry.
This only finds entries in the current buffer, using `org-get-location'.
@@ -320,6 +323,7 @@ With optional argument MARKERP, return the position as a new marker."
;; Creating new IDs
+;;;###autoload
(defun org-id-new (&optional prefix)
"Create a new globally unique ID.
diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el
index 0083d293edc..4afbace56c1 100644
--- a/lisp/org/org-macs.el
+++ b/lisp/org/org-macs.el
@@ -283,14 +283,6 @@ we turn off invisibility temporarily. Use this in a `let' form."
(<= (match-beginning n) pos)
(>= (match-end n) pos)))
-(defun org-autoload (file functions)
- "Establish autoload for all FUNCTIONS in FILE, if not bound already."
- (let ((d (format "Documentation will be available after `%s.el' is loaded."
- file))
- f)
- (while (setq f (pop functions))
- (or (fboundp f) (autoload f file d t)))))
-
(defun org-match-line (re)
"Looking-at at the beginning of the current line."
(save-excursion
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index 1ef90443935..8418cf6fbd1 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.el
@@ -915,6 +915,7 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
(setq org-table-may-need-update nil)
))
+;;;###autoload
(defun org-table-begin (&optional table-type)
"Find the beginning of the table and return its position.
With argument TABLE-TYPE, go to the beginning of a table.el-type table."
@@ -928,6 +929,7 @@ With argument TABLE-TYPE, go to the beginning of a table.el-type table."
(beginning-of-line 2)
(point))))
+;;;###autoload
(defun org-table-end (&optional table-type)
"Find the end of the table and return its position.
With argument TABLE-TYPE, go to the end of a table.el-type table."
@@ -1199,6 +1201,7 @@ Return t when the line exists, nil if it does not exist."
(< (setq cnt (1+ cnt)) N)))
(= cnt N)))
+;;;###autoload
(defun org-table-blank-field ()
"Blank the current table field or active region."
(interactive)
@@ -4121,7 +4124,7 @@ to execute outside of tables."
'(arg)
(concat "In tables, run `" (symbol-name fun) "'.\n"
"Outside of tables, run the binding of `"
- (mapconcat (lambda (x) (format "%s" x)) keys "' or `")
+ (mapconcat #'key-description keys "' or `")
"'.")
'(interactive "p")
(list 'if
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 50d3842e03d..adaabebc6a5 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -309,7 +309,7 @@ When MESSAGE is non-nil, display a message with the version."
(if here
(insert version)
(message version))
- (if message (message _version))
+ (if message (message version1))
version1)))
(defconst org-version (org-version))
@@ -654,11 +654,17 @@ the following lines anywhere in the buffer:
(defcustom org-use-sub-superscripts t
"Non-nil means interpret \"_\" and \"^\" for display.
-When this option is turned on, you can use TeX-like syntax for sub- and
-superscripts. Several characters after \"_\" or \"^\" will be
-considered as a single item - so grouping with {} is normally not
-needed. For example, the following things will be parsed as single
-sub- or superscripts.
+
+If you want to control how Org exports those characters, see
+`org-export-with-sub-superscripts'. `org-use-sub-superscripts'
+used to be an alias for `org-export-with-sub-superscripts' in
+Org <8.0, it is not anymore.
+
+When this option is turned on, you can use TeX-like syntax for
+sub- and superscripts within the buffer. Several characters after
+\"_\" or \"^\" will be considered as a single item - so grouping
+with {} is normally not needed. For example, the following things
+will be parsed as single sub- or superscripts:
10^24 or 10^tau several digits will be considered 1 item.
10^-12 or 10^-tau a leading sign with digits or a word
@@ -666,13 +672,14 @@ sub- or superscripts.
terminated by almost any nonword/nondigit char.
x_{i^2} or x^(2-i) braces or parenthesis do grouping.
-Still, ambiguity is possible - so when in doubt use {} to enclose
-the sub/superscript. If you set this variable to the symbol
-`{}', the braces are *required* in order to trigger
-interpretations as sub/superscript. This can be helpful in
-documents that need \"_\" frequently in plain text."
+Still, ambiguity is possible. So when in doubt, use {} to enclose
+the sub/superscript. If you set this variable to the symbol `{}',
+the braces are *required* in order to trigger interpretations as
+sub/superscript. This can be helpful in documents that need \"_\"
+frequently in plain text."
:group 'org-startup
- :version "24.1"
+ :version "24.4"
+ :package-version '(Org . "8.0")
:type '(choice
(const :tag "Always interpret" t)
(const :tag "Only with braces" {})
@@ -1731,7 +1738,12 @@ In tables, the special behavior of RET has precedence."
A longer mouse click will still set point. Does not work on XEmacs.
Needs to be set before org.el is loaded."
:group 'org-link-follow
- :type 'boolean)
+ :version "24.4"
+ :package-version '(Org . "8.3")
+ :type '(choice
+ (const :tag "A double click follows the link" 'double)
+ (const :tag "Unconditionally follow the link with mouse-1" t)
+ (integer :tag "mouse-1 click does not follow the link if longer than N ms" 450)))
(defcustom org-mark-ring-length 4
"Number of different positions to be recorded in the ring.
@@ -2663,12 +2675,12 @@ agenda log mode depends on the format of these entries."
"Heading when changing todo state (todo sequence only)"
state) string)
(cons (const :tag "Heading when just taking a note" note) string)
- (cons (const :tag "Heading when clocking out" clock-out) string)
- (cons (const :tag "Heading when an item is no longer scheduled" delschedule) string)
(cons (const :tag "Heading when rescheduling" reschedule) string)
+ (cons (const :tag "Heading when an item is no longer scheduled" delschedule) string)
(cons (const :tag "Heading when changing deadline" redeadline) string)
(cons (const :tag "Heading when deleting a deadline" deldeadline) string)
- (cons (const :tag "Heading when refiling" refile) string)))
+ (cons (const :tag "Heading when refiling" refile) string)
+ (cons (const :tag "Heading when clocking out" clock-out) string)))
(unless (assq 'note org-log-note-headings)
(push '(note . "%t") org-log-note-headings))
@@ -4242,12 +4254,6 @@ Normal means, no org-mode-specific context."
"Detect the first line outside a table when searching from within it.
This works for both table types.")
-;; Autoload the functions in org-table.el that are needed by functions here.
-
-(eval-and-compile
- (org-autoload "org-table"
- '(org-table-begin org-table-blank-field org-table-end)))
-
(defconst org-TBLFM-regexp "^[ \t]*#\\+TBLFM: "
"Detect a #+TBLFM line.")
@@ -4328,12 +4334,6 @@ If TABLE-TYPE is non-nil, also check for table.el-type tables."
(re-search-forward org-table-any-border-regexp nil 1))))
(unless quietly (message "Mapping tables: done")))
-;; Declare and autoload functions from org-agenda.el
-
-(eval-and-compile
- (org-autoload "org-agenda"
- '(org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item)))
-
(declare-function org-clock-save-markers-for-cut-and-paste "org-clock" (beg end))
(declare-function org-clock-update-mode-line "org-clock" ())
(declare-function org-resolve-clocks "org-clock"
@@ -4359,11 +4359,6 @@ If TABLE-TYPE is non-nil, also check for table.el-type tables."
Return nil if no clock is running."
(marker-buffer org-clock-marker))
-(eval-and-compile
- (org-autoload "org-clock" '(org-clock-remove-overlays
- org-clock-update-time-maybe
- org-clocktable-shift)))
-
(defun org-check-running-clock ()
"Check if the current buffer contains the running clock.
If yes, offer to stop it and to save the buffer with the changes."
@@ -4563,33 +4558,18 @@ Otherwise, these types are allowed:
(defalias 'org-advertized-archive-subtree 'org-archive-subtree)
-(eval-and-compile
- (org-autoload "org-archive"
- '(org-add-archive-files)))
-
-;; Autoload Column View Code
+;; Declare Column View Code
(declare-function org-columns-number-to-string "org-colview" (n fmt &optional printf))
(declare-function org-columns-get-format-and-top-level "org-colview" ())
(declare-function org-columns-compute "org-colview" (property))
-(org-autoload (if (featurep 'xemacs) "org-colview-xemacs" "org-colview")
- '(org-columns-number-to-string
- org-columns-get-format-and-top-level
- org-columns-compute
- org-columns-remove-overlays))
-
-;; Autoload ID code
+;; Declare ID code
(declare-function org-id-store-link "org-id")
(declare-function org-id-locations-load "org-id")
(declare-function org-id-locations-save "org-id")
(defvar org-id-track-globally)
-(org-autoload "org-id"
- '(org-id-new
- org-id-copy
- org-id-get-with-outline-path-completion
- org-id-get-with-outline-drilling))
;;; Variables for pre-computed regular expressions, all buffer local
@@ -8850,13 +8830,13 @@ If WITH-CASE is non-nil, the sorting will be case-sensitive."
;; command. There might be problems if any of the keys is otherwise
;; used as a prefix key.
-(defcustom orgstruct-heading-prefix-regexp nil
+(defcustom orgstruct-heading-prefix-regexp ""
"Regexp that matches the custom prefix of Org headlines in
orgstruct(++)-mode."
:group 'org
:version "24.4"
- :package-version '(Org . "8.0")
- :type 'string)
+ :package-version '(Org . "8.3")
+ :type 'regexp)
;;;###autoload(put 'orgstruct-heading-prefix-regexp 'safe-local-variable 'stringp)
(defcustom orgstruct-setup-hook nil
@@ -9017,8 +8997,8 @@ buffer. It will also recognize item context in multiline items."
"Create a function for binding in the structure minor mode.
FUN is the command to call inside a table. KEY is the key that
should be checked in for a command to execute outside of tables.
-Non-nil DISABLE-WHEN-HEADING-PREFIX means to disable the command
-if `orgstruct-heading-prefix-regexp' is non-nil."
+Non-nil `disable-when-heading-prefix' means to disable the command
+if `orgstruct-heading-prefix-regexp' is not empty."
(let ((name (concat "orgstruct-hijacker-" (symbol-name fun))))
(let ((nname name)
(i 0))
@@ -9044,14 +9024,13 @@ if `orgstruct-heading-prefix-regexp' is non-nil."
(key-description key) "'."
(when disable-when-heading-prefix
(concat
- "\nIf `orgstruct-heading-prefix-regexp' is non-nil, this command will always fall\n"
+ "\nIf `orgstruct-heading-prefix-regexp' is not empty, this command will always fall\n"
"back to the default binding due to limitations of Org's implementation of\n"
"`" (symbol-name fun) "'.")))
(interactive "p")
(let* ((disable
- ,(when disable-when-heading-prefix
- '(and orgstruct-heading-prefix-regexp
- (not (string= orgstruct-heading-prefix-regexp "")))))
+ ,(and disable-when-heading-prefix
+ '(not (string= orgstruct-heading-prefix-regexp ""))))
(fallback
(or disable
(not
@@ -15204,103 +15183,102 @@ is a string only get exactly this property. SPECIFIC can be a string, the
specific property we are interested in. Specifying it can speed
things up because then unnecessary parsing is avoided."
(setq which (or which 'all))
- (org-with-point-at pom
- (let ((clockstr (substring org-clock-string 0 -1))
- (excluded '("TODO" "TAGS" "ALLTAGS" "PRIORITY" "BLOCKED"))
- (case-fold-search nil)
- beg end range props sum-props key key1 value string clocksum clocksumt)
- (save-excursion
- (when (condition-case nil
- (and (derived-mode-p 'org-mode) (org-back-to-heading t))
- (error nil))
- (setq beg (point))
- (setq sum-props (get-text-property (point) 'org-summaries))
- (setq clocksum (get-text-property (point) :org-clock-minutes)
- clocksumt (get-text-property (point) :org-clock-minutes-today))
- (outline-next-heading)
- (setq end (point))
- (when (memq which '(all special))
- ;; Get the special properties, like TODO and tags
- (goto-char beg)
- (when (and (or (not specific) (string= specific "TODO"))
- (looking-at org-todo-line-regexp) (match-end 2))
- (push (cons "TODO" (org-match-string-no-properties 2)) props))
- (when (and (or (not specific) (string= specific "PRIORITY"))
- (looking-at org-priority-regexp))
- (push (cons "PRIORITY" (org-match-string-no-properties 2)) props))
- (when (or (not specific) (string= specific "FILE"))
- (push (cons "FILE" buffer-file-name) props))
- (when (and (or (not specific) (string= specific "TAGS"))
- (setq value (org-get-tags-string))
- (string-match "\\S-" value))
- (push (cons "TAGS" value) props))
- (when (and (or (not specific) (string= specific "ALLTAGS"))
- (setq value (org-get-tags-at)))
- (push (cons "ALLTAGS" (concat ":" (mapconcat 'identity value ":")
- ":"))
- props))
- (when (or (not specific) (string= specific "BLOCKED"))
- (push (cons "BLOCKED" (if (org-entry-blocked-p) "t" "")) props))
- (when (or (not specific)
- (member specific
- '("SCHEDULED" "DEADLINE" "CLOCK" "CLOSED"
- "TIMESTAMP" "TIMESTAMP_IA")))
- (catch 'match
- (while (re-search-forward org-maybe-keyword-time-regexp end t)
- (setq key (if (match-end 1)
- (substring (org-match-string-no-properties 1)
- 0 -1))
- string (if (equal key clockstr)
- (org-trim
- (buffer-substring-no-properties
- (match-beginning 3) (goto-char
- (point-at-eol))))
- (substring (org-match-string-no-properties 3)
- 1 -1)))
- ;; Get the correct property name from the key. This is
- ;; necessary if the user has configured time keywords.
- (setq key1 (concat key ":"))
- (cond
- ((not key)
- (setq key
- (if (= (char-after (match-beginning 3)) ?\[)
- "TIMESTAMP_IA" "TIMESTAMP")))
- ((equal key1 org-scheduled-string) (setq key "SCHEDULED"))
- ((equal key1 org-deadline-string) (setq key "DEADLINE"))
- ((equal key1 org-closed-string) (setq key "CLOSED"))
- ((equal key1 org-clock-string) (setq key "CLOCK")))
- (if (and specific (equal key specific) (not (equal key "CLOCK")))
- (progn
- (push (cons key string) props)
- ;; no need to search further if match is found
- (throw 'match t))
- (when (or (equal key "CLOCK") (not (assoc key props)))
- (push (cons key string) props)))))))
-
- (when (memq which '(all standard))
- ;; Get the standard properties, like :PROP: ...
- (setq range (org-get-property-block beg end))
- (when range
- (goto-char (car range))
- (while (re-search-forward org-property-re
- (cdr range) t)
- (setq key (org-match-string-no-properties 2)
- value (org-trim (or (org-match-string-no-properties 3) "")))
- (unless (member key excluded)
- (push (cons key (or value "")) props)))))
- (if clocksum
- (push (cons "CLOCKSUM"
- (org-columns-number-to-string (/ (float clocksum) 60.)
- 'add_times))
- props))
- (if clocksumt
- (push (cons "CLOCKSUM_T"
- (org-columns-number-to-string (/ (float clocksumt) 60.)
- 'add_times))
- props))
- (unless (assoc "CATEGORY" props)
- (push (cons "CATEGORY" (org-get-category)) props))
- (append sum-props (nreverse props)))))))
+ (org-with-wide-buffer
+ (org-with-point-at pom
+ (let ((clockstr (substring org-clock-string 0 -1))
+ (excluded '("TODO" "TAGS" "ALLTAGS" "PRIORITY" "BLOCKED"))
+ (case-fold-search nil)
+ beg end range props sum-props key key1 value string clocksum clocksumt)
+ (when (and (derived-mode-p 'org-mode)
+ (ignore-errors (org-back-to-heading t)))
+ (setq beg (point))
+ (setq sum-props (get-text-property (point) 'org-summaries))
+ (setq clocksum (get-text-property (point) :org-clock-minutes)
+ clocksumt (get-text-property (point) :org-clock-minutes-today))
+ (outline-next-heading)
+ (setq end (point))
+ (when (memq which '(all special))
+ ;; Get the special properties, like TODO and tags
+ (goto-char beg)
+ (when (and (or (not specific) (string= specific "TODO"))
+ (looking-at org-todo-line-regexp) (match-end 2))
+ (push (cons "TODO" (org-match-string-no-properties 2)) props))
+ (when (and (or (not specific) (string= specific "PRIORITY"))
+ (looking-at org-priority-regexp))
+ (push (cons "PRIORITY" (org-match-string-no-properties 2)) props))
+ (when (or (not specific) (string= specific "FILE"))
+ (push (cons "FILE" buffer-file-name) props))
+ (when (and (or (not specific) (string= specific "TAGS"))
+ (setq value (org-get-tags-string))
+ (string-match "\\S-" value))
+ (push (cons "TAGS" value) props))
+ (when (and (or (not specific) (string= specific "ALLTAGS"))
+ (setq value (org-get-tags-at)))
+ (push (cons "ALLTAGS" (concat ":" (mapconcat 'identity value ":")
+ ":"))
+ props))
+ (when (or (not specific) (string= specific "BLOCKED"))
+ (push (cons "BLOCKED" (if (org-entry-blocked-p) "t" "")) props))
+ (when (or (not specific)
+ (member specific
+ '("SCHEDULED" "DEADLINE" "CLOCK" "CLOSED"
+ "TIMESTAMP" "TIMESTAMP_IA")))
+ (catch 'match
+ (while (re-search-forward org-maybe-keyword-time-regexp end t)
+ (setq key (if (match-end 1)
+ (substring (org-match-string-no-properties 1)
+ 0 -1))
+ string (if (equal key clockstr)
+ (org-trim
+ (buffer-substring-no-properties
+ (match-beginning 3) (goto-char
+ (point-at-eol))))
+ (substring (org-match-string-no-properties 3)
+ 1 -1)))
+ ;; Get the correct property name from the key. This is
+ ;; necessary if the user has configured time keywords.
+ (setq key1 (concat key ":"))
+ (cond
+ ((not key)
+ (setq key
+ (if (= (char-after (match-beginning 3)) ?\[)
+ "TIMESTAMP_IA" "TIMESTAMP")))
+ ((equal key1 org-scheduled-string) (setq key "SCHEDULED"))
+ ((equal key1 org-deadline-string) (setq key "DEADLINE"))
+ ((equal key1 org-closed-string) (setq key "CLOSED"))
+ ((equal key1 org-clock-string) (setq key "CLOCK")))
+ (if (and specific (equal key specific) (not (equal key "CLOCK")))
+ (progn
+ (push (cons key string) props)
+ ;; no need to search further if match is found
+ (throw 'match t))
+ (when (or (equal key "CLOCK") (not (assoc key props)))
+ (push (cons key string) props)))))))
+
+ (when (memq which '(all standard))
+ ;; Get the standard properties, like :PROP: ...
+ (setq range (org-get-property-block beg end))
+ (when range
+ (goto-char (car range))
+ (while (re-search-forward org-property-re
+ (cdr range) t)
+ (setq key (org-match-string-no-properties 2)
+ value (org-trim (or (org-match-string-no-properties 3) "")))
+ (unless (member key excluded)
+ (push (cons key (or value "")) props)))))
+ (if clocksum
+ (push (cons "CLOCKSUM"
+ (org-columns-number-to-string (/ (float clocksum) 60.)
+ 'add_times))
+ props))
+ (if clocksumt
+ (push (cons "CLOCKSUM_T"
+ (org-columns-number-to-string (/ (float clocksumt) 60.)
+ 'add_times))
+ props))
+ (unless (assoc "CATEGORY" props)
+ (push (cons "CATEGORY" (org-get-category)) props))
+ (append sum-props (nreverse props)))))))
(defun org-entry-get (pom property &optional inherit literal-nil)
"Get value of PROPERTY for entry or content at point-or-marker POM.
@@ -15320,30 +15298,32 @@ when a \"nil\" value can supersede a non-nil value higher up the hierarchy."
t))
(org-entry-get-with-inheritance property literal-nil)
(if (member property org-special-properties)
- ;; We need a special property. Use `org-entry-properties' to
- ;; retrieve it, but specify the wanted property
+ ;; We need a special property. Use `org-entry-properties'
+ ;; to retrieve it, but specify the wanted property
(cdr (assoc property (org-entry-properties nil 'special property)))
- (let ((range (org-get-property-block)))
- (when (and range (not (eq (car range) (cdr range))))
- (let* ((props (list (or (assoc property org-file-properties)
- (assoc property org-global-properties)
- (assoc property org-global-properties-fixed))))
- (ap (lambda (key)
- (when (re-search-forward
- (org-re-property key) (cdr range) t)
- (setq props
- (org-update-property-plist
- key
- (if (match-end 3)
- (org-match-string-no-properties 3) "")
- props)))))
- val)
- (goto-char (car range))
- (funcall ap property)
- (goto-char (car range))
- (while (funcall ap (concat property "+")))
- (setq val (cdr (assoc property props)))
- (when val (if literal-nil val (org-not-nil val))))))))))
+ (org-with-wide-buffer
+ (let ((range (org-get-property-block)))
+ (when (and range (not (eq (car range) (cdr range))))
+ (let* ((props
+ (list (or (assoc property org-file-properties)
+ (assoc property org-global-properties)
+ (assoc property org-global-properties-fixed))))
+ (ap (lambda (key)
+ (when (re-search-forward
+ (org-re-property key) (cdr range) t)
+ (setq props
+ (org-update-property-plist
+ key
+ (if (match-end 3)
+ (org-match-string-no-properties 3) "")
+ props)))))
+ val)
+ (goto-char (car range))
+ (funcall ap property)
+ (goto-char (car range))
+ (while (funcall ap (concat property "+")))
+ (setq val (cdr (assoc property props)))
+ (when val (if literal-nil val (org-not-nil val)))))))))))
(defun org-property-or-variable-value (var &optional inherit)
"Check if there is a property fixing the value of VAR.
@@ -19525,9 +19505,6 @@ because, in this case the deletion might narrow the column."
(put 'org-self-insert-command 'pabbrev-expand-after-command t)
(put 'orgtbl-self-insert-command 'pabbrev-expand-after-command t)
-;; How to do this: Measure non-white length of current string
-;; If equal to column width, we should realign.
-
(defun org-remap (map &rest commands)
"In MAP, remap the functions given in COMMANDS.
COMMANDS is a list of alternating OLDDEF NEWDEF command names."
@@ -20237,10 +20214,17 @@ This command does many different things, depending on context:
(if (save-excursion (beginning-of-line) (looking-at "[ \t]*$"))
(or (run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook)
(user-error "C-c C-c can do nothing useful at this location"))
- ;; When at a link, act according to the parent instead.
- (when (eq type 'link)
- (setq context (org-element-property :parent context))
- (setq type (org-element-type context)))
+ (case type
+ ;; When at a link, act according to the parent instead.
+ (link (setq context (org-element-property :parent context))
+ (setq type (org-element-type context)))
+ ;; Unsupported object types: check parent element instead.
+ ((bold code entity export-snippet inline-babel-call inline-src-block
+ italic latex-fragment line-break macro strike-through subscript
+ superscript underline verbatim)
+ (while (and (setq context (org-element-property :parent context))
+ (not (memq (setq type (org-element-type context))
+ '(paragraph verse-block)))))))
;; For convenience: at the first line of a paragraph on the
;; same line as an item, apply function on that item instead.
(when (eq type 'paragraph)
diff --git a/lisp/org/ox-ascii.el b/lisp/org/ox-ascii.el
index 5b41d2d3989..55bda8368e0 100644
--- a/lisp/org/ox-ascii.el
+++ b/lisp/org/ox-ascii.el
@@ -336,7 +336,8 @@ Otherwise, place it right after it."
:package-version '(Org . "8.0")
:type 'string)
-(defcustom org-ascii-format-drawer-function nil
+(defcustom org-ascii-format-drawer-function
+ (lambda (name contents width) contents)
"Function called to format a drawer in ASCII.
The function must accept three parameters:
@@ -347,63 +348,32 @@ The function must accept three parameters:
The function should return either the string to be exported or
nil to ignore the drawer.
-For example, the variable could be set to the following function
-in order to mimic default behaviour:
-
-\(defun org-ascii-format-drawer-default (name contents width)
- \"Format a drawer element for ASCII export.\"
- contents)"
+The default value simply returns the value of CONTENTS."
:group 'org-export-ascii
:version "24.4"
:package-version '(Org . "8.0")
:type 'function)
-(defcustom org-ascii-format-inlinetask-function nil
+(defcustom org-ascii-format-inlinetask-function
+ 'org-ascii-format-inlinetask-default
"Function called to format an inlinetask in ASCII.
-The function must accept six parameters:
- TODO the todo keyword, as a string
- TODO-TYPE the todo type, a symbol among `todo', `done' and nil.
- PRIORITY the inlinetask priority, as a string
- NAME the inlinetask name, as a string.
- TAGS the inlinetask tags, as a list of strings.
- CONTENTS the contents of the inlinetask, as a string.
+The function must accept nine parameters:
+ TODO the todo keyword, as a string
+ TODO-TYPE the todo type, a symbol among `todo', `done' and nil.
+ PRIORITY the inlinetask priority, as a string
+ NAME the inlinetask name, as a string.
+ TAGS the inlinetask tags, as a list of strings.
+ CONTENTS the contents of the inlinetask, as a string.
+ WIDTH the width of the inlinetask, as a number.
+ INLINETASK the inlinetask itself.
+ INFO the info channel.
The function should return either the string to be exported or
-nil to ignore the inline task.
-
-For example, the variable could be set to the following function
-in order to mimic default behaviour:
-
-\(defun org-ascii-format-inlinetask-default
- \(todo type priority name tags contents\)
- \"Format an inline task element for ASCII export.\"
- \(let* \(\(utf8p \(eq \(plist-get info :ascii-charset\) 'utf-8\)\)
- \(width org-ascii-inlinetask-width\)
- \(org-ascii--indent-string
- \(concat
- ;; Top line, with an additional blank line if not in UTF-8.
- \(make-string width \(if utf8p ?━ ?_\)\) \"\\n\"
- \(unless utf8p \(concat \(make-string width ? \) \"\\n\"\)\)
- ;; Add title. Fill it if wider than inlinetask.
- \(let \(\(title \(org-ascii--build-title inlinetask info width\)\)\)
- \(if \(<= \(length title\) width\) title
- \(org-ascii--fill-string title width info\)\)\)
- \"\\n\"
- ;; If CONTENTS is not empty, insert it along with
- ;; a separator.
- \(when \(org-string-nw-p contents\)
- \(concat \(make-string width \(if utf8p ?─ ?-\)\) \"\\n\" contents\)\)
- ;; Bottom line.
- \(make-string width \(if utf8p ?━ ?_\)\)\)
- ;; Flush the inlinetask to the right.
- \(- \(plist-get info :ascii-width\)
- \(plist-get info :ascii-margin\)
- \(plist-get info :ascii-inner-margin\)
- \(org-ascii--current-text-width inlinetask info\)\)"
+nil to ignore the inline task."
:group 'org-export-ascii
:version "24.4"
- :package-version '(Org . "8.0")
+ :package-version '(Org . "8.3")
:type 'function)
@@ -1071,11 +1041,7 @@ CONTENTS holds the contents of the block. INFO is a plist
holding contextual information."
(let ((name (org-element-property :drawer-name drawer))
(width (org-ascii--current-text-width drawer info)))
- (if (functionp org-ascii-format-drawer-function)
- (funcall org-ascii-format-drawer-function name contents width)
- ;; If there's no user defined function: simply
- ;; display contents of the drawer.
- contents)))
+ (funcall org-ascii-format-drawer-function name contents width)))
;;;; Dynamic Block
@@ -1228,55 +1194,58 @@ contextual information."
;;;; Inlinetask
+(defun org-ascii-format-inlinetask-default
+ (todo type priority name tags contents width inlinetask info)
+ "Format an inline task element for ASCII export.
+See `org-ascii-format-inlinetask-function' for a description
+of the paramaters."
+ (let* ((utf8p (eq (plist-get info :ascii-charset) 'utf-8))
+ (width (or width org-ascii-inlinetask-width)))
+ (org-ascii--indent-string
+ (concat
+ ;; Top line, with an additional blank line if not in UTF-8.
+ (make-string width (if utf8p ?━ ?_)) "\n"
+ (unless utf8p (concat (make-string width ? ) "\n"))
+ ;; Add title. Fill it if wider than inlinetask.
+ (let ((title (org-ascii--build-title inlinetask info width)))
+ (if (<= (length title) width) title
+ (org-ascii--fill-string title width info)))
+ "\n"
+ ;; If CONTENTS is not empty, insert it along with
+ ;; a separator.
+ (when (org-string-nw-p contents)
+ (concat (make-string width (if utf8p ?─ ?-)) "\n" contents))
+ ;; Bottom line.
+ (make-string width (if utf8p ?━ ?_)))
+ ;; Flush the inlinetask to the right.
+ (- org-ascii-text-width org-ascii-global-margin
+ (if (not (org-export-get-parent-headline inlinetask)) 0
+ org-ascii-inner-margin)
+ (org-ascii--current-text-width inlinetask info)))))
+
(defun org-ascii-inlinetask (inlinetask contents info)
"Transcode an INLINETASK element from Org to ASCII.
CONTENTS holds the contents of the block. INFO is a plist
holding contextual information."
(let ((width (org-ascii--current-text-width inlinetask info)))
- ;; If `org-ascii-format-inlinetask-function' is provided, call it
- ;; with appropriate arguments.
- (if (functionp org-ascii-format-inlinetask-function)
- (funcall org-ascii-format-inlinetask-function
- ;; todo.
- (and (plist-get info :with-todo-keywords)
- (let ((todo (org-element-property
- :todo-keyword inlinetask)))
- (and todo (org-export-data todo info))))
- ;; todo-type
- (org-element-property :todo-type inlinetask)
- ;; priority
- (and (plist-get info :with-priority)
- (org-element-property :priority inlinetask))
- ;; title
- (org-export-data (org-element-property :title inlinetask) info)
- ;; tags
- (and (plist-get info :with-tags)
- (org-element-property :tags inlinetask))
- ;; contents and width
- contents width)
- ;; Otherwise, use a default template.
- (let* ((utf8p (eq (plist-get info :ascii-charset) 'utf-8)))
- (org-ascii--indent-string
- (concat
- ;; Top line, with an additional blank line if not in UTF-8.
- (make-string width (if utf8p ?━ ?_)) "\n"
- (unless utf8p (concat (make-string width ? ) "\n"))
- ;; Add title. Fill it if wider than inlinetask.
- (let ((title (org-ascii--build-title inlinetask info width)))
- (if (<= (length title) width) title
- (org-ascii--fill-string title width info)))
- "\n"
- ;; If CONTENTS is not empty, insert it along with
- ;; a separator.
- (when (org-string-nw-p contents)
- (concat (make-string width (if utf8p ?─ ?-)) "\n" contents))
- ;; Bottom line.
- (make-string width (if utf8p ?━ ?_)))
- ;; Flush the inlinetask to the right.
- (- org-ascii-text-width org-ascii-global-margin
- (if (not (org-export-get-parent-headline inlinetask)) 0
- org-ascii-inner-margin)
- (org-ascii--current-text-width inlinetask info)))))))
+ (funcall org-ascii-format-inlinetask-function
+ ;; todo.
+ (and (plist-get info :with-todo-keywords)
+ (let ((todo (org-element-property
+ :todo-keyword inlinetask)))
+ (and todo (org-export-data todo info))))
+ ;; todo-type
+ (org-element-property :todo-type inlinetask)
+ ;; priority
+ (and (plist-get info :with-priority)
+ (org-element-property :priority inlinetask))
+ ;; title
+ (org-export-data (org-element-property :title inlinetask) info)
+ ;; tags
+ (and (plist-get info :with-tags)
+ (org-element-property :tags inlinetask))
+ ;; contents and width
+ contents width inlinetask info)))
;;;; Italic
diff --git a/lisp/org/ox-html.el b/lisp/org/ox-html.el
index b4094d3e44c..44962a533e5 100644
--- a/lisp/org/ox-html.el
+++ b/lisp/org/ox-html.el
@@ -130,7 +130,9 @@
(:infojs-opt "INFOJS_OPT" nil nil)
;; Redefine regular options.
(:creator "CREATOR" nil org-html-creator-string)
- (:with-latex nil "tex" org-html-with-latex)))
+ (:with-latex nil "tex" org-html-with-latex)
+ ;; Retrieve LaTeX header for fragments.
+ (:latex-header "LATEX_HEADER" nil nil newline)))
;;; Internal Variables
@@ -544,6 +546,8 @@ a formatting string to wrap fontified text with.
If no association can be found for a given markup, text will be
returned as-is."
:group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
:type '(alist :key-type (symbol :tag "Markup type")
:value-type (string :tag "Format string"))
:options '(bold code italic strike-through underline verbatim))
@@ -565,7 +569,8 @@ Warning: non-nil may break indentation of source code blocks."
;;;; Drawers
-(defcustom org-html-format-drawer-function nil
+(defcustom org-html-format-drawer-function
+ (lambda (name contents) contents)
"Function called to format a drawer in HTML code.
The function must accept two parameters:
@@ -577,10 +582,10 @@ The function should return the string to be exported.
For example, the variable could be set to the following function
in order to mimic default behaviour:
-\(defun org-html-format-drawer-default \(name contents\)
- \"Format a drawer element for HTML export.\"
- contents\)"
+The default value simply returns the value of CONTENTS."
:group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
:type 'function)
;;;; Footnotes
@@ -622,7 +627,7 @@ document title."
:group 'org-export-html
:type 'integer)
-(defcustom org-html-format-headline-function nil
+(defcustom org-html-format-headline-function 'ignore
"Function to format headline text.
This function will be called with 5 arguments:
@@ -634,6 +639,8 @@ TAGS the tags (string or nil).
The function result will be used in the section format string."
:group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
:type 'function)
;;;; HTML-specific
@@ -649,7 +656,7 @@ attributes, when appropriate."
;;;; Inlinetasks
-(defcustom org-html-format-inlinetask-function nil
+(defcustom org-html-format-inlinetask-function 'ignore
"Function called to format an inlinetask in HTML code.
The function must accept six parameters:
@@ -662,6 +669,8 @@ The function must accept six parameters:
The function should return the string to be exported."
:group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
:type 'function)
;;;; LaTeX
@@ -1119,6 +1128,8 @@ like that: \"%%\"."
"Information about the creator of the HTML document.
This option can also be set on with the CREATOR keyword."
:group 'org-export-html
+ :version "24.4"
+ :package-version '(Org . "8.0")
:type '(string :tag "Creator string"))
;;;; Template :: Preamble
@@ -1971,7 +1982,8 @@ and value is its relative level, as an integer."
(defun org-html--format-toc-headline (headline info)
"Return an appropriate table of contents entry for HEADLINE.
INFO is a plist used as a communication channel."
- (let* ((todo (and (plist-get info :with-todo-keywords)
+ (let* ((headline-number (org-export-get-headline-number headline info))
+ (todo (and (plist-get info :with-todo-keywords)
(let ((todo (org-element-property :todo-keyword headline)))
(and todo (org-export-data todo info)))))
(todo-type (and todo (org-element-property :todo-type headline)))
@@ -1992,19 +2004,23 @@ INFO is a plist used as a communication channel."
(tags (and (eq (plist-get info :with-tags) t)
(org-export-get-tags headline info))))
(format "<a href=\"#%s\">%s</a>"
+ ;; Label.
(org-export-solidify-link-text
(or (org-element-property :CUSTOM_ID headline)
(concat "sec-"
- (mapconcat
- #'number-to-string
- (org-export-get-headline-number headline info)
- "-"))))
- (apply (if (functionp org-html-format-headline-function)
- (lambda (todo todo-type priority text tags &rest ignore)
- (funcall org-html-format-headline-function
- todo todo-type priority text tags))
- #'org-html-format-headline)
- todo todo-type priority text tags :section-number nil))))
+ (mapconcat #'number-to-string headline-number "-"))))
+ ;; Body.
+ (concat
+ (and (not (org-export-low-level-p headline info))
+ (org-export-numbered-headline-p headline info)
+ (concat (mapconcat #'number-to-string headline-number ".")
+ ". "))
+ (apply (if (not (eq org-html-format-headline-function 'ignore))
+ (lambda (todo todo-type priority text tags &rest ignore)
+ (funcall org-html-format-headline-function
+ todo todo-type priority text tags))
+ #'org-html-format-headline)
+ todo todo-type priority text tags :section-number nil)))))
(defun org-html-list-of-listings (info)
"Build a list of listings.
@@ -2244,7 +2260,7 @@ holding contextual information."
headline-number "-"))))
(format-function
(cond ((functionp format-function) format-function)
- ((functionp org-html-format-headline-function)
+ ((not (eq org-html-format-headline-function 'ignore))
(lambda (todo todo-type priority text tags &rest ignore)
(funcall org-html-format-headline-function
todo todo-type priority text tags)))
@@ -2371,9 +2387,9 @@ contextual information."
CONTENTS holds the contents of the block. INFO is a plist
holding contextual information."
(cond
- ;; If `org-html-format-inlinetask-function' is provided, call it
+ ;; If `org-html-format-inlinetask-function' is not 'ignore, call it
;; with appropriate arguments.
- ((functionp org-html-format-inlinetask-function)
+ ((not (eq org-html-format-inlinetask-function 'ignore))
(let ((format-function
(function*
(lambda (todo todo-type priority text tags
@@ -2474,18 +2490,34 @@ CONTENTS is nil. INFO is a plist holding contextual information."
;;;; Latex Environment
-(defun org-html-format-latex (latex-frag processing-type)
- "Format a LaTeX fragment LATEX-FRAG into HTML."
+(defun org-html-format-latex (latex-frag processing-type info)
+ "Format a LaTeX fragment LATEX-FRAG into HTML.
+PROCESSING-TYPE designates the tool used for conversion. It is
+a symbol among `mathjax', `dvipng', `imagemagick', `verbatim' nil
+and t. See `org-html-with-latex' for more information. INFO is
+a plist containing export properties."
(let ((cache-relpath "") (cache-dir ""))
(unless (eq processing-type 'mathjax)
(let ((bfn (or (buffer-file-name)
(make-temp-name
- (expand-file-name "latex" temporary-file-directory)))))
+ (expand-file-name "latex" temporary-file-directory))))
+ (latex-header
+ (let ((header (plist-get info :latex-header)))
+ (and header
+ (concat (mapconcat
+ (lambda (line) (concat "#+LATEX_HEADER: " line))
+ (org-split-string header "\n")
+ "\n")
+ "\n")))))
(setq cache-relpath
(concat "ltxpng/"
(file-name-sans-extension
(file-name-nondirectory bfn)))
- cache-dir (file-name-directory bfn))))
+ cache-dir (file-name-directory bfn))
+ ;; Re-create LaTeX environment from original buffer in
+ ;; temporary buffer so that dvipng/imagemagick can properly
+ ;; turn the fragment into an image.
+ (setq latex-frag (concat latex-header latex-frag))))
(with-temp-buffer
(insert latex-frag)
(org-format-latex cache-relpath cache-dir nil "Creating LaTeX Image..."
@@ -2501,9 +2533,10 @@ CONTENTS is nil. INFO is a plist holding contextual information."
(attributes (org-export-read-attribute :attr_html latex-environment)))
(case processing-type
((t mathjax)
- (org-html-format-latex latex-frag 'mathjax))
+ (org-html-format-latex latex-frag 'mathjax info))
((dvipng imagemagick)
- (let ((formula-link (org-html-format-latex latex-frag processing-type)))
+ (let ((formula-link
+ (org-html-format-latex latex-frag processing-type info)))
(when (and formula-link (string-match "file:\\([^]]*\\)" formula-link))
;; Do not provide a caption or a name to be consistent with
;; `mathjax' handling.
@@ -2521,9 +2554,10 @@ CONTENTS is nil. INFO is a plist holding contextual information."
(processing-type (plist-get info :with-latex)))
(case processing-type
((t mathjax)
- (org-html-format-latex latex-frag 'mathjax))
+ (org-html-format-latex latex-frag 'mathjax info))
((dvipng imagemagick)
- (let ((formula-link (org-html-format-latex latex-frag processing-type)))
+ (let ((formula-link
+ (org-html-format-latex latex-frag processing-type info)))
(when (and formula-link (string-match "file:\\([^]]*\\)" formula-link))
(org-html--format-image (match-string 1 formula-link) nil info))))
(t latex-frag))))
diff --git a/lisp/org/ox-latex.el b/lisp/org/ox-latex.el
index 6766b8583f1..3609881b690 100644
--- a/lisp/org/ox-latex.el
+++ b/lisp/org/ox-latex.el
@@ -556,7 +556,8 @@ returned as-is."
;;;; Drawers
-(defcustom org-latex-format-drawer-function nil
+(defcustom org-latex-format-drawer-function
+ (lambda (name contents) contents)
"Function called to format a drawer in LaTeX code.
The function must accept two parameters:
@@ -565,19 +566,16 @@ The function must accept two parameters:
The function should return the string to be exported.
-For example, the variable could be set to the following function
-in order to mimic default behaviour:
-
-\(defun org-latex-format-drawer-default \(name contents\)
- \"Format a drawer element for LaTeX export.\"
- contents\)"
+The default function simply returns the value of CONTENTS."
:group 'org-export-latex
+ :version "24.4"
+ :package-version '(Org . "8.3")
:type 'function)
;;;; Inlinetasks
-(defcustom org-latex-format-inlinetask-function nil
+(defcustom org-latex-format-inlinetask-function 'ignore
"Function called to format an inlinetask in LaTeX code.
The function must accept six parameters:
@@ -1212,12 +1210,8 @@ channel."
CONTENTS holds the contents of the block. INFO is a plist
holding contextual information."
(let* ((name (org-element-property :drawer-name drawer))
- (output (if (functionp org-latex-format-drawer-function)
- (funcall org-latex-format-drawer-function
- name contents)
- ;; If there's no user defined function: simply
- ;; display contents of the drawer.
- contents)))
+ (output (funcall org-latex-format-drawer-function
+ name contents)))
(org-latex--wrap-label drawer output)))
@@ -1502,7 +1496,7 @@ holding contextual information."
(org-element-property :priority inlinetask))))
;; If `org-latex-format-inlinetask-function' is provided, call it
;; with appropriate arguments.
- (if (functionp org-latex-format-inlinetask-function)
+ (if (not (eq org-latex-format-inlinetask-function 'ignore))
(funcall org-latex-format-inlinetask-function
todo todo-type priority title tags contents)
;; Otherwise, use a default template.
diff --git a/lisp/org/ox-odt.el b/lisp/org/ox-odt.el
index d5d03e49b50..975dbdb9f98 100644
--- a/lisp/org/ox-odt.el
+++ b/lisp/org/ox-odt.el
@@ -449,7 +449,7 @@ under `org-odt-styles-dir' is used."
:type '(choice (const nil)
(file))
:group 'org-export-odt
- :version "24.1")
+ :version "24.3")
(defcustom org-odt-styles-file nil
"Default styles file for use with ODT export.
@@ -498,7 +498,8 @@ a per-file basis. For example,
(defcustom org-odt-display-outline-level 2
"Outline levels considered for enumerating captioned entities."
:group 'org-export-odt
- :version "24.2"
+ :version "24.4"
+ :package-version '(Org . "8.0")
:type 'integer)
;;;; Document conversion
@@ -645,7 +646,8 @@ values. See Info node `(emacs) File Variables'."
;;;; Drawers
-(defcustom org-odt-format-drawer-function nil
+(defcustom org-odt-format-drawer-function
+ (lambda (name contents) contents)
"Function called to format a drawer in ODT code.
The function must accept two parameters:
@@ -654,21 +656,16 @@ The function must accept two parameters:
The function should return the string to be exported.
-For example, the variable could be set to the following function
-in order to mimic default behaviour:
-
-\(defun org-odt-format-drawer-default \(name contents\)
- \"Format a drawer element for ODT export.\"
- contents\)"
+The default value simply returns the value of CONTENTS."
:group 'org-export-odt
:version "24.4"
- :package-version '(Org . "8.0")
+ :package-version '(Org . "8.3")
:type 'function)
;;;; Headline
-(defcustom org-odt-format-headline-function nil
+(defcustom org-odt-format-headline-function 'ignore
"Function to format headline text.
This function will be called with 5 arguments:
@@ -687,7 +684,7 @@ The function result will be used as headline text."
;;;; Inlinetasks
-(defcustom org-odt-format-inlinetask-function nil
+(defcustom org-odt-format-inlinetask-function 'ignore
"Function called to format an inlinetask in ODT code.
The function must accept six parameters:
@@ -746,6 +743,8 @@ A rule consists in an association whose key is the type of link
to consider, and value is a regexp that will be matched against
link's path."
:group 'org-export-odt
+ :version "24.4"
+ :package-version '(Org . "8.0")
:type '(alist :key-type (string :tag "Type")
:value-type (regexp :tag "Path")))
@@ -757,6 +756,8 @@ A rule consists in an association whose key is the type of link
to consider, and value is a regexp that will be matched against
link's path."
:group 'org-export-odt
+ :version "24.4"
+ :package-version '(Org . "8.0")
:type '(alist :key-type (string :tag "Type")
:value-type (regexp :tag "Path")))
@@ -929,6 +930,8 @@ the application UI or through a custom styles file.
See `org-odt--build-date-styles' for implementation details."
:group 'org-export-odt
+ :version "24.4"
+ :package-version '(Org . "8.0")
:type 'boolean)
@@ -1619,12 +1622,8 @@ channel."
CONTENTS holds the contents of the block. INFO is a plist
holding contextual information."
(let* ((name (org-element-property :drawer-name drawer))
- (output (if (functionp org-odt-format-drawer-function)
- (funcall org-odt-format-drawer-function
- name contents)
- ;; If there's no user defined function: simply
- ;; display contents of the drawer.
- contents)))
+ (output (funcall org-odt-format-drawer-function
+ name contents)))
output))
@@ -1805,10 +1804,10 @@ INFO is a plist holding contextual information."
headline-number "-")))
(format-function (cond
((functionp format-function) format-function)
- ((functionp org-odt-format-headline-function)
+ ((not (eq org-odt-format-headline-function 'ignore))
(function*
(lambda (todo todo-type priority text tags
- &allow-other-keys)
+ &allow-other-keys)
(funcall org-odt-format-headline-function
todo todo-type priority text tags))))
(t 'org-odt-format-headline))))
@@ -1931,9 +1930,9 @@ contextual information."
CONTENTS holds the contents of the block. INFO is a plist
holding contextual information."
(cond
- ;; If `org-odt-format-inlinetask-function' is provided, call it
+ ;; If `org-odt-format-inlinetask-function' is not 'ignore, call it
;; with appropriate arguments.
- ((functionp org-odt-format-inlinetask-function)
+ ((not (eq org-odt-format-inlinetask-function 'ignore))
(let ((format-function
(function*
(lambda (todo todo-type priority text tags
diff --git a/lisp/org/ox-publish.el b/lisp/org/ox-publish.el
index 67a57fa38ff..d87326d56a7 100644
--- a/lisp/org/ox-publish.el
+++ b/lisp/org/ox-publish.el
@@ -1225,8 +1225,9 @@ Returns value on success, else nil."
(let ((attr (file-attributes
(expand-file-name (or (file-symlink-p file) file)
(file-name-directory file)))))
- (+ (lsh (car (nth 5 attr)) 16)
- (cadr (nth 5 attr)))))
+ (if (not attr) (error "No such file: \"%s\"" file)
+ (+ (lsh (car (nth 5 attr)) 16)
+ (cadr (nth 5 attr))))))
(provide 'ox-publish)
diff --git a/lisp/org/ox-texinfo.el b/lisp/org/ox-texinfo.el
index 0126170ec82..43c1de2158a 100644
--- a/lisp/org/ox-texinfo.el
+++ b/lisp/org/ox-texinfo.el
@@ -143,7 +143,7 @@
;;; Preamble
-(defcustom org-texinfo-filename nil
+(defcustom org-texinfo-filename ""
"Default filename for Texinfo output."
:group 'org-export-texinfo
:type '(string :tag "Export Filename"))
@@ -202,7 +202,7 @@ a format string in which the section title will be added."
;;; Headline
-(defcustom org-texinfo-format-headline-function nil
+(defcustom org-texinfo-format-headline-function 'ignore
"Function to format headline text.
This function will be called with 5 arguments:
@@ -316,7 +316,8 @@ returned as-is."
;;; Drawers
-(defcustom org-texinfo-format-drawer-function nil
+(defcustom org-texinfo-format-drawer-function
+ (lambda (name contents) contents)
"Function called to format a drawer in Texinfo code.
The function must accept two parameters:
@@ -325,18 +326,15 @@ The function must accept two parameters:
The function should return the string to be exported.
-For example, the variable could be set to the following function
-in order to mimic default behaviour:
-
-\(defun org-texinfo-format-drawer-default \(name contents\)
- \"Format a drawer element for Texinfo export.\"
- contents\)"
+The default function simply returns the value of CONTENTS."
:group 'org-export-texinfo
+ :version "24.4"
+ :package-version '(Org . "8.3")
:type 'function)
;;; Inlinetasks
-(defcustom org-texinfo-format-inlinetask-function nil
+(defcustom org-texinfo-format-inlinetask-function 'ignore
"Function called to format an inlinetask in Texinfo code.
The function must accept six parameters:
@@ -882,12 +880,8 @@ contextual information."
CONTENTS holds the contents of the block. INFO is a plist
holding contextual information."
(let* ((name (org-element-property :drawer-name drawer))
- (output (if (functionp org-texinfo-format-drawer-function)
- (funcall org-texinfo-format-drawer-function
- name contents)
- ;; If there's no user defined function: simply
- ;; display contents of the drawer.
- contents)))
+ (output (funcall org-texinfo-format-drawer-function
+ name contents)))
output))
;;; Dynamic Block
@@ -1036,7 +1030,7 @@ holding contextual information."
;; Create the headline text along with a no-tag version. The
;; latter is required to remove tags from table of contents.
(full-text (org-texinfo--sanitize-content
- (if (functionp org-texinfo-format-headline-function)
+ (if (not (eq org-texinfo-format-headline-function 'ignore))
;; User-defined formatting function.
(funcall org-texinfo-format-headline-function
todo todo-type priority text tags)
@@ -1051,7 +1045,7 @@ holding contextual information."
(mapconcat 'identity tags ":")))))))
(full-text-no-tag
(org-texinfo--sanitize-content
- (if (functionp org-texinfo-format-headline-function)
+ (if (not (eq org-texinfo-format-headline-function 'ignore))
;; User-defined formatting function.
(funcall org-texinfo-format-headline-function
todo todo-type priority text nil)
@@ -1153,7 +1147,7 @@ holding contextual information."
(org-element-property :priority inlinetask))))
;; If `org-texinfo-format-inlinetask-function' is provided, call it
;; with appropriate arguments.
- (if (functionp org-texinfo-format-inlinetask-function)
+ (if (not (eq org-texinfo-format-inlinetask-function 'ignore))
(funcall org-texinfo-format-inlinetask-function
todo todo-type priority title tags contents)
;; Otherwise, use a default template.
diff --git a/lisp/org/ox.el b/lisp/org/ox.el
index 6b88f1a908b..8316ef26e53 100644
--- a/lisp/org/ox.el
+++ b/lisp/org/ox.el
@@ -626,11 +626,20 @@ e.g. \"stat:nil\""
(defcustom org-export-with-sub-superscripts t
"Non-nil means interpret \"_\" and \"^\" for export.
+If you want to control how Org displays those characters, see
+`org-use-sub-superscripts'. `org-export-with-sub-superscripts'
+used to be an alias for `org-use-sub-superscripts' in Org <8.0,
+it is not anymore.
+
When this option is turned on, you can use TeX-like syntax for
-sub- and superscripts. Several characters after \"_\" or \"^\"
-will be considered as a single item - so grouping with {} is
-normally not needed. For example, the following things will be
-parsed as single sub- or superscripts.
+sub- and superscripts and see them exported correctly.
+
+You can also set the option with #+OPTIONS: ^:t
+
+Several characters after \"_\" or \"^\" will be considered as a
+single item - so grouping with {} is normally not needed. For
+example, the following things will be parsed as single sub- or
+superscripts:
10^24 or 10^tau several digits will be considered 1 item.
10^-12 or 10^-tau a leading sign with digits or a word
@@ -638,15 +647,14 @@ parsed as single sub- or superscripts.
terminated by almost any nonword/nondigit char.
x_{i^2} or x^(2-i) braces or parenthesis do grouping.
-Still, ambiguity is possible - so when in doubt use {} to enclose
-the sub/superscript. If you set this variable to the symbol
-`{}', the braces are *required* in order to trigger
-interpretations as sub/superscript. This can be helpful in
-documents that need \"_\" frequently in plain text.
-
-This option can also be set with the OPTIONS keyword,
-e.g. \"^:nil\"."
+Still, ambiguity is possible. So when in doubt, use {} to enclose
+the sub/superscript. If you set this variable to the symbol `{}',
+the braces are *required* in order to trigger interpretations as
+sub/superscript. This can be helpful in documents that need \"_\"
+frequently in plain text."
:group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
:type '(choice
(const :tag "Interpret them" t)
(const :tag "Curly brackets only" {})
diff --git a/lisp/pcmpl-x.el b/lisp/pcmpl-x.el
index 86d8dc652c3..8e09c660301 100644
--- a/lisp/pcmpl-x.el
+++ b/lisp/pcmpl-x.el
@@ -247,5 +247,42 @@ long options."
;;;###autoload
(defalias 'pcomplete/ack-grep 'pcomplete/ack)
+
+;;;; the_silver_search - https://github.com/ggreer/the_silver_searcher
+
+(defvar pcmpl-x-ag-options nil)
+
+(defun pcmpl-x-ag-options ()
+ (or pcmpl-x-ag-options
+ (setq pcmpl-x-ag-options
+ (with-temp-buffer
+ (when (zerop (call-process "ag" nil t nil "--help"))
+ (let (short long)
+ (goto-char (point-min))
+ (while (re-search-forward "^ +\\(-[a-zA-Z]\\) " nil t)
+ (push (match-string 1) short))
+ (goto-char (point-min))
+ (while (re-search-forward
+ "^ +\\(?:-[a-zA-Z] \\)?\\(--\\(\\[no\\]\\)?[^ \t\n]+\\) "
+ nil t)
+ (if (match-string 2)
+ (progn
+ (replace-match "" nil nil nil 2)
+ (push (match-string 1) long)
+ (replace-match "no" nil nil nil 2)
+ (push (match-string 1) long))
+ (push (match-string 1) long)))
+ (list (cons 'short (nreverse short))
+ (cons 'long (nreverse long)))))))))
+
+;;;###autoload
+(defun pcomplete/ag ()
+ "Completion for the `ag' command."
+ (while t
+ (if (pcomplete-match "^-" 0)
+ (pcomplete-here* (cdr (assq (if (pcomplete-match "^--" 0) 'long 'short)
+ (pcmpl-x-ag-options))))
+ (pcomplete-here* (pcomplete-dirs-or-entries)))))
+
(provide 'pcmpl-x)
;;; pcmpl-x.el ends here
diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el
index 609585c9522..4a2523ad987 100644
--- a/lisp/play/gomoku.el
+++ b/lisp/play/gomoku.el
@@ -1,4 +1,4 @@
-;;; gomoku.el --- Gomoku game between you and Emacs
+;;; gomoku.el --- Gomoku game between you and Emacs -*- lexical-binding:t -*-
;; Copyright (C) 1988, 1994, 1996, 2001-2013 Free Software Foundation,
;; Inc.
@@ -176,14 +176,9 @@ One useful value to include is `turn-on-font-lock' to highlight the pieces."
("[-|/\\]" 0 (if gomoku-emacs-won 'gomoku-O 'gomoku-X)))
"Font lock rules for Gomoku.")
-(put 'gomoku-mode 'front-sticky
- (put 'gomoku-mode 'rear-nonsticky '(intangible)))
-(put 'gomoku-mode 'intangible 1)
;; This one is for when they set view-read-only to t: Gomoku cannot
;; allow View Mode to be activated in its buffer.
-(put 'gomoku-mode 'mode-class 'special)
-
-(define-derived-mode gomoku-mode nil "Gomoku"
+(define-derived-mode gomoku-mode special-mode "Gomoku"
"Major mode for playing Gomoku against Emacs.
You and Emacs play in turn by marking a free square. You mark it with X
and Emacs marks it with O. The winner is the first to get five contiguous
@@ -196,7 +191,8 @@ Other useful commands:\n
(gomoku-display-statistics)
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults '(gomoku-font-lock-keywords t)
- buffer-read-only t))
+ buffer-read-only t)
+ (add-hook 'post-command-hook #'gomoku--intangible nil t))
;;;
;;; THE BOARD.
@@ -836,8 +832,7 @@ Use \\[describe-mode] for more info."
(min (max (/ (+ (- (cdr click)
gomoku-y-offset
1)
- (let ((inhibit-point-motion-hooks t))
- (count-lines 1 (window-start)))
+ (count-lines (point-min) (window-start))
gomoku-square-height
(% gomoku-square-height 2)
(/ gomoku-square-height 2))
@@ -961,16 +956,15 @@ If the game is finished, this command requests for another game."
(defun gomoku-point-y ()
"Return the board row where point is."
- (let ((inhibit-point-motion-hooks t))
- (1+ (/ (- (count-lines 1 (point)) gomoku-y-offset (if (bolp) 0 1))
- gomoku-square-height))))
+ (1+ (/ (- (count-lines (point-min) (point))
+ gomoku-y-offset (if (bolp) 0 1))
+ gomoku-square-height)))
(defun gomoku-point-square ()
"Return the index of the square point is on."
- (let ((inhibit-point-motion-hooks t))
- (gomoku-xy-to-index (1+ (/ (- (current-column) gomoku-x-offset)
- gomoku-square-width))
- (gomoku-point-y))))
+ (gomoku-xy-to-index (1+ (/ (- (current-column) gomoku-x-offset)
+ gomoku-square-width))
+ (gomoku-point-y)))
(defun gomoku-goto-square (index)
"Move point to square number INDEX."
@@ -978,20 +972,18 @@ If the game is finished, this command requests for another game."
(defun gomoku-goto-xy (x y)
"Move point to square at X, Y coords."
- (let ((inhibit-point-motion-hooks t))
- (goto-char (point-min))
- (forward-line (+ gomoku-y-offset (* gomoku-square-height (1- y)))))
+ (goto-char (point-min))
+ (forward-line (+ gomoku-y-offset (* gomoku-square-height (1- y))))
(move-to-column (+ gomoku-x-offset (* gomoku-square-width (1- x)))))
(defun gomoku-plot-square (square value)
"Draw 'X', 'O' or '.' on SQUARE depending on VALUE, leave point there."
(or (= value 1)
(gomoku-goto-square square))
- (let ((inhibit-read-only t)
- (inhibit-point-motion-hooks t))
- (insert-and-inherit (cond ((= value 1) ?X)
- ((= value 6) ?O)
- (?.)))
+ (let ((inhibit-read-only t))
+ (insert (cond ((= value 1) ?X)
+ ((= value 6) ?O)
+ (?.)))
(and (zerop value)
(add-text-properties
(1- (point)) (point)
@@ -1004,8 +996,7 @@ If the game is finished, this command requests for another game."
"Display an N by M Gomoku board."
(buffer-disable-undo (current-buffer))
(let ((inhibit-read-only t)
- (point 1) opoint
- (intangible t)
+ (point (point-min)) opoint
(i m) j x)
;; Try to minimize number of chars (because of text properties)
(setq tab-width
@@ -1014,17 +1005,15 @@ If the game is finished, this command requests for another game."
(max (/ (+ (% gomoku-x-offset gomoku-square-width)
gomoku-square-width 1) 2) 2)))
(erase-buffer)
- (newline gomoku-y-offset)
+ (insert-char ?\n gomoku-y-offset)
(while (progn
(setq j n
x (- gomoku-x-offset gomoku-square-width))
(while (>= (setq j (1- j)) 0)
- (insert-char ?\t (/ (- (setq x (+ x gomoku-square-width))
- (current-column))
- tab-width))
- (insert-char ? (- x (current-column)))
- (if (setq intangible (not intangible))
- (put-text-property point (point) 'intangible 2))
+ (insert-char ?\t (/ (- (setq x (+ x gomoku-square-width))
+ (current-column))
+ tab-width))
+ (insert-char ?\s (- x (current-column)))
(and (zerop j)
(= i (- m 2))
(progn
@@ -1042,16 +1031,9 @@ If the game is finished, this command requests for another game."
(if (= i (1- m))
(setq opoint point))
(insert-char ?\n gomoku-square-height))
- (or (eq (char-after 1) ?.)
- (put-text-property 1 2 'point-entered
- (lambda (_x _y) (if (bobp) (forward-char)))))
- (or intangible
- (put-text-property point (point) 'intangible 2))
- (put-text-property point (point) 'point-entered
- (lambda (_x _y) (if (eobp) (backward-char))))
- (put-text-property (point-min) (point) 'category 'gomoku-mode))
+ (insert-char ?\n))
(gomoku-goto-xy (/ (1+ n) 2) (/ (1+ m) 2)) ; center of the board
- (sit-for 0)) ; Display NOW
+ (sit-for 0)) ; Display NOW
(defun gomoku-display-statistics ()
"Obnoxiously display some statistics about previous games in mode line."
@@ -1114,8 +1096,7 @@ If the game is finished, this command requests for another game."
"Cross every square between SQUARE1 and SQUARE2 in the DX, DY direction."
(save-excursion ; Not moving point from last square
(let ((depl (gomoku-xy-to-index dx dy))
- (inhibit-read-only t)
- (inhibit-point-motion-hooks t))
+ (inhibit-read-only t))
;; WARNING: this function assumes DEPL > 0 and SQUARE2 > SQUARE1
(while (/= square1 square2)
(gomoku-goto-square square1)
@@ -1134,36 +1115,57 @@ If the game is finished, this command requests for another game."
(setq n (1+ n))
(forward-line 1)
(indent-to column)
- (insert-and-inherit ?|))))
+ (insert ?|))))
((= dx -1) ; 1st Diagonal
(indent-to (prog1 (- (current-column) (/ gomoku-square-width 2))
(forward-line (/ gomoku-square-height 2))))
- (insert-and-inherit ?/))
+ (insert ?/))
(t ; 2nd Diagonal
(indent-to (prog1 (+ (current-column) (/ gomoku-square-width 2))
(forward-line (/ gomoku-square-height 2))))
- (insert-and-inherit ?\\))))))
+ (insert ?\\))))))
(sit-for 0)) ; Display NOW
;;;
;;; CURSOR MOTION.
;;;
+
+(defvar-local gomoku--last-pos 0)
+
+(defconst gomoku--intangible-chars "- \t\n|/\\\\")
+
+(defun gomoku--intangible ()
+ (when (or (eobp)
+ (save-excursion
+ (not (zerop (skip-chars-forward gomoku--intangible-chars)))))
+ (if (<= gomoku--last-pos (point)) ;Moving forward.
+ (progn
+ (skip-chars-forward gomoku--intangible-chars)
+ (when (eobp)
+ (skip-chars-backward gomoku--intangible-chars)
+ (forward-char -1)))
+ (skip-chars-backward gomoku--intangible-chars)
+ (if (bobp)
+ (skip-chars-forward gomoku--intangible-chars)
+ (forward-char -1))))
+ (setq gomoku--last-pos (point)))
+
;; previous-line and next-line don't work right with intangible newlines
(defun gomoku-move-down ()
"Move point down one row on the Gomoku board."
(interactive)
- (if (< (gomoku-point-y) gomoku-board-height)
- (let ((column (current-column)))
- (forward-line gomoku-square-height)
- (move-to-column column))))
+ (when (< (gomoku-point-y) gomoku-board-height)
+ (let ((column (current-column)))
+ (forward-line gomoku-square-height)
+ (move-to-column column))))
(defun gomoku-move-up ()
"Move point up one row on the Gomoku board."
(interactive)
- (if (> (gomoku-point-y) 1)
- (let ((column (current-column)))
- (forward-line (- 1 gomoku-square-height))
- (move-to-column column))))
+ (when (> (gomoku-point-y) 1)
+ (let ((column (current-column)))
+ (forward-line (- gomoku-square-height))
+ (move-to-column column))))
(defun gomoku-move-ne ()
"Move point North East on the Gomoku board."
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 54f03728524..5689be49f61 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1623,16 +1623,12 @@ Returns the compilation buffer created."
(format "%s started at %s\n\n"
mode-name
(substring (current-time-string) 0 19))
- ;; The command could be split into several lines, see
- ;; `rgrep' for example. We want to display it as one
- ;; line.
- (apply 'concat (split-string command (regexp-quote "\\\n") t))
- "\n")
+ command "\n")
(setq thisdir default-directory))
(set-buffer-modified-p nil))
;; Pop up the compilation buffer.
;; http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01638.html
- (setq outwin (display-buffer outbuf))
+ (setq outwin (display-buffer outbuf '(nil (allow-no-window . t))))
(with-current-buffer outbuf
(let ((process-environment
(append
@@ -1654,7 +1650,7 @@ Returns the compilation buffer created."
(list command mode name-function highlight-regexp))
(set (make-local-variable 'revert-buffer-function)
'compilation-revert-buffer)
- (set-window-start outwin (point-min))
+ (and outwin (set-window-start outwin (point-min)))
;; Position point as the user will see it.
(let ((desired-visible-point
@@ -1663,15 +1659,15 @@ Returns the compilation buffer created."
(point-max)
;; Normally put it at the top.
(point-min))))
- (if (eq outwin (selected-window))
- (goto-char desired-visible-point)
+ (goto-char desired-visible-point)
+ (when (and outwin (not (eq outwin (selected-window))))
(set-window-point outwin desired-visible-point)))
;; The setup function is called before compilation-set-window-height
;; so it can set the compilation-window-height buffer locally.
(if compilation-process-setup-function
(funcall compilation-process-setup-function))
- (compilation-set-window-height outwin)
+ (and outwin (compilation-set-window-height outwin))
;; Start the compilation.
(if (fboundp 'start-process)
(let ((proc
@@ -2513,14 +2509,16 @@ and overlay is highlighted between MK and END-MK."
;; the error location if the two buffers are in two
;; different frames. So don't do it if it's not necessary.
pre-existing
- (display-buffer (marker-buffer msg))))
+ (display-buffer (marker-buffer msg) '(nil (allow-no-window . t)))))
(highlight-regexp (with-current-buffer (marker-buffer msg)
;; also do this while we change buffer
- (compilation-set-window w msg)
+ (goto-char (marker-position msg))
+ (and w (compilation-set-window w msg))
compilation-highlight-regexp)))
;; Ideally, the window-size should be passed to `display-buffer'
;; so it's only used when creating a new window.
- (unless pre-existing (compilation-set-window-height w))
+ (when (and (not pre-existing) w)
+ (compilation-set-window-height w))
(if from-compilation-buffer
;; If the compilation buffer window was selected,
@@ -2631,9 +2629,12 @@ attempts to find a file whose name is produced by (format FMT FILENAME)."
(while (null buffer) ;Repeat until the user selects an existing file.
;; The file doesn't exist. Ask the user where to find it.
(save-excursion ;This save-excursion is probably not right.
- (let ((pop-up-windows t))
- (compilation-set-window (display-buffer (marker-buffer marker))
- marker)
+ (let ((w (let ((pop-up-windows t))
+ (display-buffer (marker-buffer marker)
+ '(nil (allow-no-window . t))))))
+ (with-current-buffer (marker-buffer marker)
+ (goto-char marker)
+ (and w (compilation-set-window w marker)))
(let* ((name (read-file-name
(format "Find this %s in (default %s): "
compilation-error filename)
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 4b0a012e538..224def85895 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -981,7 +981,8 @@ no input, and GDB is waiting for input."
(eq gud-minor-mode 'gdbmi))
(error "Not in a GDB-MI buffer"))
(let ((proc (get-buffer-process gud-comint-buffer)))
- (if (and (eobp) proc (process-live-p proc)
+ (if (and (eobp)
+ (process-live-p proc)
(not gud-running)
(= (point) (marker-position (process-mark proc))))
;; Sending an EOF does not work with GDB-MI; submit an
@@ -1584,9 +1585,8 @@ this trigger is subscribed to `gdb-buf-publisher' and called with
;; read from the pty, and stops listening to it. If the gdb
;; process is still running, remove the pty, make a new one, and
;; pass it to gdb.
- (let ((gdb-proc (get-buffer-process gud-comint-buffer))
- (io-buffer (process-buffer proc)))
- (when (and gdb-proc (process-live-p gdb-proc)
+ (let ((io-buffer (process-buffer proc)))
+ (when (and (process-live-p (get-buffer-process gud-comint-buffer))
(buffer-live-p io-buffer))
;; `comint-exec' deletes the original process as a side effect.
(comint-exec io-buffer "gdb-inferior" nil nil nil)
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 46af51e1f97..e63e29df37d 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -995,8 +995,6 @@ to specify a command to run."
(compilation-start regexp 'grep-mode))
(setq dir (file-name-as-directory (expand-file-name dir)))
(require 'find-dired) ; for `find-name-arg'
- ;; In Tramp, there could be problems if the command line is too
- ;; long. We escape it, therefore.
(let ((command (grep-expand-template
grep-find-template
regexp
@@ -1005,7 +1003,7 @@ to specify a command to run."
(mapconcat
#'shell-quote-argument
(split-string files)
- (concat "\\\n" " -o " find-name-arg " "))
+ (concat " -o " find-name-arg " "))
" "
(shell-quote-argument ")"))
dir
@@ -1026,7 +1024,7 @@ to specify a command to run."
(concat "*/"
(cdr ignore)))))))
grep-find-ignored-directories
- "\\\n -o -path ")
+ " -o -path ")
" "
(shell-quote-argument ")")
" -prune -o "))
@@ -1044,7 +1042,7 @@ to specify a command to run."
(shell-quote-argument
(cdr ignore))))))
grep-find-ignored-files
- "\\\n -o -name ")
+ " -o -name ")
" "
(shell-quote-argument ")")
" -prune -o "))))))
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 49a21933133..17c13607d71 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1749,8 +1749,8 @@ nil."
(when (save-excursion
(and (not (eq (point-at-bol) (point-min)))
(not (looking-at "[{]"))
+ (js--re-search-backward "[[:graph:]]" nil t)
(progn
- (js--re-search-backward "[[:graph:]]" nil t)
(or (eobp) (forward-char))
(when (= (char-before) ?\)) (backward-list))
(skip-syntax-backward " ")
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index f128441a54e..778659c0de4 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -110,6 +110,7 @@ parenthetical grouping.")
(define-key map "\C-c;" 'octave-update-function-file-comment)
(define-key map "\C-hd" 'octave-help)
(define-key map "\C-ha" 'octave-lookfor)
+ (define-key map "\C-c\C-l" 'octave-source-file)
(define-key map "\C-c\C-f" 'octave-insert-defun)
(define-key map "\C-c\C-il" 'octave-send-line)
(define-key map "\C-c\C-ib" 'octave-send-block)
@@ -174,6 +175,7 @@ parenthetical grouping.")
["Send Current Function" octave-send-defun t]
["Send Region" octave-send-region t]
["Send Buffer" octave-send-buffer t]
+ ["Source Current File" octave-source-file t]
["Show Process Buffer" octave-show-process-buffer t]
["Hide Process Buffer" octave-hide-process-buffer t]
["Kill Process" octave-kill-process t])
@@ -361,7 +363,8 @@ Non-nil means always go to the next Octave code line after sending."
;; corresponding continuation lines).
(defconst octave-operator-regexp
- (regexp-opt (apply 'append (mapcar 'cdr octave-operator-table))))
+ (regexp-opt (remove "\n" (apply 'append
+ (mapcar 'cdr octave-operator-table)))))
(defun octave-smie-backward-token ()
(let ((pos (point)))
@@ -441,7 +444,7 @@ Non-nil means always go to the next Octave code line after sending."
"unwind_protect_cleanup")
(smie-rule-parent octave-block-offset)
;; For (invalid) code between switch and case.
- ;; (if (smie-parent-p "switch") 4)
+ ;; (if (smie-rule-parent-p "switch") 4)
nil))))
(defun octave-indent-comment ()
@@ -545,7 +548,7 @@ definitions can also be stored in files and used in batch mode."
;; a ";" at those places where it's correct (i.e. outside of parens).
(setq-local electric-layout-rules '((?\; . after)))
- (setq-local comment-use-global-state t)
+ (setq-local comment-use-syntax t)
(setq-local comment-start octave-comment-start)
(setq-local comment-end "")
(setq-local comment-start-skip octave-comment-start-skip)
@@ -596,7 +599,9 @@ definitions can also be stored in files and used in batch mode."
:group 'octave)
(defcustom inferior-octave-prompt
- "\\(^octave\\(\\|.bin\\|.exe\\)\\(-[.0-9]+\\)?\\(:[0-9]+\\)?\\|^debug\\|^\\)>+ "
+ ;; For Octave >= 3.8, default is always 'octave', see
+ ;; http://hg.savannah.gnu.org/hgweb/octave/rev/708173343c50
+ "\\(?:^octave\\(?:.bin\\|.exe\\)?\\(?:-[.0-9]+\\)?\\(?::[0-9]+\\)?\\|^debug\\|^\\)>+ "
"Regexp to match prompts for the inferior Octave process."
:type 'regexp
:group 'octave)
@@ -696,12 +701,15 @@ in the Inferior Octave buffer.")
(declare-function compilation-forget-errors "compile" ())
+(defun inferior-octave-process-live-p ()
+ (process-live-p inferior-octave-process))
+
(define-derived-mode inferior-octave-mode comint-mode "Inferior Octave"
"Major mode for interacting with an inferior Octave process."
:abbrev-table octave-abbrev-table
(setq comint-prompt-regexp inferior-octave-prompt)
- (setq-local comment-use-global-state t)
+ (setq-local comment-use-syntax t)
(setq-local comment-start octave-comment-start)
(setq-local comment-end "")
(setq comment-column 32)
@@ -780,8 +788,13 @@ startup file, `~/.emacs-octave'."
;; output may be mixed up). Hence, we need to digest the Octave
;; output to see when it issues a prompt.
(while inferior-octave-receive-in-progress
- (or (process-live-p inferior-octave-process)
- (error "Process `%s' died" inferior-octave-process))
+ (unless (inferior-octave-process-live-p)
+ ;; Spit out the error messages.
+ (when inferior-octave-output-list
+ (princ (concat (mapconcat 'identity inferior-octave-output-list "\n")
+ "\n")
+ (process-mark inferior-octave-process)))
+ (error "Process `%s' died" inferior-octave-process))
(accept-process-output inferior-octave-process))
(goto-char (point-max))
(set-marker (process-mark proc) (point))
@@ -810,7 +823,8 @@ startup file, `~/.emacs-octave'."
(inferior-octave-send-list-and-digest
(list "more off;\n"
(unless (equal inferior-octave-output-string ">> ")
- "PS1 ('\\s> ');\n")
+ ;; See http://hg.savannah.gnu.org/hgweb/octave/rev/708173343c50
+ "PS1 ('octave> ');\n")
(when (and inferior-octave-startup-file
(file-exists-p inferior-octave-startup-file))
(format "source ('%s');\n" inferior-octave-startup-file))))
@@ -827,21 +841,13 @@ startup file, `~/.emacs-octave'."
;; `comint-history-isearch-backward-regexp'. Bug#14433.
(comint-send-string proc "\n")))
-(defvar inferior-octave-completion-table
- ;;
- ;; Use cache to avoid repetitive computation of completions due to
- ;; bug#11906 - http://debbugs.gnu.org/11906 - which may cause
- ;; noticeable delay. CACHE: (CMD . VALUE).
- (let ((cache))
- (completion-table-dynamic
- (lambda (command)
- (unless (equal (car cache) command)
- (inferior-octave-send-list-and-digest
- (list (format "completion_matches ('%s');\n" command)))
- (setq cache (cons command
- (delete-consecutive-dups
- (sort inferior-octave-output-list 'string-lessp)))))
- (cdr cache)))))
+(defun inferior-octave-completion-table ()
+ (completion-table-with-cache
+ (lambda (command)
+ (inferior-octave-send-list-and-digest
+ (list (format "completion_matches ('%s');\n" command)))
+ (delete-consecutive-dups
+ (sort inferior-octave-output-list 'string-lessp)))))
(defun inferior-octave-completion-at-point ()
"Return the data to complete the Octave symbol at point."
@@ -853,7 +859,7 @@ startup file, `~/.emacs-octave'."
(end (point)))
(when (and beg (> end beg))
(list beg end (completion-table-in-turn
- inferior-octave-completion-table
+ (inferior-octave-completion-table)
'comint-completion-file-name-table))))))
(define-obsolete-function-alias 'inferior-octave-complete
@@ -901,8 +907,7 @@ the rest to `inferior-octave-output-string'."
(setq inferior-octave-output-string string))
(defun inferior-octave-check-process ()
- (or (and inferior-octave-process
- (process-live-p inferior-octave-process))
+ (or (inferior-octave-process-live-p)
(error (substitute-command-keys
"No inferior octave process running. Type \\[run-octave]"))))
@@ -971,8 +976,7 @@ directory and makes this the current buffer's default directory."
(let ((width (max inferior-octave-minimal-columns (window-width))))
(unless (eq inferior-octave-last-column-width width)
(setq-local inferior-octave-last-column-width width)
- (when (and inferior-octave-process
- (process-live-p inferior-octave-process))
+ (when (inferior-octave-process-live-p)
(inferior-octave-send-list-and-digest
(list (format "putenv ('COLUMNS', '%s');\n" width)))))))
@@ -1013,7 +1017,7 @@ directory and makes this the current buffer's default directory."
(completing-read
(format (if def "Function (default %s): "
"Function: ") def)
- inferior-octave-completion-table
+ (inferior-octave-completion-table)
nil nil nil nil def)))
(defun octave-goto-function-definition (fn)
@@ -1029,8 +1033,8 @@ directory and makes this the current buffer's default directory."
(unless found (goto-char orig))
found))))
(pcase (and buffer-file-name (file-name-extension buffer-file-name))
- (`"cc" (funcall search
- "\\_<DEFUN\\(?:_DLD\\)?\\s-*(\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)" 1))
+ ("cc" (funcall search
+ "\\_<DEFUN\\(?:_DLD\\)?\\s-*(\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)" 1))
(t (funcall search octave-function-header-regexp 3)))))
(defun octave-function-file-p ()
@@ -1099,19 +1103,19 @@ q: Don't fix\n" func file))
(read-char-choice
"Which name to use? (a/b/q) " '(?a ?b ?q))))))
(pcase c
- (`?a (let ((newname (expand-file-name
- (concat func (file-name-extension
- buffer-file-name t)))))
- (when (or (not (file-exists-p newname))
- (yes-or-no-p
- (format "Target file %s exists; proceed? " newname)))
- (when (file-exists-p buffer-file-name)
- (rename-file buffer-file-name newname t))
- (set-visited-file-name newname))))
- (`?b (save-excursion
- (goto-char name-start)
- (delete-region name-start name-end)
- (insert file)))))))))
+ (?a (let ((newname (expand-file-name
+ (concat func (file-name-extension
+ buffer-file-name t)))))
+ (when (or (not (file-exists-p newname))
+ (yes-or-no-p
+ (format "Target file %s exists; proceed? " newname)))
+ (when (file-exists-p buffer-file-name)
+ (rename-file buffer-file-name newname t))
+ (set-visited-file-name newname))))
+ (?b (save-excursion
+ (goto-char name-start)
+ (delete-region name-start name-end)
+ (insert file)))))))))
(defun octave-update-function-file-comment (beg end)
"Query replace function names in function file comment."
@@ -1396,9 +1400,8 @@ The block marked is the one that contains point or follows point."
(save-excursion (skip-syntax-forward "w_")
(setq end (point))))
(when (> end beg)
- (list beg end (or (and inferior-octave-process
- (process-live-p inferior-octave-process)
- inferior-octave-completion-table)
+ (list beg end (or (and (inferior-octave-process-live-p)
+ (inferior-octave-completion-table))
octave-reserved-words)))))
(define-obsolete-function-alias 'octave-complete-symbol
@@ -1442,12 +1445,15 @@ entered without parens)."
(defun octave-kill-process ()
"Kill inferior Octave process and its buffer."
(interactive)
- (if inferior-octave-process
- (progn
- (process-send-string inferior-octave-process "quit;\n")
- (accept-process-output inferior-octave-process)))
- (if inferior-octave-buffer
- (kill-buffer inferior-octave-buffer)))
+ (when (and (buffer-live-p (get-buffer inferior-octave-buffer))
+ (or (yes-or-no-p (format "Kill %S and its buffer? "
+ inferior-octave-process))
+ (user-error "Aborted")))
+ (when (inferior-octave-process-live-p)
+ (set-process-query-on-exit-flag inferior-octave-process nil)
+ (process-send-string inferior-octave-process "quit;\n")
+ (accept-process-output inferior-octave-process))
+ (kill-buffer inferior-octave-buffer)))
(defun octave-show-process-buffer ()
"Make sure that `inferior-octave-buffer' is displayed."
@@ -1463,6 +1469,19 @@ entered without parens)."
(delete-windows-on inferior-octave-buffer)
(message "No buffer named %s" inferior-octave-buffer)))
+(defun octave-source-file (file)
+ "Execute FILE in the inferior Octave process.
+This is done using Octave's source function. FILE defaults to
+current buffer file unless called with a prefix arg \\[universal-argument]."
+ (interactive (list (or (and (not current-prefix-arg) buffer-file-name)
+ (read-file-name "File: " nil nil t))))
+ (or (stringp file)
+ (signal 'wrong-type-argument (list 'stringp file)))
+ (inferior-octave t)
+ (with-current-buffer inferior-octave-buffer
+ (comint-send-string inferior-octave-process
+ (format "source '%s'\n" file))))
+
(defun octave-send-region (beg end)
"Send current region to the inferior Octave process."
(interactive "r")
@@ -1577,8 +1596,7 @@ code line."
(defun octave-eldoc-function ()
"A function for `eldoc-documentation-function' (which see)."
- (when (and inferior-octave-process
- (process-live-p inferior-octave-process))
+ (when (inferior-octave-process-live-p)
(let* ((ppss (syntax-ppss))
(paren-pos (cadr ppss))
(fn (save-excursion
@@ -1633,7 +1651,7 @@ code line."
(defvar octave-help-mode-map
(let ((map (make-sparse-keymap)))
- (define-key map "\M-." 'octave-find-definition)
+ (define-key map "\M-." 'octave-find-definition)
(define-key map "\C-hd" 'octave-help)
(define-key map "\C-ha" 'octave-lookfor)
map))
@@ -1643,26 +1661,9 @@ code line."
:abbrev-table nil
:syntax-table octave-mode-syntax-table
(eval-and-compile (require 'help-mode))
- ;; Mostly stolen from `help-make-xrefs'.
- (let ((inhibit-read-only t))
- (setq-local info-lookup-mode 'octave-mode)
- ;; Delete extraneous newlines at the end of the docstring
- (goto-char (point-max))
- (while (and (not (bobp)) (bolp))
- (delete-char -1))
- (insert "\n")
- (when (or help-xref-stack help-xref-forward-stack)
- (insert "\n"))
- (when help-xref-stack
- (help-insert-xref-button help-back-label 'help-back
- (current-buffer)))
- (when help-xref-forward-stack
- (when help-xref-stack
- (insert "\t"))
- (help-insert-xref-button help-forward-label 'help-forward
- (current-buffer)))
- (when (or help-xref-stack help-xref-forward-stack)
- (insert "\n"))))
+ ;; Don't highlight `EXAMPLE' as elisp symbols by using a regexp that
+ ;; can never match.
+ (setq-local help-xref-symbol-regexp "x\\`"))
(defun octave-help (fn)
"Display the documentation of FN."
@@ -1773,19 +1774,19 @@ If the environment variable OCTAVE_SRCDIR is set, it is searched first."
(defun octave-find-definition-default-filename (name)
"Default value for `octave-find-definition-filename-function'."
(pcase (file-name-extension name)
- (`"oct"
+ ("oct"
(octave-find-definition-default-filename
(concat "libinterp/dldfcn/"
(file-name-sans-extension (file-name-nondirectory name))
".cc")))
- (`"cc"
+ ("cc"
(let ((file (or (locate-file name (octave-source-directories))
(locate-file (file-name-nondirectory name)
(octave-source-directories)))))
(or (and file (file-exists-p file))
(error "File `%s' not found" name))
file))
- (`"mex"
+ ("mex"
(if (yes-or-no-p (format "File `%s' may be binary; open? "
(file-name-nondirectory name)))
name
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 7a90f0bb5ee..3e0708cd3c2 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -40,9 +40,9 @@
;; Indentation: Automatic indentation with indentation cycling is
;; provided, it allows you to navigate different available levels of
-;; indentation by hitting <tab> several times. Also when inserting a
-;; colon the `python-indent-electric-colon' command is invoked and
-;; causes the current line to be dedented automatically if needed.
+;; indentation by hitting <tab> several times. Also electric-indent-mode
+;; is supported such that when inserting a colon the current line is
+;; dedented automatically if needed.
;; Movement: `beginning-of-defun' and `end-of-defun' functions are
;; properly implemented. There are also specialized
@@ -248,7 +248,6 @@
(define-key map (kbd "<backtab>") 'python-indent-dedent-line)
(define-key map "\C-c<" 'python-indent-shift-left)
(define-key map "\C-c>" 'python-indent-shift-right)
- (define-key map ":" 'python-indent-electric-colon)
;; Skeletons
(define-key map "\C-c\C-tc" 'python-skeleton-class)
(define-key map "\C-c\C-td" 'python-skeleton-def)
@@ -676,7 +675,7 @@ AFTER-LINE.")
(goto-char block-end)
(python-util-forward-comment)
(current-indentation))))
- (if indentation
+ (if (and indentation (not (zerop indentation)))
(set (make-local-variable 'python-indent-offset) indentation)
(message "Can't guess python-indent-offset, using defaults: %s"
python-indent-offset)))))))
@@ -1058,48 +1057,43 @@ the lines in which START and END lie."
(list (region-beginning) (region-end) current-prefix-arg)
(list (line-beginning-position) (line-end-position) current-prefix-arg)))
(let ((deactivate-mark nil))
- (if count
- (setq count (prefix-numeric-value count))
- (setq count python-indent-offset))
+ (setq count (if count (prefix-numeric-value count)
+ python-indent-offset))
(indent-rigidly start end count)))
-(defun python-indent-electric-colon (arg)
- "Insert a colon and maybe de-indent the current line.
-With numeric ARG, just insert that many colons. With
-\\[universal-argument], just insert a single colon."
- (interactive "*P")
- (self-insert-command (if (not (integerp arg)) 1 arg))
- (when (and (not arg)
- (eolp)
- (not (equal ?: (char-after (- (point-marker) 2))))
- (not (python-syntax-comment-or-string-p)))
- (let ((indentation (current-indentation))
- (calculated-indentation (python-indent-calculate-indentation)))
- (python-info-closing-block-message)
- (when (> indentation calculated-indentation)
- (save-excursion
- (indent-line-to calculated-indentation)
- (when (not (python-info-closing-block-message))
- (indent-line-to indentation)))))))
-(put 'python-indent-electric-colon 'delete-selection t)
-
(defun python-indent-post-self-insert-function ()
- "Adjust closing paren line indentation after a char is added.
+ "Adjust indentation after insertion of some characters.
This function is intended to be added to the
`post-self-insert-hook.' If a line renders a paren alone, after
adding a char before it, the line will be re-indented
automatically if needed."
- (when (and (eq (char-before) last-command-event)
- (not (bolp))
- (memq (char-after) '(?\) ?\] ?\})))
- (save-excursion
- (goto-char (line-beginning-position))
- ;; If after going to the beginning of line the point
- ;; is still inside a paren it's ok to do the trick
- (when (python-syntax-context 'paren)
- (let ((indentation (python-indent-calculate-indentation)))
- (when (< (current-indentation) indentation)
- (indent-line-to indentation)))))))
+ (when (and electric-indent-mode
+ (eq (char-before) last-command-event))
+ (cond
+ ((and (not (bolp))
+ (memq (char-after) '(?\) ?\] ?\})))
+ (save-excursion
+ (goto-char (line-beginning-position))
+ ;; If after going to the beginning of line the point
+ ;; is still inside a paren it's ok to do the trick
+ (when (python-syntax-context 'paren)
+ (let ((indentation (python-indent-calculate-indentation)))
+ (when (< (current-indentation) indentation)
+ (indent-line-to indentation))))))
+ ((and (eq ?: last-command-event)
+ (memq ?: electric-indent-chars)
+ (not current-prefix-arg)
+ (eolp)
+ (not (equal ?: (char-before (1- (point)))))
+ (not (python-syntax-comment-or-string-p)))
+ (let ((indentation (current-indentation))
+ (calculated-indentation (python-indent-calculate-indentation)))
+ (python-info-closing-block-message)
+ (when (> indentation calculated-indentation)
+ (save-excursion
+ (indent-line-to calculated-indentation)
+ (when (not (python-info-closing-block-message))
+ (indent-line-to indentation)))))))))
;;; Navigation
@@ -2056,7 +2050,7 @@ When MSG is non-nil messages the first line of STRING."
(let ((process (or process (python-shell-get-or-create-process))))
(if (string-match ".\n+." string) ;Multiline.
(let* ((temp-file-name (python-shell--save-temp-file string)))
- (python-shell-send-file temp-file-name process temp-file-name))
+ (python-shell-send-file temp-file-name process temp-file-name t))
(comint-send-string process string)
(when (or (not (string-match "\n\\'" string))
(string-match "\n[ \t].*\n?\\'" string))
@@ -2212,7 +2206,7 @@ the python shell:
(message "Sent: %s..." (match-string 1 string))
(let* ((temp-file-name (python-shell--save-temp-file string))
(file-name (or (buffer-file-name) temp-file-name)))
- (python-shell-send-file file-name process temp-file-name)
+ (python-shell-send-file file-name process temp-file-name t)
(unless python--use-fake-loc
(with-current-buffer (process-buffer process)
(compilation-fake-loc (copy-marker start) temp-file-name
@@ -2249,11 +2243,12 @@ When argument ARG is non-nil do not include decorators."
(end-of-line 1))
(point-marker)))))
-(defun python-shell-send-file (file-name &optional process temp-file-name)
+(defun python-shell-send-file (file-name &optional process temp-file-name
+ delete)
"Send FILE-NAME to inferior Python PROCESS.
If TEMP-FILE-NAME is passed then that file is used for processing
instead, while internally the shell will continue to use
-FILE-NAME."
+FILE-NAME. If DELETE is non-nil, delete the file afterwards."
(interactive "fFile to send: ")
(let* ((process (or process (python-shell-get-or-create-process)))
(temp-file-name (when temp-file-name
@@ -2271,8 +2266,11 @@ FILE-NAME."
(format
(concat "__pyfile = open('''%s''');"
"exec(compile(__pyfile.read(), '''%s''', 'exec'));"
- "__pyfile.close()")
- (or temp-file-name file-name) file-name)
+ "__pyfile.close()%s")
+ (or temp-file-name file-name) file-name
+ (if delete (format "; import os; os.remove('''%s''')"
+ (or temp-file-name file-name))
+ ""))
process)))
(defun python-shell-switch-to-shell ()
@@ -3615,6 +3613,7 @@ list is returned as is."
(set (make-local-variable 'indent-region-function) #'python-indent-region)
;; Because indentation is not redundant, we cannot safely reindent code.
(setq-local electric-indent-inhibit t)
+ (setq-local electric-indent-chars (cons ?: electric-indent-chars))
;; Add """ ... """ pairing to electric-pair-mode.
(add-hook 'post-self-insert-hook
@@ -3622,7 +3621,7 @@ list is returned as is."
(set (make-local-variable 'paragraph-start) "\\s-*$")
(set (make-local-variable 'fill-paragraph-function)
- 'python-fill-paragraph)
+ #'python-fill-paragraph)
(set (make-local-variable 'beginning-of-defun-function)
#'python-nav-beginning-of-defun)
@@ -3630,10 +3629,10 @@ list is returned as is."
#'python-nav-end-of-defun)
(add-hook 'completion-at-point-functions
- 'python-completion-complete-at-point nil 'local)
+ #'python-completion-complete-at-point nil 'local)
(add-hook 'post-self-insert-hook
- 'python-indent-post-self-insert-function nil 'local)
+ #'python-indent-post-self-insert-function 'append 'local)
(set (make-local-variable 'imenu-create-index-function)
#'python-imenu-create-index)
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 28c44307ff2..3d30cb015d6 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -186,7 +186,6 @@ This should only be called after matching against `ruby-here-doc-beg-re'."
(modify-syntax-entry ?\n ">" table)
(modify-syntax-entry ?\\ "\\" table)
(modify-syntax-entry ?$ "." table)
- (modify-syntax-entry ?? "_" table)
(modify-syntax-entry ?_ "_" table)
(modify-syntax-entry ?: "_" table)
(modify-syntax-entry ?< "." table)
@@ -270,13 +269,15 @@ even if it's not required."
(const :tag "Emacs Style" emacs)
(const :tag "Ruby Style" ruby)
(const :tag "Custom Style" custom))
- :group 'ruby)
+ :group 'ruby
+ :version "24.4")
-(defcustom ruby-custom-encoding-magic-comment-template "# coding: %s"
- "The encoding comment template to be used when
-`ruby-encoding-magic-comment-style' is set to `custom'."
+(defcustom ruby-custom-encoding-magic-comment-template "# encoding: %s"
+ "A custom encoding comment template.
+It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
:type 'string
- :group 'ruby)
+ :group 'ruby
+ :version "24.4")
(defcustom ruby-use-encoding-map t
"Use `ruby-encoding-map' to set encoding magic comment if this is non-nil."
@@ -781,7 +782,7 @@ Can be one of `heredoc', `modifier', `expr-qstr', `expr-re'."
ruby-block-mid-keywords)
'words))
(goto-char (match-end 0))
- (not (looking-at "\\s_\\|!")))
+ (not (looking-at "\\s_")))
((eq option 'expr-qstr)
(looking-at "[a-zA-Z][a-zA-z0-9_]* +%[^ \t]"))
((eq option 'expr-re)
@@ -1646,6 +1647,14 @@ It will be properly highlighted even when the call omits parens.")
;; Not within a string.
(nth 3 (syntax-ppss (match-beginning 0))))
(string-to-syntax "\\"))))
+ ;; Part of symbol when at the end of a method name.
+ ("[!?]"
+ (0 (unless (save-excursion
+ (or (nth 8 (syntax-ppss (match-beginning 0)))
+ (let (parse-sexp-lookup-properties)
+ (zerop (skip-syntax-backward "w_")))
+ (memq (preceding-char) '(?@ ?$))))
+ (string-to-syntax "_"))))
;; Regular expressions. Start with matching unescaped slash.
("\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*\\(/\\)"
(1 (let ((state (save-excursion (syntax-ppss (match-beginning 1)))))
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 3ac0868414b..c270d433e76 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1478,7 +1478,7 @@ frequently editing existing scripts with different styles.")
(defun sh-shell-process (force)
"Get a shell process for interaction.
If FORCE is non-nil and no process found, create one."
- (if (and sh-shell-process (process-live-p sh-shell-process))
+ (if (process-live-p sh-shell-process)
sh-shell-process
(setq sh-shell-process
(let ((found nil) proc
diff --git a/lisp/replace.el b/lisp/replace.el
index 9d7aba333c4..061300c7829 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -523,6 +523,8 @@ and TO-STRING is also null.)"
(if (and transient-mark-mode mark-active)
(region-end)))))
(perform-replace from-string to-string nil nil delimited nil nil start end))
+(put 'replace-string 'interactive-only
+ "use `search-forward' and `replace-match' instead.")
(defun replace-regexp (regexp to-string &optional delimited start end)
"Replace things after point matching REGEXP with TO-STRING.
@@ -590,6 +592,8 @@ which will run faster and will not set the mark or print anything."
(if (and transient-mark-mode mark-active)
(region-end)))))
(perform-replace regexp to-string nil t delimited nil nil start end))
+(put 'replace-regexp 'interactive-only
+ "use `re-search-forward' and `replace-match' instead.")
(defvar regexp-history nil
diff --git a/lisp/ses.el b/lisp/ses.el
index 5f48dd2f27e..77af0ba89ab 100644
--- a/lisp/ses.el
+++ b/lisp/ses.el
@@ -1886,13 +1886,39 @@ Delete overlays, remove special text properties."
;;;###autoload
(defun ses-mode ()
"Major mode for Simple Emacs Spreadsheet.
-See \"ses-example.ses\" (in `data-directory') for more info.
-Key definitions:
+When you invoke SES in a new buffer, it is divided into cells
+that you can enter data into. You can navigate the cells with
+the arrow keys and add more cells with the tab key. The contents
+of these cells can be numbers, text, or Lisp expressions. (To
+enter text, enclose it in double quotes.)
+
+In an expression, you can use cell coordinates to refer to the
+contents of another cell. For example, you can sum a range of
+cells with `(+ A1 A2 A3)'. There are specialized functions like
+`ses+' (addition for ranges with empty cells), `ses-average' (for
+performing calculations on cells), and `ses-range' and `ses-select'
+\(for extracting ranges of cells).
+
+Each cell also has a print function that controls how it is
+displayed.
+
+Each SES buffer is divided into a print area and a data area.
+Normally, you can simply use SES to look at and manipulate the print
+area, and let SES manage the data area outside the visible region.
+
+See \"ses-example.ses\" (in `data-directory') for an example
+spreadsheet, and the Info node `(ses)Top.'
+
+In the following, note the separate keymaps for cell editing mode
+and print mode specifications. Key definitions:
+
\\{ses-mode-map}
-These key definitions are active only in the print area (the visible part):
+These key definitions are active only in the print area (the visible
+part):
\\{ses-mode-print-map}
-These are active only in the minibuffer, when entering or editing a formula:
+These are active only in the minibuffer, when entering or editing a
+formula:
\\{ses-mode-edit-map}"
(interactive)
(unless (and (boundp 'ses--deferred-narrow)
diff --git a/lisp/simple.el b/lisp/simple.el
index ca2088eeb24..260c1702def 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -384,7 +384,8 @@ text-property `hard'.
With ARG, insert that many newlines.
Call `auto-fill-function' if the current column number is greater
than the value of `fill-column' and ARG is nil.
-A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'."
+A non-nil INTERACTIVE argument means to run the `post-self-insert-hook',
+which by default will also indent the line (see `electric-indent-mode')."
(interactive "*P\np")
(barf-if-buffer-read-only)
;; Call self-insert so that auto-fill, abbrev expansion etc. happens.
@@ -888,6 +889,8 @@ Don't use this command in Lisp programs!
(/ (+ 10 (* size (prefix-numeric-value arg))) 10)))
(point-min))))
(if (and arg (not (consp arg))) (forward-line 1)))
+(put 'beginning-of-buffer 'interactive-only
+ "use `(goto-char (point-min))' instead.")
(defun end-of-buffer (&optional arg)
"Move point to the end of the buffer.
@@ -920,6 +923,7 @@ Don't use this command in Lisp programs!
;; then scroll specially to put it near, but not at, the bottom.
(overlay-recenter (point))
(recenter -3))))
+(put 'end-of-buffer 'interactive-only "use `(goto-char (point-max))' instead.")
(defcustom delete-active-region t
"Whether single-char deletion commands delete an active region.
@@ -982,6 +986,7 @@ the end of the line."
(insert-char ?\s (- ocol (current-column)) nil))))
;; Otherwise, do simple deletion.
(t (delete-char (- n) killflag))))
+(put 'delete-backward-char 'interactive-only 'delete-char)
(defun delete-forward-char (n &optional killflag)
"Delete the following N characters (previous if N is negative).
@@ -1079,6 +1084,7 @@ rather than line counts."
(if (eq selective-display t)
(re-search-forward "[\n\C-m]" nil 'end (1- line))
(forward-line (1- line)))))
+(put 'goto-line 'interactive-only 'forward-line)
(defun count-words-region (start end &optional arg)
"Count the number of words in the region.
@@ -2634,6 +2640,12 @@ to execute it asynchronously.
The output appears in the buffer `*Async Shell Command*'.
That buffer is in shell mode.
+You can configure `async-shell-command-buffer' to specify what to do in
+case when `*Async Shell Command*' buffer is already taken by another
+running shell command. To run COMMAND without displaying the output
+in a window you can configure `display-buffer-alist' to use the action
+`display-buffer-no-window' for the buffer `*Async Shell Command*'.
+
In Elisp, you will often be better served by calling `start-process'
directly, since it offers more control and does not impose the use of a
shell (with its need to quote arguments)."
@@ -2820,7 +2832,7 @@ the use of a shell (with its need to quote arguments)."
;; which comint sometimes adds for prompts.
(let ((inhibit-read-only t))
(erase-buffer))
- (display-buffer buffer)
+ (display-buffer buffer '(nil (allow-no-window . t)))
(setq default-directory directory)
(setq proc (start-process "Shell" buffer shell-file-name
shell-command-switch command))
@@ -4165,6 +4177,7 @@ Don't call it from programs: use `insert-buffer-substring' instead!"
(insert-buffer-substring (get-buffer buffer))
(point)))
nil)
+(put 'insert-buffer 'interactive-only 'insert-buffer-substring)
(defun append-to-buffer (buffer start end)
"Append to specified buffer the text of the region.
@@ -4763,6 +4776,7 @@ and more reliable (no dependence on goal column, etc.)."
(signal (car err) (cdr err))))
(line-move arg nil nil try-vscroll)))
nil)
+(put 'next-line 'interactive-only 'forward-line)
(defun previous-line (&optional arg try-vscroll)
"Move cursor vertically up ARG lines.
@@ -4802,6 +4816,8 @@ to use and more reliable (no dependence on goal column, etc.)."
(signal (car err) (cdr err))))
(line-move (- arg) nil nil try-vscroll))
nil)
+(put 'previous-line 'interactive-only
+ "use `forward-line' with negative argument instead.")
(defcustom track-eol nil
"Non-nil means vertical motion starting at end of line keeps to ends of lines.
diff --git a/lisp/startup.el b/lisp/startup.el
index 2394c73b879..a21695fe19a 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -499,18 +499,17 @@ It is the default value of the variable `top-level'."
;; available input methods.
(let ((tail load-path)
(lispdir (expand-file-name "../lisp" data-directory))
- ;; For out-of-tree builds, leim-list is generated in the build dir.
-;;; (leimdir (expand-file-name "../leim" doc-directory))
dir)
(while tail
(setq dir (car tail))
(let ((default-directory dir))
(load (expand-file-name "subdirs.el") t t t))
- ;; Do not scan standard directories that won't contain a leim-list.el.
- ;; http://lists.gnu.org/archive/html/emacs-devel/2009-10/msg00502.html
- (or (string-match (concat "\\`" lispdir) dir)
- (let ((default-directory dir))
- (load (expand-file-name "leim-list.el") t t t)))
+ ;; Do not scan standard directories that won't contain a leim-list.el.
+ ;; http://lists.gnu.org/archive/html/emacs-devel/2009-10/msg00502.html
+ ;; (Except the preloaded one in lisp/leim.)
+ (or (string-prefix-p lispdir dir)
+ (let ((default-directory dir))
+ (load (expand-file-name "leim-list.el") t t t)))
;; We don't use a dolist loop and we put this "setq-cdr" command at
;; the end, because the subdirs.el files may add elements to the end
;; of load-path and we want to take it into account.
@@ -1290,6 +1289,29 @@ the `--debug-init' option to view a complete error backtrace."
;; Process the remaining args.
(command-line-1 (cdr command-line-args))
+ ;; This is a problem because, e.g. if emacs.d/gnus.el exists,
+ ;; trying to load gnus could load the wrong file.
+ ;; OK, it would not matter if .emacs.d were at the end of load-path.
+ ;; but for the sake of simplicity, we discourage it full-stop.
+ ;; Ref eg http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00056.html
+ ;;
+ ;; A bad element could come from user-emacs-file, the command line,
+ ;; or EMACSLOADPATH, so we basically always have to check.
+ (let (warned)
+ (dolist (dir load-path)
+ (and (not warned)
+ (string-match-p "/[._]emacs\\.d/?\\'" dir)
+ (string-equal (file-name-as-directory (expand-file-name dir))
+ (expand-file-name user-emacs-directory))
+ (setq warned t)
+ (display-warning 'initialization
+ (format "Your `load-path' seems to contain
+your `.emacs.d' directory: %s\n\
+This is likely to cause problems...\n\
+Consider using a subdirectory instead, e.g.: %s" dir
+(expand-file-name "lisp" user-emacs-directory))
+ :warning))))
+
;; If -batch, terminate after processing the command options.
(if noninteractive (kill-emacs t))
@@ -1765,6 +1787,10 @@ Returning non-nil does not mean we should necessarily
use the fancy splash screen, but if we do use it,
we put it on this frame."
(let (chosen-frame)
+ ;; MS-Windows needs this to have a chance to make the initial
+ ;; frame visible.
+ (if (eq system-type 'windows-nt)
+ (sit-for 0 t))
(dolist (frame (append (frame-list) (list (selected-frame))))
(if (and (frame-visible-p frame)
(not (window-minibuffer-p (frame-selected-window frame))))
@@ -1775,7 +1801,7 @@ we put it on this frame."
"Return t if fancy splash screens should be used."
(when (and (display-graphic-p)
(or (and (display-color-p)
- (image-type-available-p 'xpm))
+ (image-type-available-p 'xpm))
(image-type-available-p 'pbm)))
(let ((frame (fancy-splash-frame)))
(when frame
@@ -2219,7 +2245,7 @@ A fancy display is used on graphic displays, normal otherwise."
;; -L :/foo adds /foo to the _end_ of load-path.
(let (append)
(if (string-match-p
- "\\`:"
+ (format "\\`%s" path-separator)
(setq tem (or argval (pop command-line-args-left))))
(setq tem (substring tem 1)
append t))
diff --git a/lisp/subr.el b/lisp/subr.el
index 31798b44849..6b1e99f337c 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1885,9 +1885,11 @@ Signal an error if the program returns with a non-zero exit status."
(defun process-live-p (process)
"Returns non-nil if PROCESS is alive.
A process is considered alive if its status is `run', `open',
-`listen', `connect' or `stop'."
- (memq (process-status process)
- '(run open listen connect stop)))
+`listen', `connect' or `stop'. Value is nil if PROCESS is not a
+process."
+ (and (processp process)
+ (memq (process-status process)
+ '(run open listen connect stop))))
;; compatibility
@@ -3635,6 +3637,15 @@ to case differences."
(eq t (compare-strings str1 nil nil
str2 0 (length str1) ignore-case)))
+(defun string-suffix-p (suffix string &optional ignore-case)
+ "Return non-nil if SUFFIX is a suffix of STRING.
+If IGNORE-CASE is non-nil, the comparison is done without paying
+attention to case differences."
+ (let ((start-pos (- (length string) (length suffix))))
+ (and (>= start-pos 0)
+ (eq t (compare-strings suffix nil nil
+ string start-pos nil ignore-case)))))
+
(defun bidi-string-mark-left-to-right (str)
"Return a string that can be safely inserted in left-to-right text.
diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el
index e22ad24ccae..82faf883b77 100644
--- a/lisp/textmodes/enriched.el
+++ b/lisp/textmodes/enriched.el
@@ -31,7 +31,7 @@
;; are supported except for <smaller> and <bigger>, which are currently not
;; possible to display.
-;; A separate file, enriched.doc, contains further documentation and other
+;; A separate file, enriched.txt, contains further documentation and other
;; important information about this code. It also serves as an example
;; file in text/enriched format. It should be in the etc directory of your
;; emacs distribution.
@@ -199,7 +199,7 @@ if ARG is omitted or nil.
Turning the mode on or off runs `enriched-mode-hook'.
More information about Enriched mode is available in the file
-etc/enriched.doc in the Emacs distribution directory.
+\"enriched.txt\" in `data-directory'.
Commands:
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 7b16262233d..c01d7784309 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -2680,6 +2680,8 @@ Runs the shell command defined by `tex-show-queue-command'."
(defvar tex-indent-item tex-indent-basic)
(defvar tex-indent-item-re "\\\\\\(bib\\)?item\\>")
(defvar latex-noindent-environments '("document"))
+(put 'latex-noindent-environments 'safe-local-variable
+ (lambda (x) (null (delq t (mapcar 'stringp x)))))
(defvar tex-latex-indent-syntax-table
(let ((st (make-syntax-table tex-mode-syntax-table)))
diff --git a/lisp/time.el b/lisp/time.el
index 7e558746c6a..51365b2b8c6 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -471,7 +471,7 @@ update which can wait for the next redisplay."
;; This is inside the let binding, but we are not going to document
;; what variables are available.
(run-hooks 'display-time-hook))
- (force-mode-line-update))
+ (force-mode-line-update 'all))
(defun display-time-file-nonempty-p (file)
(let ((remote-file-name-inhibit-cache (- display-time-interval 5)))
diff --git a/lisp/uniquify.el b/lisp/uniquify.el
index 546796b619a..b7bb4c73879 100644
--- a/lisp/uniquify.el
+++ b/lisp/uniquify.el
@@ -93,7 +93,7 @@
:group 'files)
-(defcustom uniquify-buffer-name-style nil
+(defcustom uniquify-buffer-name-style 'post-forward
"If non-nil, buffer names are uniquified with parts of directory name.
The value determines the buffer name style and is one of `forward',
`reverse', `post-forward', or `post-forward-angle-brackets'.
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index e945d6ef160..0bf0b05c7d5 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -1366,7 +1366,8 @@ a diff with \\[diff-reverse-direction].
(diff-setup-whitespace)
- (setq buffer-read-only diff-default-read-only)
+ (if diff-default-read-only
+ (setq buffer-read-only t))
;; setup change hooks
(if (not diff-update-on-the-fly)
(add-hook 'write-contents-functions 'diff-write-contents-hooks nil t)
diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
index dfc7eee81a6..91390fa1123 100644
--- a/lisp/vc/log-edit.el
+++ b/lisp/vc/log-edit.el
@@ -32,6 +32,7 @@
(require 'add-log) ; for all the ChangeLog goodies
(require 'pcvs-util)
(require 'ring)
+(require 'message)
;;;;
;;;; Global Variables
@@ -55,6 +56,8 @@
("\C-c\C-a" . log-edit-insert-changelog)
("\C-c\C-d" . log-edit-show-diff)
("\C-c\C-f" . log-edit-show-files)
+ ("\C-c\C-k" . log-edit-kill-buffer)
+ ("\C-a" . log-edit-beginning-of-line)
("\M-n" . log-edit-next-comment)
("\M-p" . log-edit-previous-comment)
("\M-r" . log-edit-comment-search-backward)
@@ -116,6 +119,13 @@ If SETUP is 'force, this variable has no effect."
:group 'log-edit
:type 'boolean)
+(defcustom log-edit-setup-add-author nil
+ "Non-nil means `log-edit' should add the `Author:' header when
+its SETUP argument is non-nil."
+ :group 'log-edit
+ :type 'boolean
+ :safe 'booleanp)
+
(defcustom log-edit-hook '(log-edit-insert-cvs-template
log-edit-show-files
log-edit-insert-changelog)
@@ -427,13 +437,15 @@ done. Otherwise, it uses the current buffer."
(if buffer (pop-to-buffer buffer))
(when (and log-edit-setup-invert (not (eq setup 'force)))
(setq setup (not setup)))
- (when setup
- (erase-buffer)
- (insert "Summary: \nAuthor: ")
- (save-excursion (insert "\n\n")))
(if mode
(funcall mode)
(log-edit-mode))
+ (when setup
+ (erase-buffer)
+ (insert "Summary: ")
+ (when log-edit-setup-add-author
+ (insert "\nAuthor: "))
+ (insert "\n\n"))
(set (make-local-variable 'log-edit-callback) callback)
(if (listp params)
(dolist (crt params)
@@ -445,7 +457,10 @@ done. Otherwise, it uses the current buffer."
(if buffer (set (make-local-variable 'log-edit-parent-buffer) parent))
(set (make-local-variable 'log-edit-initial-files) (log-edit-files))
(when setup (run-hooks 'log-edit-hook))
- (goto-char (point-min)) (push-mark (point-max))
+ (if setup
+ (message-position-point)
+ (goto-char (point-min)))
+ (push-mark (point-max))
(message "%s" (substitute-command-keys
"Press \\[log-edit-done] when you are done editing."))))
@@ -461,13 +476,24 @@ commands (under C-x v for VC, for example).
(set (make-local-variable 'font-lock-defaults)
'(log-edit-font-lock-keywords t))
(make-local-variable 'log-edit-comment-ring-index)
+ (add-hook 'kill-buffer-hook 'log-edit-remember-comment nil t)
(hack-dir-local-variables-non-file-buffer))
(defun log-edit-hide-buf (&optional buf where)
(when (setq buf (get-buffer (or buf log-edit-files-buf)))
- (let ((win (get-buffer-window buf where)))
- (if win (ignore-errors (delete-window win))))
- (bury-buffer buf)))
+ ;; FIXME: Should use something like `quit-windows-on' here, but
+ ;; that function never deletes this buffer's window because it
+ ;; was created using `cvs-pop-to-buffer-same-frame'.
+ (save-selected-window
+ (let ((win (get-buffer-window buf where)))
+ (if win (ignore-errors (delete-window win))))
+ (bury-buffer buf))))
+
+(defun log-edit-remember-comment (&optional comment)
+ (unless comment (setq comment (buffer-string)))
+ (when (or (ring-empty-p log-edit-comment-ring)
+ (not (equal comment (ring-ref log-edit-comment-ring 0))))
+ (ring-insert log-edit-comment-ring comment)))
(defun log-edit-done ()
"Finish editing the log message and commit the files.
@@ -500,10 +526,7 @@ If you want to abort the commit, simply delete the buffer."
(save-excursion
(goto-char (point-max))
(insert ?\n)))
- (let ((comment (buffer-string)))
- (when (or (ring-empty-p log-edit-comment-ring)
- (not (equal comment (ring-ref log-edit-comment-ring 0))))
- (ring-insert log-edit-comment-ring comment)))
+ (log-edit-remember-comment)
(let ((win (get-buffer-window log-edit-files-buf)))
(if (and log-edit-confirm
(not (and (eq log-edit-confirm 'changed)
@@ -519,6 +542,16 @@ If you want to abort the commit, simply delete the buffer."
(cvs-bury-buffer (current-buffer) log-edit-parent-buffer))
(call-interactively log-edit-callback))))
+(defun log-edit-kill-buffer ()
+ "Kill the current buffer.
+Also saves its contents in the comment history and hides
+`log-edit-files-buf'."
+ (interactive)
+ (log-edit-hide-buf)
+ (let ((buf (current-buffer)))
+ (quit-windows-on buf)
+ (kill-buffer buf)))
+
(defun log-edit-files ()
"Return the list of files that are about to be committed."
(ignore-errors (funcall log-edit-listfun)))
@@ -572,8 +605,18 @@ If you want to abort the commit, simply delete the buffer."
(save-selected-window
(cvs-pop-to-buffer-same-frame buf)
(shrink-window-if-larger-than-buffer)
+ (set-window-dedicated-p (selected-window) t)
(selected-window)))))
+(defun log-edit-beginning-of-line (&optional n)
+ "Move point to beginning of header value or to beginning of line.
+
+It works the same as `message-beginning-of-line', but it uses a
+different header separator appropriate for `log-edit-mode'."
+ (interactive "p")
+ (let ((mail-header-separator ""))
+ (message-beginning-of-line n)))
+
(defun log-edit-empty-buffer-p ()
"Return non-nil if the buffer is \"empty\"."
(or (= (point-min) (point-max))
@@ -617,9 +660,7 @@ can thus take some time."
(defun log-edit-add-to-changelog ()
"Insert this log message into the appropriate ChangeLog file."
(interactive)
- ;; Yuck!
- (unless (string= (buffer-string) (ring-ref log-edit-comment-ring 0))
- (ring-insert log-edit-comment-ring (buffer-string)))
+ (log-edit-remember-comment)
(dolist (f (log-edit-files))
(let ((buffer-file-name (expand-file-name f)))
(save-excursion
@@ -904,10 +945,14 @@ Rename relative filenames in the ChangeLog entry as FILES."
(defun log-edit-toggle-header (header value)
"Toggle a boolean-type header in the current buffer.
-If the value of HEADER is VALUE, clear it. Otherwise, add the
-header if it's not present and set it to VALUE. Then make sure
-there is an empty line after the headers. Return t if toggled
-on, otherwise nil."
+See `log-edit-set-header' for details."
+ (log-edit-set-header header value t))
+
+(defun log-edit-set-header (header value &optional toggle)
+ "Set the value of HEADER to VALUE in the current buffer.
+If TOGGLE is non-nil, and the value of HEADER already is VALUE,
+clear it. Make sure there is an empty line after the headers.
+Return t if toggled on (or TOGGLE is nil), otherwise nil."
(let ((val t)
(line (concat header ": " value "\n")))
(save-excursion
@@ -918,7 +963,7 @@ on, otherwise nil."
(if (re-search-forward (concat "^" header ":"
log-edit-header-contents-regexp)
nil t)
- (if (setq val (not (string= (match-string 1) value)))
+ (if (setq val (not (and toggle (string= (match-string 1) value))))
(replace-match line t t)
(replace-match "" t t nil 1))
(insert line)))
@@ -966,7 +1011,7 @@ line of MSG."
(goto-char (point-min))
(when (looking-at "\\([ \t]*\n\\)+")
(delete-region (match-beginning 0) (match-end 0)))
- (if summary (insert summary "\n"))
+ (if summary (insert summary "\n\n"))
(cons (buffer-string) res))))
(provide 'log-edit)
diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el
index 87336b6a357..25e9f82345d 100644
--- a/lisp/vc/smerge-mode.el
+++ b/lisp/vc/smerge-mode.el
@@ -243,8 +243,8 @@ Used in `smerge-diff-base-mine' and related functions."
"Font lock patterns for `smerge-mode'.")
(defconst smerge-begin-re "^<<<<<<< \\(.*\\)\n")
-(defconst smerge-end-re "^>>>>>>> .*\n")
-(defconst smerge-base-re "^||||||| .*\n")
+(defconst smerge-end-re "^>>>>>>> \\(.*\\)\n")
+(defconst smerge-base-re "^||||||| \\(.*\\)\n")
(defconst smerge-other-re "^=======\n")
(defvar smerge-conflict-style nil
@@ -1182,6 +1182,14 @@ repeating the command will highlight other two parts."
(defvar ediff-quit-hook)
(declare-function ediff-cleanup-mess "ediff-util" nil)
+(defun smerge--get-marker (regexp default)
+ (save-excursion
+ (goto-char (point-min))
+ (if (and (search-forward-regexp regexp nil t)
+ (> (match-end 1) (match-beginning 1)))
+ (concat default "=" (match-string-no-properties 1))
+ default)))
+
;;;###autoload
(defun smerge-ediff (&optional name-mine name-other name-base)
"Invoke ediff to resolve the conflicts.
@@ -1192,11 +1200,17 @@ buffer names."
(mode major-mode)
;;(ediff-default-variant 'default-B)
(config (current-window-configuration))
- (filename (file-name-nondirectory buffer-file-name))
+ (filename (file-name-nondirectory (or buffer-file-name "-")))
(mine (generate-new-buffer
- (or name-mine (concat "*" filename " MINE*"))))
+ (or name-mine
+ (concat "*" filename " "
+ (smerge--get-marker smerge-begin-re "MINE")
+ "*"))))
(other (generate-new-buffer
- (or name-other (concat "*" filename " OTHER*"))))
+ (or name-other
+ (concat "*" filename " "
+ (smerge--get-marker smerge-end-re "OTHER")
+ "*"))))
base)
(with-current-buffer mine
(buffer-disable-undo)
@@ -1221,7 +1235,10 @@ buffer names."
(when base
(setq base (generate-new-buffer
- (or name-base (concat "*" filename " BASE*"))))
+ (or name-base
+ (concat "*" filename " "
+ (smerge--get-marker smerge-base-re "BASE")
+ "*"))))
(with-current-buffer base
(buffer-disable-undo)
(insert-buffer-substring buf)
diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index 62fb72d0fbc..a71d80da61a 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -596,7 +596,7 @@ NOT-URGENT means it is ok to continue if the user says not to save."
(setq default-directory
(buffer-local-value 'default-directory vc-parent-buffer))
(log-edit 'vc-finish-logentry
- nil
+ t
`((log-edit-listfun . (lambda ()
;; FIXME: Should expand the list
;; for directories.
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 1d67deeeba3..a14287f8cbd 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -559,6 +559,11 @@ or an empty string if none."
(propertize remote-url
'face 'font-lock-variable-name-face)))
"\n"
+ ;; For now just a heading, key bindings can be added later for various bisect actions
+ (when (file-exists-p (expand-file-name ".git/BISECT_START" (vc-git-root _dir)))
+ (propertize "Bisect : in progress\n" 'face 'font-lock-warning-face))
+ (when (file-exists-p (expand-file-name ".git/rebase-apply" (vc-git-root _dir)))
+ (propertize "Rebase : in progress\n" 'face 'font-lock-warning-face))
(if stash
(concat
(propertize "Stash :\n" 'face 'font-lock-type-face
@@ -636,7 +641,17 @@ If toggling on, also insert its message into the buffer."
(insert (with-output-to-string
(vc-git-command
standard-output 1 nil
- "log" "--max-count=1" "--pretty=format:%B" "HEAD")))))
+ "log" "--max-count=1" "--pretty=format:%B" "HEAD")))
+ (save-excursion
+ (rfc822-goto-eoh)
+ (forward-line 1)
+ (let ((pt (point)))
+ (and (zerop (forward-line 1))
+ (looking-at "\n\\|\\'")
+ (let ((summary (buffer-substring-no-properties pt (1- (point)))))
+ (skip-chars-forward " \n")
+ (delete-region pt (point))
+ (log-edit-set-header "Summary" summary)))))))
(defvar vc-git-log-edit-mode-map
(let ((map (make-sparse-keymap "Git-Log-Edit")))
@@ -926,7 +941,7 @@ or BRANCH^ (where \"^\" can be repeated)."
(defun vc-git-annotate-extract-revision-at-line ()
(save-excursion
- (move-beginning-of-line 1)
+ (beginning-of-line)
(when (looking-at "\\([0-9a-f^][0-9a-f]+\\) \\(\\([^(]+\\) \\)?")
(let ((revision (match-string-no-properties 1)))
(if (match-beginning 2)
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index bf69a1ccecc..0ef13bfc61d 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1641,6 +1641,13 @@ Return t if the buffer had changes, nil otherwise."
;; be to call the back end separately for each file.
(coding-system-for-read
(if files (vc-coding-system-for-diff (car files)) 'undecided)))
+ ;; On MS-Windows and MS-DOS, Diff is likely to produce DOS-style
+ ;; EOLs, which will look ugly if (car files) happens to have Unix
+ ;; EOLs.
+ (if (memq system-type '(windows-nt ms-dos))
+ (setq coding-system-for-read
+ (coding-system-change-eol-conversion coding-system-for-read
+ 'dos)))
(vc-setup-buffer buffer)
(message "%s" (car messages))
;; Many backends don't handle well the case of a file that has been
diff --git a/lisp/windmove.el b/lisp/windmove.el
index 01ae1804d01..638240347c1 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -438,24 +438,28 @@ Return value is a frame-based (HPOS . VPOS) value that should be moved
to. DIR is one of `left', `up', `right', or `down'; an optional ARG
is handled as by `windmove-reference-loc'; WINDOW is the window that
movement is relative to."
- (let ((edges (window-edges window)) ; edges: (x0, y0, x1, y1)
+ (let ((edges (window-pixel-edges window)) ; edges: (x0, y0, x1, y1)
(refpoint (windmove-reference-loc arg window))) ; (x . y)
(cond
((eq dir 'left)
- (cons (- (nth 0 edges)
+ (cons (- (ceiling (nth 0 edges)
+ (frame-char-width (window-frame window)))
windmove-window-distance-delta)
(cdr refpoint))) ; (x0-d, y)
((eq dir 'up)
(cons (car refpoint)
- (- (nth 1 edges)
+ (- (ceiling (nth 1 edges)
+ (frame-char-height (window-frame window)))
windmove-window-distance-delta))) ; (x, y0-d)
((eq dir 'right)
- (cons (+ (1- (nth 2 edges)) ; -1 to get actual max x
+ (cons (+ (1- (ceiling (nth 2 edges)
+ (frame-char-width (window-frame window)))) ; -1 to get actual max x
windmove-window-distance-delta)
(cdr refpoint))) ; (x1+d-1, y)
((eq dir 'down) ; -1 to get actual max y
(cons (car refpoint)
- (+ (1- (nth 3 edges))
+ (+ (1- (ceiling (nth 3 edges)
+ (frame-char-height (window-frame window))))
windmove-window-distance-delta))) ; (x, y1+d-1)
(t (error "Invalid direction of movement: %s" dir)))))
diff --git a/lisp/window.el b/lisp/window.el
index 07741c74a84..24fe6a27895 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -278,6 +278,28 @@ Otherwise, signal an error."
(t
(error "%s is not a valid window" window))))
+;; Maybe this should go to frame.el.
+(defun frame-char-size (&optional window-or-frame horizontal)
+ "Return the value of `frame-char-height' for WINDOW-OR-FRAME.
+If WINDOW-OR-FRAME is a live frame, return the value of
+`frame-char-height' for that frame. If WINDOW-OR-FRAME is a
+valid window, return the value of `frame-char-height' for that
+window's frame. In any other case, return the value of
+`frame-char-height' for the selected frame.
+
+Optional argument HORIZONTAL non-nil means to return the value of
+`frame-char-width' for WINDOW-OR-FRAME."
+ (let ((frame
+ (cond
+ ((window-valid-p window-or-frame)
+ (window-frame window-or-frame))
+ ((frame-live-p window-or-frame)
+ window-or-frame)
+ (t (selected-frame)))))
+ (if horizontal
+ (frame-char-width frame)
+ (frame-char-height frame))))
+
(defvar ignore-window-parameters nil
"If non-nil, standard functions ignore window parameters.
The functions currently affected by this are `split-window',
@@ -286,10 +308,16 @@ The functions currently affected by this are `split-window',
An application may bind this to a non-nil value around calls to
these functions to inhibit processing of window parameters.")
+;; This must go to C, finally (or get removed).
(defconst window-safe-min-height 1
- "The absolute minimum number of lines of a window.
+ "The absolute minimum number of lines of any window.
Anything less might crash Emacs.")
+(defun window-safe-min-pixel-height (&optional window)
+ "Return the absolute minimum pixel height of WINDOW."
+ (* window-safe-min-height
+ (frame-char-size (window-normalize-window window))))
+
(defcustom window-min-height 4
"The minimum number of lines of any window.
The value has to accommodate a mode- or header-line if present.
@@ -305,10 +333,21 @@ shorter, explicitly specify the SIZE argument of that function."
:version "24.1"
:group 'windows)
+(defun window-min-pixel-height (&optional window)
+ "Return the minimum pixel height of window WINDOW."
+ (* (max window-min-height window-safe-min-height)
+ (frame-char-size window)))
+
+;; This must go to C, finally (or get removed).
(defconst window-safe-min-width 2
"The absolute minimum number of columns of a window.
Anything less might crash Emacs.")
+(defun window-safe-min-pixel-width (&optional window)
+ "Return the absolute minimum pixel width of WINDOW."
+ (* window-safe-min-width
+ (frame-char-size (window-normalize-window window) t)))
+
(defcustom window-min-width 10
"The minimum number of columns of any window.
The value has to accommodate margins, fringes, or scrollbars if
@@ -325,15 +364,27 @@ narrower, explicitly specify the SIZE argument of that function."
:version "24.1"
:group 'windows)
+(defun window-min-pixel-width (&optional window)
+ "Return the minimum pixel width of window WINDOW."
+ (* (max window-min-width window-safe-min-width)
+ (frame-char-size window t)))
+
+(defun window-safe-min-pixel-size (&optional window horizontal)
+ "Return the absolute minimum pixel height of WINDOW.
+Optional argument HORIZONTAL non-nil means return the absolute
+minimum pixel width of WINDOW."
+ (if horizontal
+ (window-safe-min-pixel-width window)
+ (window-safe-min-pixel-height window)))
+
(defun window-combined-p (&optional window horizontal)
"Return non-nil if WINDOW has siblings in a given direction.
WINDOW must be a valid window and defaults to the selected one.
-HORIZONTAL determines a direction for the window combination.
-If HORIZONTAL is omitted or nil, return non-nil if WINDOW is part
-of a vertical window combination.
-If HORIZONTAL is non-nil, return non-nil if WINDOW is part of a
-horizontal window combination."
+HORIZONTAL determines a direction for the window combination. If
+HORIZONTAL is omitted or nil, return non-nil if WINDOW is part of
+a vertical window combination. If HORIZONTAL is non-nil, return
+non-nil if WINDOW is part of a horizontal window combination."
(setq window (window-normalize-window window))
(let ((parent (window-parent window)))
(and parent
@@ -341,6 +392,16 @@ horizontal window combination."
(window-left-child parent)
(window-top-child parent)))))
+(defun window-combination-p (&optional window horizontal)
+ "Return WINDOW's first child if WINDOW is a vertical combination.
+WINDOW can be any window and defaults to the selected one.
+Optional argument HORIZONTAL non-nil means return WINDOW's first
+child if WINDOW is a horizontal combination."
+ (setq window (window-normalize-window window))
+ (if horizontal
+ (window-left-child window)
+ (window-top-child window)))
+
(defun window-combinations (window &optional horizontal)
"Return largest number of windows vertically arranged within WINDOW.
WINDOW must be a valid window and defaults to the selected one.
@@ -731,8 +792,8 @@ SIDE. Return the new window, nil if its creation window failed."
(cons
(if left-or-right 'window-width 'window-height)
(/ (window-total-size (frame-root-window) left-or-right)
- ;; By default use a fourth of the size of the
- ;; frame's root window.
+ ;; By default use a fourth of the size of the frame's
+ ;; root window.
4))
alist)))
;; Install BUFFER in new window and return NEW.
@@ -951,6 +1012,35 @@ FRAME defaults to the selected frame."
(window--atom-check frame))
;;; Window sizes.
+(defun window-total-size (&optional window horizontal)
+ "Return the total height or width of WINDOW.
+WINDOW must be a valid window and defaults to the selected one.
+
+If HORIZONTAL is omitted or nil, return the total height of
+WINDOW, in lines, like `window-total-height'. Otherwise return
+the total width, in columns, like `window-total-width'."
+ (if horizontal
+ (window-total-width window)
+ (window-total-height window)))
+
+(defun window-size (&optional window horizontal pixelwise)
+ "Return the height or width of WINDOW.
+WINDOW must be a valid window and defaults to the selected one.
+
+If HORIZONTAL is omitted or nil, return the total height of
+WINDOW, in lines, like `window-total-height'. Otherwise return
+the total width, in columns, like `window-total-width'.
+
+Optional argument PIXELWISE means return the pixel size of WINDOW
+like `window-pixel-height' and `window-pixel-width'."
+ (if horizontal
+ (if pixelwise
+ (window-pixel-width window)
+ (window-total-width window))
+ (if pixelwise
+ (window-pixel-height window)
+ (window-total-height window))))
+
(defvar window-size-fixed nil
"Non-nil in a buffer means windows displaying the buffer are fixed-size.
If the value is `height', then only the window's height is fixed.
@@ -966,7 +1056,25 @@ window).")
"Return non-nil if IGNORE says to ignore size restrictions for WINDOW."
(if (window-valid-p ignore) (eq window ignore) ignore))
-(defun window-min-size (&optional window horizontal ignore)
+(defun window-safe-min-size (&optional window horizontal pixelwise)
+ "Return safe minimum size of WINDOW.
+WINDOW must be a valid window and defaults to the selected one.
+Optional argument HORIZONTAL non-nil means return the minimum
+number of columns of WINDOW; otherwise return the minimum number
+of WINDOW's lines.
+
+Optional argument PIXELWISE non-nil means return the minimum pixel-size
+of WINDOW."
+ (setq window (window-normalize-window window))
+ (if pixelwise
+ (if horizontal
+ (* window-safe-min-width
+ (frame-char-width (window-frame window)))
+ (* window-safe-min-height
+ (frame-char-height (window-frame window))))
+ (if horizontal window-safe-min-width window-safe-min-height)))
+
+(defun window-min-size (&optional window horizontal ignore pixelwise)
"Return the minimum size of WINDOW.
WINDOW must be a valid window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means return the minimum
@@ -979,11 +1087,14 @@ imposed by fixed size windows, `window-min-height' or
windows may get as small as `window-safe-min-height' lines and
`window-safe-min-width' columns. If IGNORE is a window, ignore
restrictions for that window only. Any other non-nil value
-means ignore all of the above restrictions for all windows."
+means ignore all of the above restrictions for all windows.
+
+Optional argument PIXELWISE non-nil means return the minimum pixel-size
+of WINDOW."
(window--min-size-1
- (window-normalize-window window) horizontal ignore))
+ (window-normalize-window window) horizontal ignore pixelwise))
-(defun window--min-size-1 (window horizontal ignore)
+(defun window--min-size-1 (window horizontal ignore pixelwise)
"Internal function of `window-min-size'."
(let ((sub (window-child window)))
(if sub
@@ -994,13 +1105,15 @@ means ignore all of the above restrictions for all windows."
;; the minimum sizes of its child windows.
(while sub
(setq value (+ value
- (window--min-size-1 sub horizontal ignore)))
+ (window--min-size-1
+ sub horizontal ignore pixelwise)))
(setq sub (window-right sub)))
;; The minimum size of an ortho-combination is the maximum
;; of the minimum sizes of its child windows.
(while sub
(setq value (max value
- (window--min-size-1 sub horizontal ignore)))
+ (window--min-size-1
+ sub horizontal ignore pixelwise)))
(setq sub (window-right sub))))
value)
(with-current-buffer (window-buffer window)
@@ -1008,10 +1121,10 @@ means ignore all of the above restrictions for all windows."
((and (not (window--size-ignore-p window ignore))
(window-size-fixed-p window horizontal))
;; The minimum size of a fixed size window is its size.
- (window-total-size window horizontal))
+ (window-size window horizontal pixelwise))
((or (eq ignore 'safe) (eq ignore window))
;; If IGNORE equals `safe' or WINDOW return the safe values.
- (if horizontal window-safe-min-width window-safe-min-height))
+ (window-safe-min-size window horizontal pixelwise))
(horizontal
;; For the minimum width of a window take fringes and
;; scroll-bars into account. This is questionable and should
@@ -1022,34 +1135,54 @@ means ignore all of the above restrictions for all windows."
(let ((frame (window-frame window))
(fringes (window-fringes window))
(scroll-bars (window-scroll-bars window)))
- (max
- (+ window-safe-min-width
- (ceiling (car fringes) (frame-char-width frame))
- (ceiling (cadr fringes) (frame-char-width frame))
- (cond
- ((memq (nth 2 scroll-bars) '(left right))
- (nth 1 scroll-bars))
+ (if pixelwise
+ (max
+ (+ (window-safe-min-size window t t)
+ (car fringes) (cadr fringes)
+ (cond
+ ((memq (nth 2 scroll-bars) '(left right))
+ (nth 1 scroll-bars))
+ ((memq (frame-parameter frame 'vertical-scroll-bars)
+ '(left right))
+ (frame-parameter frame 'scroll-bar-width))
+ (t 0)))
+ (if (window--size-ignore-p window ignore)
+ 0
+ (window-min-pixel-width)))
+ (max
+ (+ window-safe-min-width
+ (ceiling (car fringes) (frame-char-width frame))
+ (ceiling (cadr fringes) (frame-char-width frame))
+ (cond
+ ((memq (nth 2 scroll-bars) '(left right))
+ (nth 1 scroll-bars))
((memq (frame-parameter frame 'vertical-scroll-bars)
'(left right))
(ceiling (or (frame-parameter frame 'scroll-bar-width) 14)
(frame-char-width)))
(t 0)))
- (if (and (not (window--size-ignore-p window ignore))
- (numberp window-min-width))
- window-min-width
- 0))))
+ (if (window--size-ignore-p window ignore)
+ 0
+ window-min-width)))))
+ (pixelwise
+ (max
+ (+ (window-safe-min-size window nil t)
+ (window-header-line-height window)
+ (window-mode-line-height window))
+ (if (window--size-ignore-p window ignore)
+ 0
+ (window-min-pixel-height))))
(t
;; For the minimum height of a window take any mode- or
;; header-line into account.
(max (+ window-safe-min-height
(if header-line-format 1 0)
(if mode-line-format 1 0))
- (if (and (not (window--size-ignore-p window ignore))
- (numberp window-min-height))
- window-min-height
- 0))))))))
+ (if (window--size-ignore-p window ignore)
+ 0
+ window-min-height))))))))
-(defun window-sizable (window delta &optional horizontal ignore)
+(defun window-sizable (window delta &optional horizontal ignore pixelwise)
"Return DELTA if DELTA lines can be added to WINDOW.
WINDOW must be a valid window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means return DELTA if DELTA
@@ -1076,12 +1209,15 @@ imposed by fixed size windows, `window-min-height' or
windows may get as small as `window-safe-min-height' lines and
`window-safe-min-width' columns. If IGNORE is a window, ignore
restrictions for that window only. Any other non-nil value means
-ignore all of the above restrictions for all windows."
+ignore all of the above restrictions for all windows.
+
+Optional argument PIXELWISE non-nil means interpret DELTA as
+pixels."
(setq window (window-normalize-window window))
(cond
((< delta 0)
- (max (- (window-min-size window horizontal ignore)
- (window-total-size window horizontal))
+ (max (- (window-min-size window horizontal ignore pixelwise)
+ (window-size window horizontal pixelwise))
delta))
((window--size-ignore-p window ignore)
delta)
@@ -1091,15 +1227,17 @@ ignore all of the above restrictions for all windows."
delta))
(t 0)))
-(defun window-sizable-p (window delta &optional horizontal ignore)
+(defun window-sizable-p (window delta &optional horizontal ignore pixelwise)
"Return t if WINDOW can be resized by DELTA lines.
WINDOW must be a valid window and defaults to the selected one.
For the meaning of the arguments of this function see the
doc-string of `window-sizable'."
(setq window (window-normalize-window window))
(if (> delta 0)
- (>= (window-sizable window delta horizontal ignore) delta)
- (<= (window-sizable window delta horizontal ignore) delta)))
+ (>= (window-sizable window delta horizontal ignore pixelwise)
+ delta)
+ (<= (window-sizable window delta horizontal ignore pixelwise)
+ delta)))
(defun window--size-fixed-1 (window horizontal)
"Internal function for `window-size-fixed-p'."
@@ -1146,7 +1284,7 @@ WINDOW can be resized in the desired direction. The function
(window--size-fixed-1
(window-normalize-window window) horizontal))
-(defun window--min-delta-1 (window delta &optional horizontal ignore trail noup)
+(defun window--min-delta-1 (window delta &optional horizontal ignore trail noup pixelwise)
"Internal function for `window-min-delta'."
(if (not (window-parent window))
;; If we can't go up, return zero.
@@ -1177,14 +1315,16 @@ WINDOW can be resized in the desired direction. The function
(unless (eq sub window)
(setq delta
(min delta
- (- (window-total-size sub horizontal)
- (window-min-size sub horizontal ignore)))))
+ (- (window-size sub horizontal pixelwise)
+ (window-min-size
+ sub horizontal ignore pixelwise)))))
(setq sub (window-right sub))))
(if noup
delta
- (window--min-delta-1 parent delta horizontal ignore trail))))))
+ (window--min-delta-1
+ parent delta horizontal ignore trail nil pixelwise))))))
-(defun window-min-delta (&optional window horizontal ignore trail noup nodown)
+(defun window-min-delta (&optional window horizontal ignore trail noup nodown pixelwise)
"Return number of lines by which WINDOW can be shrunk.
WINDOW must be a valid window and defaults to the selected one.
Return zero if WINDOW cannot be shrunk.
@@ -1210,15 +1350,19 @@ tree, but try to enlarge windows within WINDOW's combination only.
Optional argument NODOWN non-nil means don't check whether WINDOW
itself (and its child windows) can be shrunk; check only whether
-at least one other window can be enlarged appropriately."
+at least one other window can be enlarged appropriately.
+
+Optional argument PIXELWISE non-nil means return number of pixels
+by which WINDOW can be shrunk."
(setq window (window-normalize-window window))
- (let ((size (window-total-size window horizontal))
- (minimum (window-min-size window horizontal ignore)))
+ (let ((size (window-size window horizontal pixelwise))
+ (minimum (window-min-size window horizontal ignore pixelwise)))
(cond
(nodown
;; If NODOWN is t, try to recover the entire size of WINDOW.
- (window--min-delta-1 window size horizontal ignore trail noup))
- ((= size minimum)
+ (window--min-delta-1
+ window size horizontal ignore trail noup pixelwise))
+ ((<= size minimum)
;; If NODOWN is nil and WINDOW's size is already at its minimum,
;; there's nothing to recover.
0)
@@ -1226,9 +1370,9 @@ at least one other window can be enlarged appropriately."
;; Otherwise, try to recover whatever WINDOW is larger than its
;; minimum size.
(window--min-delta-1
- window (- size minimum) horizontal ignore trail noup)))))
+ window (- size minimum) horizontal ignore trail noup pixelwise)))))
-(defun window--max-delta-1 (window delta &optional horizontal ignore trail noup)
+(defun window--max-delta-1 (window delta &optional horizontal ignore trail noup pixelwise)
"Internal function of `window-max-delta'."
(if (not (window-parent window))
;; Can't go up. Return DELTA.
@@ -1248,8 +1392,9 @@ at least one other window can be enlarged appropriately."
(t
(setq delta
(+ delta
- (- (window-total-size sub horizontal)
- (window-min-size sub horizontal ignore))))))
+ (- (window-size sub horizontal pixelwise)
+ (window-min-size
+ sub horizontal ignore pixelwise))))))
(setq sub (window-right sub))))
;; For an ortho-combination throw DELTA when at least one
;; child window is fixed-size.
@@ -1264,9 +1409,10 @@ at least one other window can be enlarged appropriately."
delta
;; Else try with parent of WINDOW, passing the DELTA we
;; recovered so far.
- (window--max-delta-1 parent delta horizontal ignore trail))))))
+ (window--max-delta-1
+ parent delta horizontal ignore trail nil pixelwise))))))
-(defun window-max-delta (&optional window horizontal ignore trail noup nodown)
+(defun window-max-delta (&optional window horizontal ignore trail noup nodown pixelwise)
"Return maximum number of lines by which WINDOW can be enlarged.
WINDOW must be a valid window and defaults to the selected one.
The return value is zero if WINDOW cannot be enlarged.
@@ -1293,7 +1439,10 @@ WINDOW's combination.
Optional argument NODOWN non-nil means do not check whether
WINDOW itself (and its child windows) can be enlarged; check
-only whether other windows can be shrunk appropriately."
+only whether other windows can be shrunk appropriately.
+
+Optional argument PIXELWISE non-nil means return number of
+pixels by which WINDOW can be enlarged."
(setq window (window-normalize-window window))
(if (and (not (window--size-ignore-p window ignore))
(not nodown) (window-size-fixed-p window horizontal))
@@ -1301,10 +1450,10 @@ only whether other windows can be shrunk appropriately."
;; size.
0
;; WINDOW has no fixed size.
- (window--max-delta-1 window 0 horizontal ignore trail noup)))
+ (window--max-delta-1 window 0 horizontal ignore trail noup pixelwise)))
;; Make NOUP also inhibit the min-size check.
-(defun window--resizable (window delta &optional horizontal ignore trail noup nodown)
+(defun window--resizable (window delta &optional horizontal ignore trail noup nodown pixelwise)
"Return DELTA if WINDOW can be resized vertically by DELTA lines.
WINDOW must be a valid window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means return DELTA if WINDOW
@@ -1340,30 +1489,40 @@ to) WINDOW's siblings.
Optional argument NODOWN non-nil means don't go down in the
window tree. This means do not check whether resizing would
-violate size restrictions of WINDOW or its child windows."
+violate size restrictions of WINDOW or its child windows.
+
+Optional argument PIXELWISE non-nil means interpret DELTA as
+number of pixels."
(setq window (window-normalize-window window))
(cond
((< delta 0)
- (max (- (window-min-delta window horizontal ignore trail noup nodown))
+ (max (- (window-min-delta
+ window horizontal ignore trail noup nodown pixelwise))
delta))
((> delta 0)
- (min (window-max-delta window horizontal ignore trail noup nodown)
+ (min (window-max-delta
+ window horizontal ignore trail noup nodown pixelwise)
delta))
(t 0)))
-(defun window-resizable-p (window delta &optional horizontal ignore trail noup nodown)
+(defun window--resizable-p (window delta &optional horizontal ignore trail noup nodown pixelwise)
"Return t if WINDOW can be resized vertically by DELTA lines.
WINDOW must be a valid window and defaults to the selected one.
For the meaning of the arguments of this function see the
-doc-string of `window--resizable'."
+doc-string of `window--resizable'.
+
+Optional argument PIXELWISE non-nil means interpret DELTA as
+pixels."
(setq window (window-normalize-window window))
(if (> delta 0)
- (>= (window--resizable window delta horizontal ignore trail noup nodown)
+ (>= (window--resizable
+ window delta horizontal ignore trail noup nodown pixelwise)
delta)
- (<= (window--resizable window delta horizontal ignore trail noup nodown)
+ (<= (window--resizable
+ window delta horizontal ignore trail noup nodown pixelwise)
delta)))
-(defun window-resizable (window delta &optional horizontal ignore)
+(defun window-resizable (window delta &optional horizontal ignore pixelwise)
"Return DELTA if WINDOW can be resized vertically by DELTA lines.
WINDOW must be a valid window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means return DELTA if WINDOW
@@ -1386,23 +1545,32 @@ imposed by fixed size windows, `window-min-height' or
restrictions for that window only. If IGNORE equals `safe',
live windows may get as small as `window-safe-min-height' lines
and `window-safe-min-width' columns. Any other non-nil value
-means ignore all of the above restrictions for all windows."
+means ignore all of the above restrictions for all windows.
+
+Optional argument PIXELWISE non-nil means interpret DELTA as
+pixels."
(setq window (window-normalize-window window))
- (window--resizable window delta horizontal ignore))
+ (window--resizable window delta horizontal ignore nil nil nil pixelwise))
-(defun window-total-size (&optional window horizontal)
- "Return the total height or width of WINDOW.
+(defun window-resizable-p (window delta &optional horizontal ignore pixelwise)
+ "Return t if WINDOW can be resized vertically by DELTA lines.
WINDOW must be a valid window and defaults to the selected one.
+For the meaning of the arguments of this function see the
+doc-string of `window-resizable'."
+ (setq window (window-normalize-window window))
+ (if (> delta 0)
+ (>= (window--resizable
+ window delta horizontal ignore nil nil nil pixelwise)
+ delta)
+ (<= (window--resizable
+ window delta horizontal ignore nil nil nil pixelwise)
+ delta)))
-If HORIZONTAL is omitted or nil, return the total height of
-WINDOW, in lines, like `window-total-height'. Otherwise return
-the total width, in columns, like `window-total-width'."
- (if horizontal
- (window-total-width window)
- (window-total-height window)))
-
-;; Eventually we should make `window-height' obsolete.
+;; Aliases of functions defined in window.c.
(defalias 'window-height 'window-total-height)
+(defalias 'window-width 'window-body-width)
+
+;; Eventually the following two should work pixelwise.
;; See discussion in bug#4543.
(defun window-full-height-p (&optional window)
@@ -1412,8 +1580,8 @@ WINDOW equals the total height of the root window of WINDOW's
frame. WINDOW must be a valid window and defaults to the
selected one."
(setq window (window-normalize-window window))
- (= (window-total-size window)
- (window-total-size (frame-root-window window))))
+ (= (window-pixel-height window)
+ (window-pixel-height (frame-root-window window))))
(defun window-full-width-p (&optional window)
"Return t if WINDOW is as wide as its containing frame.
@@ -1421,8 +1589,8 @@ More precisely, return t if and only if the total width of WINDOW
equals the total width of the root window of WINDOW's frame.
WINDOW must be a valid window and defaults to the selected one."
(setq window (window-normalize-window window))
- (= (window-total-size window t)
- (window-total-size (frame-root-window window) t)))
+ (= (window-pixel-width window)
+ (window-pixel-width (frame-root-window window))))
(defun window-body-size (&optional window horizontal)
"Return the height or width of WINDOW's text area.
@@ -1435,9 +1603,6 @@ the text area, like `window-body-width'."
(window-body-width window)
(window-body-height window)))
-;; Eventually we should make `window-height' obsolete.
-(defalias 'window-width 'window-body-width)
-
(defun window-current-scroll-bars (&optional window)
"Return the current scroll bar settings for WINDOW.
WINDOW must be a live window and defaults to the selected one.
@@ -1520,8 +1685,8 @@ SIDE can be any of the symbols `left', `top', `right' or
((eq side 'top) 1)
((eq side 'right) 2)
((memq side '(bottom nil)) 3))))
- (= (nth edge (window-edges window))
- (nth edge (window-edges (frame-root-window window))))))
+ (= (nth edge (window-pixel-edges window))
+ (nth edge (window-pixel-edges (frame-root-window window))))))
(defun window-at-side-list (&optional frame side)
"Return list of all windows on SIDE of FRAME.
@@ -1540,14 +1705,14 @@ SIDE can be any of the symbols `left', `top', `right' or
(defun window--in-direction-2 (window posn &optional horizontal)
"Support function for `window-in-direction'."
(if horizontal
- (let ((top (window-top-line window)))
+ (let ((top (window-pixel-top window)))
(if (> top posn)
(- top posn)
- (- posn top (window-total-height window))))
- (let ((left (window-left-column window)))
+ (- posn top (window-pixel-height window))))
+ (let ((left (window-pixel-left window)))
(if (> left posn)
(- left posn)
- (- posn left (window-total-width window))))))
+ (- posn left (window-pixel-width window))))))
;; Predecessors to the below have been devised by Julian Assange in
;; change-windows-intuitively.el and Hovav Shacham in windmove.el.
@@ -1574,29 +1739,27 @@ Return nil if no suitable window can be found."
(let* ((frame (window-frame window))
(hor (memq direction '(left right)))
(first (if hor
- (window-left-column window)
- (window-top-line window)))
- (last (+ first (if hor
- (window-total-width window)
- (window-total-height window))))
- (posn-cons (nth 6 (posn-at-point (window-point window) window)))
+ (window-pixel-left window)
+ (window-pixel-top window)))
+ (last (+ first (window-size window hor t)))
+ (posn-cons (nth 2 (posn-at-point (window-point window) window)))
;; The column / row value of `posn-at-point' can be nil for the
;; mini-window, guard against that.
(posn (if hor
- (+ (or (cdr posn-cons) 1) (window-top-line window))
- (+ (or (car posn-cons) 1) (window-left-column window))))
+ (+ (or (cdr posn-cons) 1) (window-pixel-top window))
+ (+ (or (car posn-cons) 1) (window-pixel-left window))))
(best-edge
(cond
- ((eq direction 'below) (frame-height frame))
- ((eq direction 'right) (frame-width frame))
+ ((eq direction 'below) (frame-pixel-height frame))
+ ((eq direction 'right) (frame-pixel-width frame))
(t -1)))
(best-edge-2 best-edge)
- (best-diff-2 (if hor (frame-height frame) (frame-width frame)))
+ (best-diff-2 (if hor (frame-pixel-height frame) (frame-pixel-width frame)))
best best-2 best-diff-2-new)
(walk-window-tree
(lambda (w)
- (let* ((w-top (window-top-line w))
- (w-left (window-left-column w)))
+ (let* ((w-top (window-pixel-top w))
+ (w-left (window-pixel-left w)))
(cond
((or (eq window w)
;; Ignore ourselves.
@@ -1606,7 +1769,7 @@ Return nil if no suitable window can be found."
(hor
(cond
((and (<= w-top posn)
- (< posn (+ w-top (window-total-height w))))
+ (< posn (+ w-top (window-pixel-height w))))
;; W is to the left or right of WINDOW and covers POSN.
(when (or (and (eq direction 'left)
(<= w-left first) (> w-left best-edge))
@@ -1615,7 +1778,7 @@ Return nil if no suitable window can be found."
(setq best-edge w-left)
(setq best w)))
((and (or (and (eq direction 'left)
- (<= (+ w-left (window-total-width w)) first))
+ (<= (+ w-left (window-pixel-width w)) first))
(and (eq direction 'right) (<= last w-left)))
;; W is to the left or right of WINDOW but does not
;; cover POSN.
@@ -1632,7 +1795,7 @@ Return nil if no suitable window can be found."
(t
(cond
((and (<= w-left posn)
- (< posn (+ w-left (window-total-width w))))
+ (< posn (+ w-left (window-pixel-width w))))
;; W is above or below WINDOW and covers POSN.
(when (or (and (eq direction 'above)
(<= w-top first) (> w-top best-edge))
@@ -1641,7 +1804,7 @@ Return nil if no suitable window can be found."
(setq best-edge w-top)
(setq best w)))
((and (or (and (eq direction 'above)
- (<= (+ w-top (window-total-height w)) first))
+ (<= (+ w-top (window-pixel-height w)) first))
(and (eq direction 'below) (<= last w-top)))
;; W is above or below WINDOW but does not cover POSN.
(setq best-diff-2-new
@@ -1798,8 +1961,8 @@ selected frame and no others."
(dolist (window (window-list-1 nil 'nomini all-frames))
(when (and (or dedicated (not (window-dedicated-p window)))
(or (not not-selected) (not (eq window (selected-window)))))
- (setq size (* (window-total-size window)
- (window-total-size window t)))
+ (setq size (* (window-pixel-height window)
+ (window-pixel-width window)))
(when (> size best-size)
(setq best-size size)
(setq best-window window))))
@@ -1854,11 +2017,106 @@ meaning of this argument."
(length (window-list-1 nil minibuf)))
;;; Resizing windows.
+(defun window--size-to-pixel (window size &optional horizontal pixelwise round-maybe)
+ "For WINDOW convert SIZE lines to pixels.
+SIZE is supposed to specify a height of WINDOW in terms of text
+lines. The return value is the number of pixels specifying that
+height.
+
+WINDOW must be a valid window. Optional argument HORIZONTAL
+non-nil means convert SIZE columns to pixels.
+
+Optional argument PIXELWISE non-nil means SIZE already specifies
+pixels but may have to be adjusted to a multiple of the character
+size of WINDOW's frame. Optional argument ROUND-MAYBE non-nil
+means round to the nearest multiple of the character size of
+WINDOW's frame if the option `window-resize-pixelwise' is nil."
+ (setq window (window-normalize-window window))
+ (let ((char-size (frame-char-size window horizontal)))
+ (if pixelwise
+ (if (and round-maybe (not window-resize-pixelwise))
+ (* (round size char-size) char-size)
+ size)
+ (* size char-size))))
+
+(defun window--pixel-to-size (window size &optional horizontal round-up)
+ "For WINDOW convert SIZE pixels to lines.
+WINDOW must be a valid window and defaults to the selected one.
+Optional argument HORIZONTAL non-nil means convert SIZE pixels to
+columns. Optional argument ROUND-UP means to round up the return
+value."
+ (let ((char-size (frame-char-size
+ (window-normalize-window window) horizontal)))
+ (if round-up
+ (/ (+ size char-size -1) char-size)
+ (/ size char-size))))
+
+(defun window--pixel-to-total-1 (window horizontal char-size)
+ "Subroutine of `window--pixel-to-total'."
+ (let ((child (window-child window)))
+ (if (window-combination-p window horizontal)
+ ;; In an iso-combination distribute sizes proportionally.
+ (let ((remainder (window-new-total window))
+ size best-child best-size)
+ ;; Initialize total sizes to each child's floor.
+ (while child
+ (setq size (window--pixel-to-size
+ child (window-size child horizontal t)
+ horizontal))
+ (set-window-new-total child size)
+ (setq remainder (- remainder size))
+ (setq child (window-next-sibling child)))
+ ;; Distribute remainder.
+ (while (> remainder 0)
+ (setq child (window-last-child window))
+ (setq best-child nil)
+ (setq best-size 0)
+ ;; We want those auxiliary fields in the window structure to
+ ;; avoid this.
+ (while child
+ (setq size (- (/ (window-size child horizontal t) char-size)
+ (window-new-total child)))
+ (when (> size best-size)
+ (setq best-child child)
+ (setq best-size size))
+ (setq child (window-prev-sibling child)))
+ ;; We MUST have a best-child here.
+ (set-window-new-total best-child 1 t)
+ (setq remainder (1- remainder)))
+ ;; Recurse.
+ (setq child (window-child window))
+ (while child
+ (window--pixel-to-total-1 child horizontal char-size)
+ (setq child (window-next-sibling child))))
+ ;; In an ortho-combination assign new sizes directly.
+ (let ((size (window-new-total window)))
+ (while child
+ (set-window-new-total child size)
+ (window--pixel-to-total-1 child horizontal char-size)
+ (setq child (window-next-sibling child)))))))
+
+(defun window--pixel-to-total (&optional frame horizontal)
+ "On FRAME assign new total window heights from pixel heights.
+FRAME must be a live frame and defaults to the selected frame.
+
+Optional argument HORIZONTAL non-nil means assign new total
+window widths from pixel widths."
+ (setq frame (window-normalize-frame frame))
+ (let ((root (frame-root-window))
+ (char-size (frame-char-size frame horizontal))
+ (mini (minibuffer-window frame)))
+ (set-window-new-total
+ root (window--pixel-to-size
+ root (window-size root horizontal t) horizontal))
+ (unless (window-buffer root)
+ (window--pixel-to-total-1 root horizontal char-size)))
+ (window-resize-apply-total frame horizontal))
+
(defun window--resize-reset (&optional frame horizontal)
"Reset resize values for all windows on FRAME.
FRAME defaults to the selected frame.
-This function stores the current value of `window-total-size' applied
+This function stores the current value of `window-size' applied
with argument HORIZONTAL in the new total size of all windows on
FRAME. It also resets the new normal size of each of these
windows."
@@ -1868,7 +2126,8 @@ windows."
(defun window--resize-reset-1 (window horizontal)
"Internal function of `window--resize-reset'."
;; Register old size in the new total size.
- (set-window-new-total window (window-total-size window horizontal))
+ (set-window-new-pixel window (window-size window horizontal t))
+ (set-window-new-total window (window-size window horizontal))
;; Reset new normal size.
(set-window-new-normal window)
(when (window-child window)
@@ -1879,35 +2138,51 @@ windows."
;; The following routine is used to manually resize the minibuffer
;; window and is currently used, for example, by ispell.el.
(defun window--resize-mini-window (window delta)
- "Resize minibuffer window WINDOW by DELTA lines.
-If WINDOW cannot be resized by DELTA lines make it as large (or
+ "Resize minibuffer window WINDOW by DELTA pixels.
+If WINDOW cannot be resized by DELTA pixels make it as large (or
as small) as possible, but don't signal an error."
(when (window-minibuffer-p window)
(let* ((frame (window-frame window))
(root (frame-root-window frame))
- (height (window-total-size window))
+ (height (window-pixel-height window))
(min-delta
- (- (window-total-size root)
- (window-min-size root))))
+ (- (window-pixel-height root)
+ (window-min-size root nil nil t))))
;; Sanitize DELTA.
(cond
((<= (+ height delta) 0)
- (setq delta (- (- height 1))))
+ (setq delta (- (frame-char-height (window-frame window)) height)))
((> delta min-delta)
(setq delta min-delta)))
- ;; Resize now.
- (window--resize-reset frame)
- ;; Ideally we should be able to resize just the last child of root
- ;; here. See the comment in `resize-root-window-vertically' for
- ;; why we do not do that.
- (window--resize-this-window root (- delta) nil nil t)
- (set-window-new-total window (+ height delta))
- ;; The following routine catches the case where we want to resize
- ;; a minibuffer-only frame.
- (resize-mini-window-internal window))))
-
-(defun window-resize (window delta &optional horizontal ignore)
+ (unless (zerop delta)
+ ;; Resize now.
+ (window--resize-reset frame)
+ ;; Ideally we should be able to resize just the last child of root
+ ;; here. See the comment in `resize-root-window-vertically' for
+ ;; why we do not do that.
+ (window--resize-this-window root (- delta) nil nil t)
+ (set-window-new-pixel window (+ height delta))
+ ;; The following routine catches the case where we want to resize
+ ;; a minibuffer-only frame.
+ (when (resize-mini-window-internal window)
+ (window--pixel-to-total frame)
+ (run-window-configuration-change-hook frame))))))
+
+(defun window--resize-apply-p (frame &optional horizontal)
+ "Return t when a window on FRAME shall be resized vertically.
+Optional argument HORIZONTAL non-nil means return t when a window
+shall be resized horizontally."
+(catch 'apply
+ (walk-window-tree
+ (lambda (window)
+ (unless (= (window-new-pixel window)
+ (window-size window horizontal t))
+ (throw 'apply t)))
+ frame t)
+ nil))
+
+(defun window-resize (window delta &optional horizontal ignore pixelwise)
"Resize WINDOW vertically by DELTA lines.
WINDOW can be an arbitrary window and defaults to the selected
one. An attempt to resize the root window of a frame will raise
@@ -1930,6 +2205,9 @@ live windows may get as small as `window-safe-min-height' lines
and `window-safe-min-width' columns. Any other non-nil value
means ignore all of the above restrictions for all windows.
+Optional argument PIXELWISE non-nil means resize WINDOW by DELTA
+pixels.
+
This function resizes other windows proportionally and never
deletes any windows. If you want to move only the low (right)
edge of WINDOW consider using `adjust-window-trailing-edge'
@@ -1938,6 +2216,8 @@ instead."
(let* ((frame (window-frame window))
(minibuffer-window (minibuffer-window frame))
sibling)
+ (setq delta (window--size-to-pixel
+ window delta horizontal pixelwise t))
(cond
((eq window (frame-root-window frame))
(error "Cannot resize the root window of a frame"))
@@ -1954,19 +2234,21 @@ instead."
;; nil or the minibuffer window is active, resize the minibuffer
;; window.
(window--resize-mini-window minibuffer-window (- delta)))
- ((window-resizable-p window delta horizontal ignore)
+ ((window--resizable-p
+ window delta horizontal ignore nil nil nil t)
(window--resize-reset frame horizontal)
(window--resize-this-window window delta horizontal ignore t)
(if (and (not window-combination-resize)
(window-combined-p window horizontal)
(setq sibling (or (window-right window) (window-left window)))
- (window-sizable-p sibling (- delta) horizontal ignore))
+ (window-sizable-p
+ sibling (- delta) horizontal ignore t))
;; If window-combination-resize is nil, WINDOW is part of an
;; iso-combination, and WINDOW's neighboring right or left
;; sibling can be resized as requested, resize that sibling.
(let ((normal-delta
(/ (float delta)
- (window-total-size (window-parent window) horizontal))))
+ (window-size (window-parent window) horizontal t))))
(window--resize-this-window sibling (- delta) horizontal nil t)
(set-window-new-normal
window (+ (window-normal-size window horizontal)
@@ -1976,17 +2258,24 @@ instead."
normal-delta)))
;; Otherwise, resize all other windows in the same combination.
(window--resize-siblings window delta horizontal ignore))
- (window-resize-apply frame horizontal))
+ (when (window--resize-apply-p frame horizontal)
+ (window-resize-apply frame horizontal)
+ (window--pixel-to-total frame horizontal)
+ (run-window-configuration-change-hook frame)))
(t
(error "Cannot resize window %s" window)))))
-(defun window-resize-no-error (window delta &optional horizontal ignore)
+(defun window-resize-no-error (window delta &optional horizontal ignore pixelwise)
"Resize WINDOW vertically if it is resizable by DELTA lines.
This function is like `window-resize' but does not signal an
error when WINDOW cannot be resized. For the meaning of the
-optional arguments see the documentation of `window-resize'."
- (when (window-resizable-p window delta horizontal ignore)
- (window-resize window delta horizontal ignore)))
+optional arguments see the documentation of `window-resize'.
+
+Optional argument PIXELWISE non-nil means interpret DELTA as
+pixels."
+ (when (window--resizable-p
+ window delta horizontal ignore nil nil nil pixelwise)
+ (window-resize window delta horizontal ignore pixelwise)))
(defun window--resize-child-windows-skip-p (window)
"Return non-nil if WINDOW shall be skipped by resizing routines."
@@ -2004,7 +2293,8 @@ OTHER-DELTA, a number, specifies that this many lines (columns)
have been obtained from (or returned to) an ancestor window of
PARENT in order to resize WINDOW."
(let* ((delta-normal
- (if (and (= (- this-delta) (window-total-size window horizontal))
+ (if (and (= (- this-delta)
+ (window-size window horizontal t))
(zerop other-delta))
;; When WINDOW gets deleted and we can return its entire
;; space to its siblings, use WINDOW's normal size as the
@@ -2012,7 +2302,8 @@ PARENT in order to resize WINDOW."
(- (window-normal-size window horizontal))
;; In any other case calculate the normal delta from the
;; relation of THIS-DELTA to the total size of PARENT.
- (/ (float this-delta) (window-total-size parent horizontal))))
+ (/ (float this-delta)
+ (window-size parent horizontal t))))
(sub (window-child parent))
(parent-normal 0.0)
(skip (eq trail 'after)))
@@ -2054,8 +2345,8 @@ PARENT in order to resize WINDOW."
(when (numberp other-delta)
;; Set the new normal size of windows from what they should have
;; contributed for recovering OTHER-DELTA lines (columns).
- (setq delta-normal (/ (float (window-total-size parent horizontal))
- (+ (window-total-size parent horizontal)
+ (setq delta-normal (/ (float (window-size parent horizontal t))
+ (+ (window-size parent horizontal t)
other-delta)))
(setq sub (window-child parent))
(setq skip (eq trail 'after))
@@ -2089,16 +2380,16 @@ PARENT in order to resize WINDOW."
;; Don't get larger than 1 or smaller than 0.
(min 1.0 (max (- 1.0 sum) 0.0))))))
-(defun window--resize-child-windows (parent delta &optional horizontal window ignore trail edge)
- "Resize child windows of window PARENT vertically by DELTA lines.
+(defun window--resize-child-windows (parent delta &optional horizontal window ignore trail edge char-size)
+ "Resize child windows of window PARENT vertically by DELTA pixels.
PARENT must be a vertically combined internal window.
-Optional argument HORIZONTAL non-nil means resize child windows of
-PARENT horizontally by DELTA columns. In this case PARENT must
+Optional argument HORIZONTAL non-nil means resize child windows
+of PARENT horizontally by DELTA pixels. In this case PARENT must
be a horizontally combined internal window.
WINDOW, if specified, must denote a child window of PARENT that
-is resized by DELTA lines.
+is resized by DELTA pixels.
Optional argument IGNORE non-nil means ignore restrictions
imposed by fixed size windows, `window-min-height' or
@@ -2114,12 +2405,21 @@ resize only windows on the left or above EDGE. If TRAIL equals
`after', resize only windows on the right or below EDGE. Also,
preferably only resize windows adjacent to EDGE.
+If the optional argument CHAR-SIZE is a positive integer, it specifies
+the number of pixels by which windows are incrementally resized.
+If CHAR-SIZE is nil, this means to use the value of
+`frame-char-height' or `frame-char-width' of WINDOW's frame.
+
Return the symbol `normalized' if new normal sizes have been
already set by this routine."
(let* ((first (window-child parent))
(last (window-last-child parent))
- (parent-total (+ (window-total-size parent horizontal) delta))
- sub best-window best-value)
+ (parent-total (+ (window-size parent horizontal t)
+ delta))
+ (char-size (or char-size
+ (and window-resize-pixelwise 1)
+ (frame-char-size window horizontal)))
+ sub best-window best-value best-delta)
(if (and edge (memq trail '(before after))
(progn
@@ -2134,16 +2434,14 @@ already set by this routine."
sub)
(if horizontal
(if (eq trail 'before)
- (= (+ (window-left-column sub)
- (window-total-size sub t))
+ (= (+ (window-pixel-left sub) (window-pixel-width sub))
edge)
- (= (window-left-column sub) edge))
+ (= (window-pixel-left sub) edge))
(if (eq trail 'before)
- (= (+ (window-top-line sub)
- (window-total-size sub))
+ (= (+ (window-pixel-top sub) (window-pixel-height sub))
edge)
- (= (window-top-line sub) edge)))
- (window-sizable-p sub delta horizontal ignore))
+ (= (window-pixel-top sub) edge)))
+ (window-sizable-p sub delta horizontal ignore t))
;; Resize only windows adjacent to EDGE.
(progn
(window--resize-this-window
@@ -2152,7 +2450,7 @@ already set by this routine."
(progn
;; Assign new normal sizes.
(set-window-new-normal
- sub (/ (float (window-new-total sub)) parent-total))
+ sub (/ (float (window-new-pixel sub)) parent-total))
(set-window-new-normal
window (- (window-normal-size window horizontal)
(- (window-new-normal sub)
@@ -2180,15 +2478,15 @@ already set by this routine."
sub
(cons
;; We used to call this with NODOWN t, "fixed" 2011-05-11.
- (window-min-delta sub horizontal ignore trail t) ; t)
- (- (/ (float (window-total-size sub horizontal))
+ (window-min-delta sub horizontal ignore trail t nil t)
+ (- (/ (float (window-size sub horizontal t))
parent-total)
(window-normal-size sub horizontal)))))
((> delta 0)
;; When enlarging store the total/normal size factor only
(set-window-new-normal
sub
- (- (/ (float (window-total-size sub horizontal))
+ (- (/ (float (window-size sub horizontal t))
parent-total)
(window-normal-size sub horizontal)))))
@@ -2212,16 +2510,18 @@ already set by this routine."
(setq sub (window-left sub)))
(when best-window
- (setq delta (1+ delta)))
- (set-window-new-total best-window -1 t)
- (set-window-new-normal
- best-window
- (if (= (car (window-new-normal best-window)) 1)
- 'skip ; We can't shrink best-window any further.
- (cons (1- (car (window-new-normal best-window)))
- (- (/ (float (window-new-total best-window))
- parent-total)
- (window-normal-size best-window horizontal)))))))
+ (setq best-delta (min (car (window-new-normal best-window))
+ char-size (- delta)))
+ (setq delta (+ delta best-delta))
+ (set-window-new-pixel best-window (- best-delta) t)
+ (set-window-new-normal
+ best-window
+ (if (= (car (window-new-normal best-window)) best-delta)
+ 'skip ; We can't shrink best-window any further.
+ (cons (1- (car (window-new-normal best-window)))
+ (- (/ (float (window-new-pixel best-window))
+ parent-total)
+ (window-normal-size best-window horizontal))))))))
((> delta 0)
;; Enlarge windows by delta.
(setq best-window t)
@@ -2238,13 +2538,14 @@ already set by this routine."
(setq sub (window-left sub)))
(when best-window
- (setq delta (1- delta)))
- (set-window-new-total best-window 1 t)
- (set-window-new-normal
- best-window
- (- (/ (float (window-new-total best-window))
- parent-total)
- (window-normal-size best-window horizontal))))))
+ (setq best-delta (min delta char-size))
+ (setq delta (- delta best-delta))
+ (set-window-new-pixel best-window best-delta t)
+ (set-window-new-normal
+ best-window
+ (- (/ (float (window-new-pixel best-window))
+ parent-total)
+ (window-normal-size best-window horizontal)))))))
(when best-window
(setq sub last)
@@ -2258,8 +2559,8 @@ already set by this routine."
(unless (eq (window-new-normal sub) 'ignore)
;; Resize this window's child windows (back-engineering
;; delta from sub's old and new total sizes).
- (let ((delta (- (window-new-total sub)
- (window-total-size sub horizontal))))
+ (let ((delta (- (window-new-pixel sub)
+ (window-size sub horizontal t))))
(unless (and (zerop delta) (not trail))
;; For the TRAIL non-nil case we have to resize SUB
;; recursively even if it's size does not change.
@@ -2267,10 +2568,10 @@ already set by this routine."
sub delta horizontal ignore nil trail edge))))
(setq sub (window-left sub)))))))
-(defun window--resize-siblings (window delta &optional horizontal ignore trail edge)
- "Resize other windows when WINDOW is resized vertically by DELTA lines.
+(defun window--resize-siblings (window delta &optional horizontal ignore trail edge char-size)
+ "Resize other windows when WINDOW is resized vertically by DELTA pixels.
Optional argument HORIZONTAL non-nil means resize other windows
-when WINDOW is resized horizontally by DELTA columns. WINDOW
+when WINDOW is resized horizontally by DELTA pixels. WINDOW
itself is not resized by this function.
Optional argument IGNORE non-nil means ignore restrictions
@@ -2315,7 +2616,7 @@ preferably only resize windows adjacent to EDGE."
(setq sub (window-right sub)))
;; Set this-delta to what we can get from WINDOW's siblings.
- (if (= (- delta) (window-total-size window horizontal))
+ (if (= (- delta) (window-size window horizontal t))
;; A deletion, presumably. We must handle this case
;; specially since `window--resizable' can't be used.
(if this-delta
@@ -2326,7 +2627,8 @@ preferably only resize windows adjacent to EDGE."
(setq this-delta 0))
;; Any other form of resizing.
(setq this-delta
- (window--resizable window delta horizontal ignore trail t)))
+ (window--resizable
+ window delta horizontal ignore trail t nil t)))
;; Set other-delta to what we still have to get from
;; ancestor windows of parent.
@@ -2334,7 +2636,7 @@ preferably only resize windows adjacent to EDGE."
(unless (zerop other-delta)
;; Unless we got everything from WINDOW's siblings, PARENT
;; must be resized by other-delta lines or columns.
- (set-window-new-total parent other-delta 'add))
+ (set-window-new-pixel parent other-delta 'add))
(if (zerop this-delta)
;; We haven't got anything from WINDOW's siblings but we
@@ -2345,7 +2647,7 @@ preferably only resize windows adjacent to EDGE."
;; we have to resize their child windows.
(unless (eq (window--resize-child-windows
parent (- this-delta) horizontal
- window ignore trail edge)
+ window ignore trail edge char-size)
;; If `window--resize-child-windows' returns
;; 'normalized, this means it has set the
;; normal sizes already.
@@ -2359,21 +2661,22 @@ preferably only resize windows adjacent to EDGE."
;; In an ortho-combination all siblings of WINDOW must be
;; resized by DELTA.
- (set-window-new-total parent delta 'add)
+ (set-window-new-pixel parent delta 'add)
(while sub
(unless (eq sub window)
- (window--resize-this-window sub delta horizontal ignore t))
+ (window--resize-this-window
+ sub delta horizontal ignore t))
(setq sub (window-right sub))))
(unless (zerop delta)
;; "Go up."
(window--resize-siblings
- parent delta horizontal ignore trail edge)))))
+ parent delta horizontal ignore trail edge char-size)))))
-(defun window--resize-this-window (window delta &optional horizontal ignore add trail edge)
- "Resize WINDOW vertically by DELTA lines.
+(defun window--resize-this-window (window delta &optional horizontal ignore add trail edge char-size)
+ "Resize WINDOW vertically by DELTA pixels.
Optional argument HORIZONTAL non-nil means resize WINDOW
-horizontally by DELTA columns.
+horizontally by DELTA pixels.
Optional argument IGNORE non-nil means ignore restrictions
imposed by fixed size windows, `window-min-height' or
@@ -2392,6 +2695,11 @@ resize only windows on the left or above EDGE. If TRAIL equals
`after', resize only windows on the right or below EDGE. Also,
preferably only resize windows adjacent to EDGE.
+If the optional argument CHAR-SIZE is a positive integer, it specifies
+the number of pixels by which windows are incrementally resized.
+If CHAR-SIZE is nil, this means to use the value of
+`frame-char-height' or `frame-char-width' of WINDOW's frame.
+
This function recursively resizes WINDOW's child windows to fit the
new size. Make sure that WINDOW is `window--resizable' before
calling this function. Note that this function does not resize
@@ -2400,7 +2708,7 @@ eventually call `window-resize-apply' in order to make resizing
actually take effect."
(when add
;; Add DELTA to the new total size of WINDOW.
- (set-window-new-total window delta t))
+ (set-window-new-pixel window delta t))
(let ((sub (window-child window)))
(cond
@@ -2409,15 +2717,15 @@ actually take effect."
;; In an iso-combination resize child windows according to their
;; normal sizes.
(window--resize-child-windows
- window delta horizontal nil ignore trail edge))
+ window delta horizontal nil ignore trail edge char-size))
;; In an ortho-combination resize each child window by DELTA.
(t
(while sub
(window--resize-this-window
- sub delta horizontal ignore t trail edge)
+ sub delta horizontal ignore t trail edge char-size)
(setq sub (window-right sub)))))))
-(defun window--resize-root-window (window delta horizontal ignore)
+(defun window--resize-root-window (window delta horizontal ignore pixelwise)
"Resize root window WINDOW vertically by DELTA lines.
HORIZONTAL non-nil means resize root window WINDOW horizontally
by DELTA columns.
@@ -2427,57 +2735,74 @@ size windows, `window-min-height' or `window-min-width' settings.
This function is only called by the frame resizing routines. It
resizes windows proportionally and never deletes any windows."
- (when (and (windowp window) (numberp delta)
- (window-sizable-p window delta horizontal ignore))
- (window--resize-reset (window-frame window) horizontal)
- (window--resize-this-window window delta horizontal ignore t)))
+ (when (and (windowp window) (numberp delta))
+ (let ((pixel-delta
+ (if pixelwise
+ delta
+ (window--size-to-pixel window delta horizontal))))
+ (when (window-sizable-p window pixel-delta horizontal ignore t)
+ (window--resize-reset (window-frame window) horizontal)
+ (window--resize-this-window
+ window pixel-delta horizontal ignore t)))))
-(defun window--resize-root-window-vertically (window delta)
+(defun window--resize-root-window-vertically (window delta pixelwise)
"Resize root window WINDOW vertically by DELTA lines.
If DELTA is less than zero and we can't shrink WINDOW by DELTA
lines, shrink it as much as possible. If DELTA is greater than
zero, this function can resize fixed-size windows in order to
-recover the necessary lines.
+recover the necessary lines. Return the number of lines that
+were recovered.
-Return the number of lines that were recovered.
+Third argument PIXELWISE non-nil means to interpret DELTA as
+pixels and return the number of pixels that were recovered.
-This function is only called by the minibuffer window resizing
-routines. It resizes windows proportionally and never deletes
-any windows."
- (let ((frame (window-frame window))
- ignore)
+This function is called by the minibuffer window resizing
+routines."
+ (let* ((frame (window-frame window))
+ (pixel-delta
+ (cond
+ (pixelwise
+ delta)
+ ((numberp delta)
+ (* (frame-char-height frame) delta))
+ (t 0)))
+ ignore)
(cond
- ((not (numberp delta))
- (setq delta 0))
- ((zerop delta))
- ((< delta 0)
- (setq delta (window-sizable window delta))
+ ((zerop pixel-delta))
+ ((< pixel-delta 0)
+ (setq pixel-delta (window-sizable window pixel-delta nil nil pixelwise))
(window--resize-reset frame)
;; When shrinking the root window, emulate an edge drag in order
;; to not resize other windows if we can avoid it (Bug#12419).
(window--resize-this-window
- window delta nil ignore t 'before
- (+ (window-top-line window) (window-total-size window)))
+ window pixel-delta nil ignore t 'before
+ (+ (window-pixel-top window) (window-pixel-height window)))
;; Don't record new normal sizes to make sure that shrinking back
;; proportionally works as intended.
(walk-window-tree
(lambda (window) (set-window-new-normal window 'ignore)) frame t))
- ((> delta 0)
+ ((> pixel-delta 0)
(window--resize-reset frame)
- (unless (window-sizable window delta)
+ (unless (window-sizable window pixel-delta nil nil pixelwise)
(setq ignore t))
;; When growing the root window, resize proportionally. This
;; should give windows back their original sizes (hopefully).
- (window--resize-this-window window delta nil ignore t)))
+ (window--resize-this-window
+ window pixel-delta nil ignore t)))
;; Return the possibly adjusted DELTA.
- delta))
+ (if pixelwise
+ pixel-delta
+ (/ pixel-delta (frame-char-height frame)))))
-(defun adjust-window-trailing-edge (window delta &optional horizontal)
+(defun adjust-window-trailing-edge (window delta &optional horizontal pixelwise)
"Move WINDOW's bottom edge by DELTA lines.
Optional argument HORIZONTAL non-nil means move WINDOW's right
edge by DELTA columns. WINDOW must be a valid window and
defaults to the selected one.
+Optional argument PIXELWISE non-nil means interpret DELTA as
+number of pixels.
+
If DELTA is greater than zero, move the edge downwards or to the
right. If DELTA is less than zero, move the edge upwards or to
the left. If the edge can't be moved by DELTA lines or columns,
@@ -2487,6 +2812,11 @@ move it as far as possible in the desired direction."
(minibuffer-window (minibuffer-window frame))
(right window)
left this-delta min-delta max-delta)
+
+ (unless pixelwise
+ (setq pixelwise t)
+ (setq delta (* delta (frame-char-size window horizontal))))
+
;; Find the edge we want to move.
(while (and (or (not (window-combined-p right horizontal))
(not (window-right right)))
@@ -2497,8 +2827,8 @@ move it as far as possible in the desired direction."
;; and immediately below WINDOW and it's either active or
;; `resize-mini-windows' is nil.
(eq (window-frame minibuffer-window) frame)
- (= (nth 1 (window-edges minibuffer-window))
- (nth 3 (window-edges window)))
+ (= (nth 1 (window-pixel-edges minibuffer-window))
+ (nth 3 (window-pixel-edges window)))
(or (not resize-mini-windows)
(eq minibuffer-window (active-minibuffer-window))))
(window--resize-mini-window minibuffer-window (- delta)))
@@ -2539,8 +2869,12 @@ move it as far as possible in the desired direction."
;; two windows we want to resize.
(cond
((> delta 0)
- (setq max-delta (window--max-delta-1 left 0 horizontal nil 'after))
- (setq min-delta (window--min-delta-1 right (- delta) horizontal nil 'before))
+ (setq max-delta
+ (window--max-delta-1
+ left 0 horizontal nil 'after nil pixelwise))
+ (setq min-delta
+ (window--min-delta-1
+ right (- delta) horizontal nil 'before nil pixelwise))
(when (or (< max-delta delta) (> min-delta (- delta)))
;; We can't get the whole DELTA - move as far as possible.
(setq delta (min max-delta (- min-delta))))
@@ -2548,22 +2882,27 @@ move it as far as possible in the desired direction."
;; Start resizing.
(window--resize-reset frame horizontal)
;; Try to enlarge LEFT first.
- (setq this-delta (window--resizable left delta horizontal))
+ (setq this-delta (window--resizable
+ left delta horizontal nil nil nil nil pixelwise))
(unless (zerop this-delta)
(window--resize-this-window
left this-delta horizontal nil t 'before
(if horizontal
- (+ (window-left-column left) (window-total-size left t))
- (+ (window-top-line left) (window-total-size left)))))
+ (+ (window-pixel-left left) (window-pixel-width left))
+ (+ (window-pixel-top left) (window-pixel-height left)))))
;; Shrink windows on right of LEFT.
(window--resize-siblings
left delta horizontal nil 'after
(if horizontal
- (window-left-column right)
- (window-top-line right)))))
+ (window-pixel-left right)
+ (window-pixel-top right)))))
((< delta 0)
- (setq max-delta (window--max-delta-1 right 0 horizontal nil 'before))
- (setq min-delta (window--min-delta-1 left delta horizontal nil 'after))
+ (setq max-delta
+ (window--max-delta-1
+ right 0 horizontal nil 'before nil pixelwise))
+ (setq min-delta
+ (window--min-delta-1
+ left delta horizontal nil 'after nil pixelwise))
(when (or (< max-delta (- delta)) (> min-delta delta))
;; We can't get the whole DELTA - move as far as possible.
(setq delta (max (- max-delta) min-delta)))
@@ -2571,24 +2910,30 @@ move it as far as possible in the desired direction."
;; Start resizing.
(window--resize-reset frame horizontal)
;; Try to enlarge RIGHT.
- (setq this-delta (window--resizable right (- delta) horizontal))
+ (setq this-delta
+ (window--resizable
+ right (- delta) horizontal nil nil nil nil pixelwise))
(unless (zerop this-delta)
(window--resize-this-window
right this-delta horizontal nil t 'after
(if horizontal
- (window-left-column right)
- (window-top-line right))))
+ (window-pixel-left right)
+ (window-pixel-top right))))
;; Shrink windows on left of RIGHT.
(window--resize-siblings
right (- delta) horizontal nil 'before
(if horizontal
- (+ (window-left-column left) (window-total-size left t))
- (+ (window-top-line left) (window-total-size left)))))))
+ (+ (window-pixel-left left) (window-pixel-width left))
+ (+ (window-pixel-top left) (window-pixel-height left)))))))
(unless (zerop delta)
;; Don't report an error in the standard case.
- (unless (window-resize-apply frame horizontal)
- ;; But do report an error if applying the changes fails.
- (error "Failed adjusting window %s" window)))))))
+ (when (window--resize-apply-p frame horizontal)
+ (if (window-resize-apply frame horizontal)
+ (progn
+ (window--pixel-to-total frame horizontal)
+ (run-window-configuration-change-hook frame))
+ ;; But do report an error if applying the changes fails.
+ (error "Failed adjusting window %s" window))))))))
(defun enlarge-window (delta &optional horizontal)
"Make the selected window DELTA lines taller.
@@ -2613,7 +2958,7 @@ negative, shrink selected window by -DELTA lines or columns."
;; If the selected window is full height and `resize-mini-windows'
;; is nil, resize the minibuffer window.
(window--resize-mini-window minibuffer-window (- delta)))
- ((window-resizable-p nil delta horizontal)
+ ((window--resizable-p nil delta horizontal)
(window-resize nil delta horizontal))
(t
(window-resize
@@ -2646,7 +2991,7 @@ Also see the `window-min-height' variable."
;; If the selected window is full height and `resize-mini-windows'
;; is nil, resize the minibuffer window.
(window--resize-mini-window minibuffer-window delta))
- ((window-resizable-p nil (- delta) horizontal)
+ ((window--resizable-p nil (- delta) horizontal)
(window-resize nil (- delta) horizontal))
(t
(window-resize
@@ -2655,23 +3000,39 @@ Also see the `window-min-height' variable."
(window-max-delta nil horizontal))
horizontal)))))
-(defun maximize-window (&optional window)
+(defun maximize-window (&optional window pixelwise)
"Maximize WINDOW.
Make WINDOW as large as possible without deleting any windows.
-WINDOW must be a valid window and defaults to the selected one."
+WINDOW must be a valid window and defaults to the selected one.
+
+If the option `window-resize-pixelwise' is non-nil maximize
+WINDOW pixelwise."
(interactive)
(setq window (window-normalize-window window))
- (window-resize window (window-max-delta window))
- (window-resize window (window-max-delta window t) t))
-
-(defun minimize-window (&optional window)
+ (window-resize
+ window (window-max-delta window nil nil nil nil nil window-resize-pixelwise)
+ nil nil window-resize-pixelwise)
+ (window-resize
+ window (window-max-delta window t nil nil nil nil window-resize-pixelwise)
+ t nil window-resize-pixelwise))
+
+(defun minimize-window (&optional window pixelwise)
"Minimize WINDOW.
Make WINDOW as small as possible without deleting any windows.
-WINDOW must be a valid window and defaults to the selected one."
+WINDOW must be a valid window and defaults to the selected one.
+
+If the option `window-resize-pixelwise' is non-nil minimize
+WINDOW pixelwise."
(interactive)
(setq window (window-normalize-window window))
- (window-resize window (- (window-min-delta window)))
- (window-resize window (- (window-min-delta window t)) t))
+ (window-resize
+ window
+ (- (window-min-delta window nil nil nil nil nil window-resize-pixelwise))
+ nil nil window-resize-pixelwise)
+ (window-resize
+ window
+ (- (window-min-delta window t nil nil nil nil window-resize-pixelwise))
+ t nil window-resize-pixelwise))
(defun frame-root-window-p (window)
"Return non-nil if WINDOW is the root window of its frame."
@@ -2828,7 +3189,7 @@ Return 'frame if deleting WINDOW should also delete its frame."
(setq window (window-normalize-window window))
(unless (or ignore-window-parameters
- (eq (window-parameter window 'delete-window) t))
+ (eq (window-parameter window 'delete-window) t))
;; Handle atomicity.
(when (window-parameter window 'window-atom)
(setq window (window-atom-root window))))
@@ -2914,7 +3275,7 @@ that is its frame's root window."
(error "Attempt to delete last non-side window")))
(let* ((horizontal (window-left-child parent))
- (size (window-total-size window horizontal))
+ (size (window-size window horizontal t))
(frame-selected
(window--in-subtree-p (frame-selected-window frame) window))
;; Emacs 23 preferably gives WINDOW's space to its left
@@ -2923,13 +3284,13 @@ that is its frame's root window."
(window--resize-reset frame horizontal)
(cond
((and (not window-combination-resize)
- sibling (window-sizable-p sibling size))
+ sibling (window-sizable-p sibling size horizontal nil t))
;; Resize WINDOW's sibling.
(window--resize-this-window sibling size horizontal nil t)
(set-window-new-normal
sibling (+ (window-normal-size sibling horizontal)
(window-normal-size window horizontal))))
- ((window-resizable-p window (- size) horizontal nil nil nil t)
+ ((window--resizable-p window (- size) horizontal nil nil nil t t)
;; Can do without resizing fixed-size windows.
(window--resize-siblings window (- size) horizontal))
(t
@@ -2937,6 +3298,7 @@ that is its frame's root window."
(window--resize-siblings window (- size) horizontal t)))
;; Actually delete WINDOW.
(delete-window-internal window)
+ (window--pixel-to-total frame horizontal)
(when (and frame-selected
(window-parameter
(frame-selected-window frame) 'no-other-window))
@@ -3608,11 +3970,11 @@ the buffer of WINDOW. The following values are handled:
(eq (nth 3 quit-restore) buffer))
;; Show another buffer stored in quit-restore parameter.
(when (and (integerp (nth 3 quad))
- (/= (nth 3 quad) (window-total-size window)))
+ (/= (nth 3 quad) (window-total-height window)))
;; Try to resize WINDOW to its old height but don't signal an
;; error.
(condition-case nil
- (window-resize window (- (nth 3 quad) (window-total-size window)))
+ (window-resize window (- (nth 3 quad) (window-total-height window)))
(error nil)))
(set-window-dedicated-p window nil)
;; Restore WINDOW's previous buffer, start and point position.
@@ -3690,14 +4052,20 @@ showing BUFFER-OR-NAME."
(unrecord-window-buffer window buffer)))))
;;; Splitting windows.
-(defun window-split-min-size (&optional horizontal)
+(defun window-split-min-size (&optional horizontal pixelwise)
"Return minimum height of any window when splitting windows.
Optional argument HORIZONTAL non-nil means return minimum width."
- (if horizontal
- (max window-min-width window-safe-min-width)
- (max window-min-height window-safe-min-height)))
+ (cond
+ (pixelwise
+ (if horizontal
+ (window-min-pixel-width)
+ (window-min-pixel-height)))
+ (horizontal
+ (max window-min-width window-safe-min-width))
+ (t
+ (max window-min-height window-safe-min-height))))
-(defun split-window (&optional window size side)
+(defun split-window (&optional window size side pixelwise)
"Make a new window adjacent to WINDOW.
WINDOW must be a valid window and defaults to the selected one.
Return the new window which is always a live window.
@@ -3725,6 +4093,8 @@ window provided SIZE is negative) including space reserved for
fringes and the scrollbar or a divider column. Any other non-nil
value for SIDE is currently handled like t (or `right').
+PIXELWISE, if non-nil, means to interpret SIZE pixelwise.
+
If the variable `ignore-window-parameters' is non-nil or the
`split-window' parameter of WINDOW equals t, do not process any
parameters of WINDOW. Otherwise, if the `split-window' parameter
@@ -3754,8 +4124,11 @@ frame. The selected window is not changed by this function."
;; have to override their value.
(window-combination-limit window-combination-limit)
(window-combination-resize window-combination-resize)
+ (char-size (frame-char-size window horizontal))
+ (pixel-size
+ (when (numberp size)
+ (window--size-to-pixel window size horizontal pixelwise t)))
atom-root)
-
(window--check frame)
(catch 'done
(cond
@@ -3771,7 +4144,7 @@ frame. The selected window is not changed by this function."
((and (window-parameter window 'window-atom)
(setq atom-root (window-atom-root window))
(not (eq atom-root window)))
- (throw 'done (split-window atom-root size side)))
+ (throw 'done (split-window atom-root size side pixelwise)))
;; If WINDOW is a side window or its first or last child is a
;; side window, throw an error unless `window-combination-resize'
;; equals 'side.
@@ -3796,13 +4169,14 @@ frame. The selected window is not changed by this function."
;; If `window-combination-resize' is t and SIZE is non-negative,
;; bind `window-combination-limit' to t.
- (when (and (eq window-combination-resize t) size (> size 0))
+ (when (and (eq window-combination-resize t)
+ pixel-size (> pixel-size 0))
(setq window-combination-limit t))
- (let* ((parent-size
- ;; `parent-size' is the size of WINDOW's parent, provided
- ;; it has one.
- (when parent (window-total-size parent horizontal)))
+ (let* ((parent-pixel-size
+ ;; `parent-pixel-size' is the pixel size of WINDOW's
+ ;; parent, provided it has one.
+ (when parent (window-size parent horizontal t)))
;; `resize' non-nil means we are supposed to resize other
;; windows in WINDOW's combination.
(resize
@@ -3812,76 +4186,82 @@ frame. The selected window is not changed by this function."
(not (eq window-combination-limit t))
;; Resize makes sense in iso-combinations only.
(window-combined-p window horizontal)))
- ;; `old-size' is the current size of WINDOW.
- (old-size (window-total-size window horizontal))
+ ;; `old-pixel-size' is the current pixel size of WINDOW.
+ (old-pixel-size (window-size window horizontal t))
;; `new-size' is the specified or calculated size of the
;; new window.
- (new-size
- (cond
- ((not size)
- (max (window-split-min-size horizontal)
- (if resize
- ;; When resizing try to give the new window the
- ;; average size of a window in its combination.
- (min (- parent-size
- (window-min-size parent horizontal))
- (/ parent-size
- (1+ (window-combinations
- parent horizontal))))
- ;; Else try to give the new window half the size
- ;; of WINDOW (plus an eventual odd line).
- (+ (/ old-size 2) (% old-size 2)))))
- ((>= size 0)
- ;; SIZE non-negative specifies the new size of WINDOW.
-
- ;; Note: Specifying a non-negative SIZE is practically
- ;; always done as workaround for making the new window
- ;; appear above or on the left of the new window (the
- ;; ispell window is a typical example of that). In all
- ;; these cases the SIDE argument should be set to 'above
- ;; or 'left in order to support the 'resize option.
- ;; Here we have to nest the windows instead, see above.
- (- old-size size))
- (t
- ;; SIZE negative specifies the size of the new window.
- (- size))))
- new-parent new-normal)
+ new-pixel-size new new-parent new-normal)
+ (cond
+ ((not pixel-size)
+ (setq new-pixel-size
+ (if resize
+ ;; When resizing try to give the new window the
+ ;; average size of a window in its combination.
+ (min (- parent-pixel-size
+ (window-min-size parent horizontal nil t))
+ (/ parent-pixel-size
+ (1+ (window-combinations parent horizontal))))
+ ;; Else try to give the new window half the size
+ ;; of WINDOW (plus an eventual odd pixel).
+ (/ old-pixel-size 2)))
+ (unless window-resize-pixelwise
+ ;; Round to nearest char-size multiple.
+ (setq new-pixel-size
+ (* char-size (round new-pixel-size char-size)))))
+ ((>= pixel-size 0)
+ ;; SIZE non-negative specifies the new size of WINDOW.
+
+ ;; Note: Specifying a non-negative SIZE is practically
+ ;; always done as workaround for making the new window
+ ;; appear above or on the left of the new window (the
+ ;; ispell window is a typical example of that). In all
+ ;; these cases the SIDE argument should be set to 'above
+ ;; or 'left in order to support the 'resize option.
+ ;; Here we have to nest the windows instead, see above.
+ (setq new-pixel-size (- old-pixel-size pixel-size)))
+ (t
+ ;; SIZE negative specifies the size of the new window.
+ (setq new-pixel-size (- pixel-size))))
;; Check SIZE.
(cond
- ((not size)
+ ((not pixel-size)
(cond
(resize
;; SIZE unspecified, resizing.
- (when (and (not (window-sizable-p parent (- new-size) horizontal))
+ (when (and (not (window-sizable-p
+ parent (- new-pixel-size) horizontal nil t))
;; Try again with minimum split size.
- (setq new-size
- (max new-size (window-split-min-size horizontal)))
- (not (window-sizable-p parent (- new-size) horizontal)))
- (error "Window %s too small for splitting" parent)))
- ((> (+ new-size (window-min-size window horizontal)) old-size)
+ (setq new-pixel-size
+ (max new-pixel-size
+ (window-split-min-size horizontal t)))
+ (not (window-sizable-p
+ parent (- new-pixel-size) horizontal nil t)))
+ (error "Window %s too small for splitting 1" parent)))
+ ((> (+ new-pixel-size (window-min-size window horizontal nil t))
+ old-pixel-size)
;; SIZE unspecified, no resizing.
- (error "Window %s too small for splitting" window))))
- ((and (>= size 0)
- (or (>= size old-size)
- (< new-size (if horizontal
- window-safe-min-width
- window-safe-min-width))))
+ (error "Window %s too small for splitting 2" window))))
+ ((and (>= pixel-size 0)
+ (or (>= pixel-size old-pixel-size)
+ (< new-pixel-size
+ (window-safe-min-pixel-size window horizontal))))
;; SIZE specified as new size of old window. If the new size
;; is larger than the old size or the size of the new window
;; would be less than the safe minimum, signal an error.
- (error "Window %s too small for splitting" window))
+ (error "Window %s too small for splitting 3" window))
(resize
;; SIZE specified, resizing.
- (unless (window-sizable-p parent (- new-size) horizontal)
+ (unless (window-sizable-p
+ parent (- new-pixel-size) horizontal nil t)
;; If we cannot resize the parent give up.
- (error "Window %s too small for splitting" parent)))
- ((or (< new-size
- (if horizontal window-safe-min-width window-safe-min-height))
- (< (- old-size new-size)
- (if horizontal window-safe-min-width window-safe-min-height)))
+ (error "Window %s too small for splitting 4" parent)))
+ ((or (< new-pixel-size
+ (window-safe-min-pixel-size window horizontal))
+ (< (- old-pixel-size new-pixel-size)
+ (window-safe-min-pixel-size window horizontal)))
;; SIZE specification violates minimum size restrictions.
- (error "Window %s too small for splitting" window)))
+ (error "Window %s too small for splitting 5" window)))
(window--resize-reset frame horizontal)
@@ -3894,7 +4274,8 @@ frame. The selected window is not changed by this function."
(setq new-normal
;; Make new-normal the normal size of the new window.
(cond
- (size (/ (float new-size) (if new-parent old-size parent-size)))
+ (pixel-size (/ (float new-pixel-size)
+ (if new-parent old-pixel-size parent-pixel-size)))
(new-parent 0.5)
(resize (/ 1.0 (1+ (window-combinations parent horizontal))))
(t (/ (window-normal-size window horizontal) 2.0))))
@@ -3905,7 +4286,8 @@ frame. The selected window is not changed by this function."
;; we won't be able to return space to those windows when we
;; delete the one we create here. Hence we do not go up.
(progn
- (window--resize-child-windows parent (- new-size) horizontal)
+ (window--resize-child-windows
+ parent (- new-pixel-size) horizontal)
(let* ((normal (- 1.0 new-normal))
(sub (window-child parent)))
(while sub
@@ -3913,13 +4295,18 @@ frame. The selected window is not changed by this function."
sub (* (window-normal-size sub horizontal) normal))
(setq sub (window-right sub)))))
;; Get entire space from WINDOW.
- (set-window-new-total window (- old-size new-size))
- (window--resize-this-window window (- new-size) horizontal)
+ (set-window-new-pixel
+ window (- old-pixel-size new-pixel-size))
+;; (set-window-new-pixel window (- old-pixel-size new-pixel-size))
+;; (set-window-new-total
+;; window (- old-size new-size))
+ (window--resize-this-window window (- new-pixel-size) horizontal)
(set-window-new-normal
window (- (if new-parent 1.0 (window-normal-size window horizontal))
new-normal)))
- (let* ((new (split-window-internal window new-size side new-normal)))
+ (let* ((new (split-window-internal window new-pixel-size side new-normal)))
+ (window--pixel-to-total frame horizontal)
;; Assign window-side parameters, if any.
(cond
((eq window-combination-resize 'side)
@@ -3946,6 +4333,7 @@ frame. The selected window is not changed by this function."
(set-window-parameter new 'window-atom t)))
(run-window-configuration-change-hook frame)
+ (run-window-scroll-functions new)
(window--check frame)
;; Always return the new window.
new)))))
@@ -4056,17 +4444,20 @@ right, if any."
"Subroutine of `balance-windows-1'.
WINDOW must be a vertical combination (horizontal if HORIZONTAL
is non-nil)."
- (let* ((first (window-child window))
+ (let* ((char-size (if window-resize-pixelwise
+ 1
+ (frame-char-size window horizontal)))
+ (first (window-child window))
(sub first)
(number-of-children 0)
- (parent-size (window-new-total window))
+ (parent-size (window-new-pixel window))
(total-sum parent-size)
failed size sub-total sub-delta sub-amount rest)
(while sub
(setq number-of-children (1+ number-of-children))
(when (window-size-fixed-p sub horizontal)
(setq total-sum
- (- total-sum (window-total-size sub horizontal)))
+ (- total-sum (window-size sub horizontal t)))
(set-window-new-normal sub 'ignore))
(setq sub (window-right sub)))
@@ -4078,12 +4469,12 @@ is non-nil)."
(while (and sub (not failed))
;; Ignore child windows that should be ignored or are stuck.
(unless (window--resize-child-windows-skip-p sub)
- (setq sub-total (window-total-size sub horizontal))
+ (setq sub-total (window-size sub horizontal t))
(setq sub-delta (- size sub-total))
(setq sub-amount
- (window-sizable sub sub-delta horizontal))
+ (window-sizable sub sub-delta horizontal nil t))
;; Register the new total size for this child window.
- (set-window-new-total sub (+ sub-total sub-amount))
+ (set-window-new-pixel sub (+ sub-total sub-amount))
(unless (= sub-amount sub-delta)
(setq total-sum (- total-sum sub-total sub-amount))
(setq number-of-children (1- number-of-children))
@@ -4092,14 +4483,15 @@ is non-nil)."
(set-window-new-normal sub 'skip)))
(setq sub (window-right sub))))
+ ;; How can we be sure that `number-of-children' is NOT zero here ?
(setq rest (% total-sum number-of-children))
;; Fix rounding by trying to enlarge non-stuck windows by one line
;; (column) until `rest' is zero.
(setq sub first)
(while (and sub (> rest 0))
(unless (window--resize-child-windows-skip-p window)
- (set-window-new-total sub 1 t)
- (setq rest (1- rest)))
+ (set-window-new-pixel sub char-size t)
+ (setq rest (- rest char-size)))
(setq sub (window-right sub)))
;; Fix rounding by trying to enlarge stuck windows by one line
@@ -4107,8 +4499,8 @@ is non-nil)."
(setq sub first)
(while (and sub (> rest 0))
(unless (eq (window-new-normal sub) 'ignore)
- (set-window-new-total sub 1 t)
- (setq rest (1- rest)))
+ (set-window-new-pixel sub char-size t)
+ (setq rest (- rest char-size)))
(setq sub (window-right sub)))
(setq sub first)
@@ -4116,8 +4508,8 @@ is non-nil)."
;; Record new normal sizes.
(set-window-new-normal
sub (/ (if (eq (window-new-normal sub) 'ignore)
- (window-total-size sub horizontal)
- (window-new-total sub))
+ (window-size sub horizontal t)
+ (window-new-pixel sub))
(float parent-size)))
;; Recursively balance each window's child windows.
(balance-windows-1 sub horizontal)
@@ -4129,9 +4521,9 @@ is non-nil)."
(let ((sub (window-child window)))
(if (window-combined-p sub horizontal)
(balance-windows-2 window horizontal)
- (let ((size (window-new-total window)))
+ (let ((size (window-new-pixel window)))
(while sub
- (set-window-new-total sub size)
+ (set-window-new-pixel sub size)
(balance-windows-1 sub horizontal)
(setq sub (window-right sub))))))))
@@ -4157,11 +4549,17 @@ window."
;; Balance vertically.
(window--resize-reset (window-frame window))
(balance-windows-1 window)
- (window-resize-apply frame)
+ (when (window--resize-apply-p frame)
+ (window-resize-apply frame)
+ (window--pixel-to-total frame)
+ (run-window-configuration-change-hook frame))
;; Balance horizontally.
(window--resize-reset (window-frame window) t)
(balance-windows-1 window t)
- (window-resize-apply frame t)))
+ (when (window--resize-apply-p frame t)
+ (window-resize-apply frame)
+ (window--pixel-to-total frame t)
+ (run-window-configuration-change-hook frame))))
(defun window-fixed-size-p (&optional window direction)
"Return t if WINDOW cannot be resized in DIRECTION.
@@ -4180,14 +4578,17 @@ This is used by `balance-windows-area'.
Changing this globally has no effect.")
(make-variable-buffer-local 'window-area-factor)
-(defun balance-windows-area-adjust (window delta horizontal)
+(defun balance-windows-area-adjust (window delta horizontal pixelwise)
"Wrapper around `window-resize' with error checking.
Arguments WINDOW, DELTA and HORIZONTAL are passed on to that function."
;; `window-resize' may fail if delta is too large.
(while (>= (abs delta) 1)
(condition-case nil
(progn
- (window-resize window delta horizontal)
+ ;; It was wrong to use `window-resize' here. Somehow
+ ;; `balance-windows-area' depends on resizing windows
+ ;; asymmetrically.
+ (adjust-window-trailing-edge window delta horizontal pixelwise)
(setq delta 0))
(error
;;(message "adjust: %s" (error-message-string err))
@@ -4204,7 +4605,8 @@ specific buffers."
(if (not (window-fixed-size-p win)) win))
(window-list nil 'nomini))))
(changelog nil)
- next)
+ (pixelwise window-resize-pixelwise)
+ next)
;; Resizing a window changes the size of surrounding windows in complex
;; ways, so it's difficult to balance them all. The introduction of
;; `adjust-window-trailing-edge' made it a bit easier, but it is still
@@ -4228,11 +4630,13 @@ specific buffers."
(window-fixed-size-p next)))
;; (assert (eq next (or (cadr (member win wins)) (car wins))))
(let* ((horiz
- (< (car (window-edges win)) (car (window-edges next))))
- (areadiff (/ (- (* (window-height next) (window-width next)
+ (< (car (window-pixel-edges win)) (car (window-pixel-edges next))))
+ (areadiff (/ (- (* (window-height next pixelwise)
+ (window-width next pixelwise)
(buffer-local-value 'window-area-factor
(window-buffer next)))
- (* (window-height win) (window-width win)
+ (* (window-height win pixelwise)
+ (window-width win pixelwise)
(buffer-local-value 'window-area-factor
(window-buffer win))))
(max (buffer-local-value 'window-area-factor
@@ -4240,8 +4644,10 @@ specific buffers."
(buffer-local-value 'window-area-factor
(window-buffer next)))))
(edgesize (if horiz
- (+ (window-height win) (window-height next))
- (+ (window-width win) (window-width next))))
+ (+ (window-height win pixelwise)
+ (window-height next pixelwise))
+ (+ (window-width win pixelwise)
+ (window-width next pixelwise))))
(diff (/ areadiff edgesize)))
(when (zerop diff)
;; Maybe diff is actually closer to 1 than to 0.
@@ -4256,9 +4662,9 @@ specific buffers."
(setq carry (+ carry areadiff))
;; This used `adjust-window-trailing-edge' before and uses
;; `window-resize' now. Error wrapping is still needed.
- (balance-windows-area-adjust win diff horiz)
+ (balance-windows-area-adjust win diff horiz pixelwise)
;; (sit-for 0.5)
- (let ((change (cons win (window-edges win))))
+ (let ((change (cons win (window-pixel-edges win))))
;; If the same change has been seen already for this window,
;; we're most likely in an endless loop, so don't count it as
;; a change.
@@ -4285,8 +4691,10 @@ specific buffers."
(head
`(,type
,@(unless (window-next-sibling window) `((last . t)))
- (total-height . ,(window-total-size window))
- (total-width . ,(window-total-size window t))
+ (pixel-width . ,(window-pixel-width window))
+ (pixel-height . ,(window-pixel-height window))
+ (total-width . ,(window-total-width window))
+ (total-height . ,(window-total-height window))
(normal-height . ,(window-normal-size window))
(normal-width . ,(window-normal-size window t))
,@(unless (window-live-p window)
@@ -4372,7 +4780,13 @@ value can be also stored on disk and read back in a new session."
(min-height-ignore . ,(window-min-size window nil t))
(min-width-ignore . ,(window-min-size window t t))
(min-height-safe . ,(window-min-size window nil 'safe))
- (min-width-safe . ,(window-min-size window t 'safe)))
+ (min-width-safe . ,(window-min-size window t 'safe))
+ (min-pixel-height . ,(window-min-size window nil nil t))
+ (min-pixel-width . ,(window-min-size window t nil t))
+ (min-pixel-height-ignore . ,(window-min-size window nil t t))
+ (min-pixel-width-ignore . ,(window-min-size window t t t))
+ (min-pixel-height-safe . ,(window-min-size window nil 'safe t))
+ (min-pixel-width-safe . ,(window-min-size window t 'safe t)))
(window--state-get-1 window writable)))
(defvar window-state-put-list nil
@@ -4381,7 +4795,7 @@ value can be also stored on disk and read back in a new session."
(defvar window-state-put-stale-windows nil
"Helper variable for `window-state-put'.")
-(defun window--state-put-1 (state &optional window ignore totals)
+(defun window--state-put-1 (state &optional window ignore totals pixelwise)
"Helper function for `window-state-put'."
(let ((type (car state)))
(setq state (cdr state))
@@ -4392,7 +4806,7 @@ value can be also stored on disk and read back in a new session."
(push (cons window state) window-state-put-list))
((memq type '(vc hc))
(let* ((horizontal (eq type 'hc))
- (total (window-total-size window horizontal))
+ (total (window-size window horizontal pixelwise))
(first t)
size new)
(dolist (item state)
@@ -4409,25 +4823,39 @@ value can be also stored on disk and read back in a new session."
(setq size
(if totals
;; Use total size.
- (cdr (assq (if horizontal 'total-width 'total-height) item))
+ (if pixelwise
+ (cdr (assq (if horizontal
+ 'pixel-width
+ 'pixel-height)
+ item))
+ (cdr (assq (if horizontal
+ 'total-width
+ 'total-height)
+ item)))
;; Use normalized size and round.
- (round (* total
- (cdr (assq
- (if horizontal 'normal-width 'normal-height)
- item))))))
+ (round
+ (* total
+ (cdr (assq (if horizontal 'normal-width 'normal-height)
+ item))))))
;; Use safe sizes, we try to resize later.
- (setq size (max size (if horizontal
- window-safe-min-height
- window-safe-min-width)))
-
- (if (window-sizable-p window (- size) horizontal 'safe)
+ (setq size (max size
+ (if horizontal
+ (* window-safe-min-width
+ (if pixelwise
+ (frame-char-width (window-frame window))
+ 1))
+ (* window-safe-min-height
+ (if pixelwise
+ (frame-char-height (window-frame window))
+ 1)))))
+ (if (window-sizable-p window (- size) horizontal 'safe pixelwise)
(let* ((window-combination-limit
(assq 'combination-limit item)))
;; We must inherit the combination limit, otherwise
;; we might mess up handling of atomic and side
;; window.
- (setq new (split-window window size horizontal)))
+ (setq new (split-window window size horizontal pixelwise)))
;; Give up if we can't resize window down to safe sizes.
(error "Cannot resize window %s" window))
@@ -4445,7 +4873,7 @@ value can be also stored on disk and read back in a new session."
;; Continue with the last window split off.
(setq window new))))))))
-(defun window--state-put-2 (ignore)
+(defun window--state-put-2 (ignore pixelwise)
"Helper function for `window-state-put'."
(dolist (item window-state-put-list)
(let ((window (car item))
@@ -4481,32 +4909,44 @@ value can be also stored on disk and read back in a new session."
(if (memq window-size-fixed '(t height))
;; A fixed height window, try to restore the
;; original size.
- (let ((delta (- (cdr (assq 'total-height item))
- (window-total-height window)))
+ (let ((delta
+ (- (cdr (assq
+ (if pixelwise 'pixel-height 'total-height)
+ item))
+ (window-size window nil pixelwise)))
window-size-fixed)
- (when (window-resizable-p window delta)
- (window-resize window delta)))
+ (when (window--resizable-p
+ window delta nil nil nil nil nil pixelwise)
+ (window-resize window delta nil nil pixelwise)))
;; Else check whether the window is not high enough.
- (let* ((min-size (window-min-size window nil ignore))
- (delta (- min-size (window-total-size window))))
+ (let* ((min-size
+ (window-min-size window nil ignore pixelwise))
+ (delta
+ (- min-size (window-size window nil pixelwise))))
(when (and (> delta 0)
- (window-resizable-p window delta nil ignore))
- (window-resize window delta nil ignore))))
+ (window--resizable-p
+ window delta nil ignore nil nil nil pixelwise))
+ (window-resize window delta nil ignore pixelwise))))
;; Adjust horizontally.
(if (memq window-size-fixed '(t width))
;; A fixed width window, try to restore the original
;; size.
- (let ((delta (- (cdr (assq 'total-width item))
- (window-total-width window)))
+ (let ((delta
+ (- (cdr (assq
+ (if pixelwise 'pixel-width 'total-width)
+ item))
+ (window-size window t pixelwise)))
window-size-fixed)
- (when (window-resizable-p window delta)
- (window-resize window delta)))
+ (when (window--resizable-p
+ window delta nil nil nil nil nil pixelwise)
+ (window-resize window delta nil nil pixelwise)))
;; Else check whether the window is not wide enough.
- (let* ((min-size (window-min-size window t ignore))
- (delta (- min-size (window-total-size window t))))
+ (let* ((min-size (window-min-size window t ignore pixelwise))
+ (delta (- min-size (window-size window t pixelwise))))
(when (and (> delta 0)
- (window-resizable-p window delta t ignore))
- (window-resize window delta t ignore))))
+ (window--resizable-p
+ window delta t ignore nil nil nil pixelwise))
+ (window-resize window delta t ignore pixelwise))))
;; Set dedicated status.
(set-window-dedicated-p window (cdr (assq 'dedicated state)))
;; Install positions (maybe we should do this after all
@@ -4542,32 +4982,60 @@ windows can get as small as `window-safe-min-height' and
;; STATE and that of WINDOW are equal so we can avoid
;; calculating new sizes, and (2) if we do have to resize
;; whether we can do so without violating size restrictions.
- (totals
- (and (= (window-total-size window)
- (cdr (assq 'total-height state)))
- (= (window-total-size window t)
- (cdr (assq 'total-width state)))))
- (min-height (cdr (assq 'min-height head)))
- (min-width (cdr (assq 'min-width head))))
+ (pixelwise (and (cdr (assq 'pixel-width state))
+ (cdr (assq 'pixel-height state))))
+ (totals (or (and pixelwise
+ (= (window-pixel-width window)
+ (cdr (assq 'pixel-width state)))
+ (= (window-pixel-height window)
+ (cdr (assq 'pixel-height state))))
+ (and (= (window-total-width window)
+ (cdr (assq 'total-width state)))
+ (= (window-total-height window)
+ (cdr (assq 'total-height state))))))
+ (min-height (cdr (assq
+ (if pixelwise 'min-pixel-height 'min-height)
+ head)))
+ (min-width (cdr (assq
+ (if pixelwise 'min-pixel-width 'min-weight)
+ head))))
(if (and (not totals)
- (or (> min-height (window-total-size window))
- (> min-width (window-total-size window t)))
+ (or (> min-height (window-size window nil pixelwise))
+ (> min-width (window-size window t pixelwise)))
(or (not ignore)
(and (setq min-height
- (cdr (assq 'min-height-ignore head)))
+ (cdr (assq
+ (if pixelwise
+ 'min-pixel-height-ignore
+ 'min-height-ignore)
+ head)))
(setq min-width
- (cdr (assq 'min-width-ignore head)))
- (or (> min-height (window-total-size window))
- (> min-width (window-total-size window t)))
+ (cdr (assq
+ (if pixelwise
+ 'min-pixel-width-ignore
+ 'min-width-ignore)
+ head)))
+ (or (> min-height
+ (window-size window nil pixelwise))
+ (> min-width
+ (window-size window t pixelwise)))
(or (not (eq ignore 'safe))
(and (setq min-height
- (cdr (assq 'min-height-safe head)))
+ (cdr (assq
+ (if pixelwise
+ 'min-pixel-height-safe
+ 'min-height-safe)
+ head)))
(setq min-width
- (cdr (assq 'min-width-safe head)))
+ (cdr (assq
+ (if pixelwise
+ 'min-pixel-width-safe
+ 'min-width-safe)
+ head)))
(or (> min-height
- (window-total-size window))
+ (window-size window nil pixelwise))
(> min-width
- (window-total-size window t))))))))
+ (window-size window t pixelwise))))))))
;; The check above might not catch all errors due to rounding
;; issues - so IGNORE equal 'safe might not always produce the
;; minimum possible state. But such configurations hardly make
@@ -4581,8 +5049,8 @@ windows can get as small as `window-safe-min-height' and
;; all live windows have been set by `window--state-put-2'.
(with-temp-buffer
(set-window-buffer window (current-buffer))
- (window--state-put-1 state window nil totals)
- (window--state-put-2 ignore))
+ (window--state-put-1 state window nil totals pixelwise)
+ (window--state-put-2 ignore pixelwise))
(while window-state-put-stale-windows
(let ((window (pop window-state-put-stale-windows)))
(when (eq (window-deletable-p window) t)
@@ -4625,7 +5093,7 @@ element is BUFFER."
;; Preserve window-point-insertion-type (Bug#12588).
(copy-marker
(window-point window) window-point-insertion-type)
- (window-total-size window))
+ (window-total-height window))
(selected-window) buffer)))))
((eq type 'window)
;; WINDOW has been created on an existing frame.
@@ -5250,12 +5718,35 @@ live."
(set-window-dedicated-p window dedicated))
(when (memq type '(window frame))
(set-window-prev-buffers window nil)))
- (let ((parameter (window-parameter window 'quit-restore))
+ (let ((frame (window-frame window))
+ (parameter (window-parameter window 'quit-restore))
(height (cdr (assq 'window-height alist)))
- (width (cdr (assq 'window-width alist))))
- (when (or (eq type 'window)
- (and (eq (car parameter) 'same)
- (eq (nth 1 parameter) 'window)))
+ (width (cdr (assq 'window-width alist)))
+ (size (cdr (assq 'window-size alist))))
+ (cond
+ ((or (eq type 'frame)
+ (and (eq (car parameter) 'same)
+ (eq (nth 1 parameter) 'frame)))
+ ;; Adjust size of frame if asked for.
+ (cond
+ ((not size))
+ ((consp size)
+ (let ((width (car size))
+ (height (cdr size))
+ (frame (window-frame window))
+ delta)
+ (when (and (numberp width) (numberp height))
+ (set-frame-height
+ frame (+ (frame-height frame)
+ (- height (window-total-height window))))
+ (set-frame-width
+ frame (+ (frame-width frame)
+ (- width (window-total-width window)))))))
+ ((functionp size)
+ (ignore-errors (funcall size window)))))
+ ((or (eq type 'window)
+ (and (eq (car parameter) 'same)
+ (eq (nth 1 parameter) 'window)))
;; Adjust height of window if asked for.
(cond
((not height))
@@ -5264,10 +5755,10 @@ live."
(if (integerp height)
height
(round
- (* (window-total-size (frame-root-window window))
+ (* (window-total-height (frame-root-window window))
height))))
- (delta (- new-height (window-total-size window))))
- (when (and (window-resizable-p window delta nil 'safe)
+ (delta (- new-height (window-total-height window))))
+ (when (and (window--resizable-p window delta nil 'safe)
(window-combined-p window))
(window-resize window delta nil 'safe))))
((functionp height)
@@ -5280,14 +5771,14 @@ live."
(if (integerp width)
width
(round
- (* (window-total-size (frame-root-window window) t)
+ (* (window-total-width (frame-root-window window))
width))))
- (delta (- new-width (window-total-size window t))))
- (when (and (window-resizable-p window delta t 'safe)
+ (delta (- new-width (window-total-width window))))
+ (when (and (window--resizable-p window delta t 'safe)
(window-combined-p window t))
(window-resize window delta t 'safe))))
((functionp width)
- (ignore-errors (funcall width window))))))
+ (ignore-errors (funcall width window)))))))
window))
@@ -5320,6 +5811,7 @@ The actual non-nil value of this variable will be copied to the
(const display-buffer-pop-up-window)
(const display-buffer-same-window)
(const display-buffer-pop-up-frame)
+ (const display-buffer-in-previous-window)
(const display-buffer-use-some-window)
(function :tag "Other function"))
"Custom type for `display-buffer' action functions.")
@@ -5385,6 +5877,7 @@ See `display-buffer' for details."
'((display-buffer--maybe-same-window ;FIXME: why isn't this redundant?
display-buffer-reuse-window
display-buffer--maybe-pop-up-frame-or-window
+ display-buffer-in-previous-window
display-buffer-use-some-window
;; If all else fails, pop up a new frame.
display-buffer-pop-up-frame))
@@ -5439,9 +5932,11 @@ where FUNCTION is either a function or a list of functions, and
ALIST is an arbitrary association list (alist).
Each such FUNCTION should accept two arguments: the buffer to
-display and an alist. Based on those arguments, it should either
-display the buffer and return the window, or return nil if unable
-to display the buffer.
+display and an alist. Based on those arguments, it should
+display the buffer and return the window. If the caller is
+prepared to handle the case of not displaying the buffer
+and returning nil from `display-buffer' it should pass
+\(allow-no-window . t) as an element of the ALIST.
The `display-buffer' function builds a function list and an alist
by combining the functions and alists specified in
@@ -5460,6 +5955,7 @@ Available action functions include:
`display-buffer-reuse-window'
`display-buffer-pop-up-frame'
`display-buffer-pop-up-window'
+ `display-buffer-in-previous-window'
`display-buffer-use-some-window'
Recognized alist entries include:
@@ -5495,6 +5991,10 @@ Recognized alist entries include:
argument - a new window. The function is supposed to adjust
the width of the window; its return value is ignored.
+ `allow-no-window' -- A non-nil value indicates readiness for the case
+ of not displaying the buffer and FUNCTION can safely return
+ a non-window value to suppress displaying.
+
The ACTION argument to `display-buffer' can also have a non-nil
and non-list value. This means to display the buffer in a window
other than the selected one, even if it is already displayed in
@@ -5542,7 +6042,7 @@ argument, ACTION is t."
(while (and functions (not window))
(setq window (funcall (car functions) buffer alist)
functions (cdr functions)))
- window))))
+ (and (windowp window) window)))))
(defun display-buffer-other-frame (buffer)
"Display buffer BUFFER preferably in another frame.
@@ -5722,7 +6222,8 @@ of the selected frame."
(walk-window-tree
(lambda (window) (setq bottom-window window)) nil nil 'nomini)
(or (and (not (frame-parameter nil 'unsplittable))
- (setq window (window--try-to-split-window bottom-window alist))
+ (let (split-width-threshold)
+ (setq window (window--try-to-split-window bottom-window alist)))
(window--display-buffer
buffer window 'window alist display-buffer-mark-dedicated))
(and (not (frame-parameter nil 'unsplittable))
@@ -5816,14 +6317,36 @@ that frame."
(unless (and not-this-window
(eq window (selected-window)))
window))
- (get-largest-window 0 nil not-this-window))))
+ (get-largest-window 0 nil not-this-window)))
+ (quit-restore (and (window-live-p window)
+ (window-parameter window 'quit-restore)))
+ (quad (nth 1 quit-restore)))
(when (window-live-p window)
+ ;; If the window was used by `display-buffer' before, try to
+ ;; resize it to its old height but don't signal an error.
+ (when (and (listp quad)
+ (integerp (nth 3 quad))
+ (/= (nth 3 quad) (window-total-height window)))
+ (condition-case nil
+ (window-resize window (- (nth 3 quad) (window-total-height window)))
+ (error nil)))
+
(prog1
(window--display-buffer buffer window 'reuse alist)
(window--even-window-heights window)
(unless (cdr (assq 'inhibit-switch-frame alist))
(window--maybe-raise-frame (window-frame window)))))))
+(defun display-buffer-no-window (buffer alist)
+ "Display BUFFER in no window.
+If ALIST has a non-nil `allow-no-window' entry, then don't display
+a window at all. This makes possible to override the default action
+and avoid displaying the buffer. It is assumed that when the caller
+specifies a non-nil `allow-no-window' then it can handle a nil value
+returned from `display-buffer' in this case."
+ (when (cdr (assq 'allow-no-window alist))
+ 'fail))
+
;;; Display + selection commands:
(defun pop-to-buffer (buffer &optional action norecord)
"Select buffer BUFFER in some window, preferably a different one.
@@ -6126,216 +6649,496 @@ WINDOW must be a live window and defaults to the selected one."
(eobp)
window))))
-;;; Resizing buffers to fit their contents exactly.
+;;; Resizing windows and frames to fit their contents exactly.
+(defcustom fit-window-to-buffer-horizontally nil
+ "Non-nil means `fit-window-to-buffer' can resize windows horizontally.
+If this is nil, `fit-window-to-buffer' never resizes windows
+horizontally. If this is `only', it can resize windows
+horizontally only. Any other value means `fit-window-to-buffer'
+can resize windows in both dimensions."
+ :type 'boolean
+ :version "24.4"
+ :group 'help)
+
+;; `fit-frame-to-buffer' eventually wants to know the real frame sizes
+;; counting title bar and outer borders.
(defcustom fit-frame-to-buffer nil
- "Non-nil means `fit-window-to-buffer' can resize frames.
-A frame can be resized if and only if its root window is a live
-window. The height of the root window is subject to the values
-of `fit-frame-to-buffer-max-height' and `window-min-height'."
+ "Non-nil means `fit-frame-to-buffer' can fit a frame to its buffer.
+A frame is fit if and only if its root window is a live window
+and this option is non-nil. If this is `horizontally', frames
+are resized horizontally only. If this is `vertically', frames
+are resized vertically only. Any other non-nil value means
+frames can be resized in both dimensions. See also
+`fit-frame-to-buffer-margins' and `fit-frame-to-buffer-sizes'.
+
+If this is non-nil and a window is the only window of its frame,
+`fit-window-to-buffer' will invoke `fit-frame-to-buffer' to fit
+the frame to its buffer."
:type 'boolean
- :version "24.3"
+ :version "24.4"
:group 'help)
-(defcustom fit-frame-to-buffer-bottom-margin 4
- "Bottom margin for the command `fit-frame-to-buffer'.
-This is the number of lines that function leaves free at the bottom of
-the display, in order to not obscure any system task bar or panel.
-If you do not have one (or if it is vertical) you might want to
-reduce this. If it is thicker, you might want to increase this."
- ;; If you set this too small, fit-frame-to-buffer can shift the
- ;; frame up to avoid the panel.
- :type 'integer
- :version "24.3"
- :group 'windows)
+(defcustom fit-frame-to-buffer-margins '(nil nil nil nil)
+ "Margins around frame for `fit-frame-to-buffer'.
+This list specifies the numbers of pixels to be left free on the
+left, above, the right, and below a frame that shall be fit to
+its buffer. The value specified here can be overridden for a
+specific frame by that frame's `fit-frame-to-buffer-margins'
+parameter, if present.
+
+This variable controls how fitting a frame to the size of its
+buffer coordinates with the size of your display. If you don't
+specify a value here, the size of the display's workarea is used.
+
+See also `fit-frame-to-buffer-sizes'."
+ :version "24.4"
+ :type '(list
+ (choice
+ :tag "Left"
+ :value nil
+ :format "%[LeftMargin%] %v "
+ (const :tag "None" :format "%t" nil)
+ (integer :tag "Pixels" :size 5))
+ (choice
+ :tag "Top"
+ :value nil
+ :format "%[TopMargin%] %v "
+ (const :tag "None" :format "%t" nil)
+ (integer :tag "Pixels" :size 5))
+ (choice
+ :tag "Right"
+ :value nil
+ :format "%[RightMargin%] %v "
+ (const :tag "None" :format "%t" nil)
+ (integer :tag "Pixels" :size 5))
+ (choice
+ :tag "Bottom"
+ :value nil
+ :format "%[BottomMargin%] %v "
+ (const :tag "None" :format "%t" nil)
+ (integer :tag "Pixels" :size 5)))
+ :group 'help)
+
+(defcustom fit-frame-to-buffer-sizes '(nil nil nil nil)
+ "Size boundaries of frame for `fit-frame-to-buffer'.
+This list specifies the total maximum and minimum lines and
+maximum and minimum columns of the root window of any frame that
+shall be fit to its buffer. If any of these values is non-nil,
+it overrides the corresponding argument of `fit-frame-to-buffer'.
+
+On window systems where the menubar can wrap, fitting a frame to
+its buffer may swallow the last line(s). Specifying an
+appropriate minimum width value here can avoid such wrapping.
+
+See also `fit-frame-to-buffer-margins'."
+ :version "24.4"
+ :type '(list
+ (choice
+ :tag "Maximum Height"
+ :value nil
+ :format "%[MaxHeight%] %v "
+ (const :tag "None" :format "%t" nil)
+ (integer :tag "Lines" :size 5))
+ (choice
+ :tag "Minimum Height"
+ :value nil
+ :format "%[MinHeight%] %v "
+ (const :tag "None" :format "%t" nil)
+ (integer :tag "Lines" :size 5))
+ (choice
+ :tag "Maximum Width"
+ :value nil
+ :format "%[MaxWidth%] %v "
+ (const :tag "None" :format "%t" nil)
+ (integer :tag "Columns" :size 5))
+ (choice
+ :tag "Minimum Width"
+ :value nil
+ :format "%[MinWidth%] %v\n"
+ (const :tag "None" :format "%t" nil)
+ (integer :tag "Columns" :size 5)))
+ :group 'help)
(declare-function x-display-pixel-height "xfns.c" (&optional terminal))
(declare-function tool-bar-lines-needed "xdisp.c" (&optional frame))
-(defun fit-frame-to-buffer (&optional frame max-height min-height)
- "Adjust height of FRAME to display its buffer contents exactly.
-FRAME can be any live frame and defaults to the selected one.
+(defun window--sanitize-margin (margin left right)
+ "Return MARGIN if it's a number between LEFT and RIGHT."
+ (when (and (numberp margin)
+ (<= left (- right margin)) (<= margin right))
+ margin))
-Optional argument MAX-HEIGHT specifies the maximum height of FRAME.
-It defaults to the height of the display below the current
-top line of FRAME, minus `fit-frame-to-buffer-bottom-margin'.
-Optional argument MIN-HEIGHT specifies the minimum height of FRAME.
-The default corresponds to `window-min-height'."
+(defun fit-frame-to-buffer (&optional frame max-height min-height max-width min-width)
+ "Adjust size of FRAME to display the contents of its buffer exactly.
+FRAME can be any live frame and defaults to the selected one.
+Fit only if FRAME's root window is live. MAX-HEIGHT, MIN-HEIGHT,
+MAX-WIDTH and MIN-WIDTH specify bounds on the new total size of
+FRAME's root window.
+
+The option `fit-frame-to-buffer' controls whether this function
+has any effect. New position and size of FRAME are additionally
+determined by the options `fit-frame-to-buffer-sizes' and
+`fit-frame-to-buffer-margins' or the corresponding parameters of
+FRAME."
(interactive)
(or (fboundp 'x-display-pixel-height)
(user-error "Cannot resize frame in non-graphic Emacs"))
(setq frame (window-normalize-frame frame))
- (let* ((root (frame-root-window frame))
- (frame-min-height
- (+ (- (frame-height frame) (window-total-size root))
- window-min-height))
- (frame-top (frame-parameter frame 'top))
- (top (if (consp frame-top)
- (funcall (car frame-top) (cadr frame-top))
- frame-top))
- (frame-max-height
- (- (/ (- (x-display-pixel-height frame) top)
- (frame-char-height frame))
- fit-frame-to-buffer-bottom-margin))
- (compensate 0)
- delta)
- (when (and (window-live-p root) (not (window-size-fixed-p root)))
- (with-selected-window root
- (cond
- ((not max-height)
- (setq max-height frame-max-height))
- ((numberp max-height)
- (setq max-height (min max-height frame-max-height)))
- (t
- (error "%s is an invalid maximum height" max-height)))
+ (when (and (window-live-p (frame-root-window frame))
+ fit-frame-to-buffer
+ (or (not window-size-fixed)
+ (and (eq window-size-fixed 'height)
+ (not (eq fit-frame-to-buffer 'vertically)))
+ (and (eq window-size-fixed 'width)
+ (not (eq fit-frame-to-buffer 'horizontally)))))
+ (with-selected-window (frame-root-window frame)
+ (let* ((window (frame-root-window frame))
+ (char-width (frame-char-width))
+ (char-height (frame-char-height))
+ (monitor-attributes (car (display-monitor-attributes-list
+ (frame-parameter frame 'display))))
+ (geometry (cdr (assq 'geometry monitor-attributes)))
+ (display-width (- (nth 2 geometry) (nth 0 geometry)))
+ (display-height (- (nth 3 geometry) (nth 1 geometry)))
+ (workarea (cdr (assq 'workarea monitor-attributes)))
+ ;; Handle margins.
+ (margins (or (frame-parameter frame 'fit-frame-to-buffer-margins)
+ fit-frame-to-buffer-margins))
+ (left-margin (or (window--sanitize-margin
+ (nth 0 margins) 0 display-width)
+ (nth 0 workarea)))
+ (top-margin (or (window--sanitize-margin
+ (nth 1 margins) 0 display-height)
+ (nth 1 workarea)))
+ (workarea-width (nth 2 workarea))
+ (right-margin (or (window--sanitize-margin
+ (nth 2 margins) left-margin display-width)
+ (+ left-margin workarea-width)))
+ (workarea-height (nth 3 workarea))
+ (bottom-margin (or (window--sanitize-margin
+ (nth 3 margins) top-margin display-height)
+ (+ top-margin workarea-height)))
+ ;; The pixel width of FRAME (which does not include the
+ ;; window manager's decorations).
+ (frame-width (frame-pixel-width))
+ ;; The pixel width of the body of FRAME's root window.
+ (window-body-width (window-body-width nil t))
+ ;; The difference in pixels between total and body width of
+ ;; FRAME's window.
+ (window-extra-width (- (window-pixel-width) window-body-width))
+ ;; The difference in pixels between the frame's pixel width
+ ;; and the window's body width. This is the space we can't
+ ;; use for fitting.
+ (extra-width (- frame-width window-body-width))
+ ;; The maximum width we can use for fitting.
+ (fit-width (- workarea-width extra-width))
+ ;; The pixel position of FRAME's left border. We usually
+ ;; try to leave this alone.
+ (left
+ (let ((left (frame-parameter nil 'left)))
+ (if (consp left)
+ (funcall (car left) (cadr left))
+ left)))
+ ;; The pixel height of FRAME (which does not include title
+ ;; line, decorations, and sometimes neither the menu nor
+ ;; the toolbar).
+ (frame-height (frame-pixel-height))
+ ;; The pixel height of FRAME's root window (we don't care
+ ;; about the window's body height since the return value of
+ ;; `window-text-pixel-size' includes header and mode line).
+ (window-height (window-pixel-height))
+ ;; The difference in pixels between the frame's pixel
+ ;; height and the window's height.
+ (extra-height (- frame-height window-height))
+ ;; When tool-bar-mode is enabled and we just created a new
+ ;; frame, reserve lines for toolbar resizing. Needed
+ ;; because for reasons unknown to me Emacs (1) reserves one
+ ;; line for the toolbar when making the initial frame and
+ ;; toolbars are enabled, and (2) later adds the remaining
+ ;; lines needed. Our code runs IN BETWEEN (1) and (2).
+ ;; YMMV when you're on a system that behaves differently.
+ (toolbar-extra-height
+ (let ((quit-restore (window-parameter window 'quit-restore))
+ ;; This may have to change when we allow arbitrary
+ ;; pixel height toolbars.
+ (lines (tool-bar-height)))
+ (* char-height
+ (if (and quit-restore (eq (car quit-restore) 'frame)
+ (not (zerop lines)))
+ (1- lines)
+ 0))))
+ ;; The maximum height we can use for fitting.
+ (fit-height
+ (- workarea-height extra-height toolbar-extra-height))
+ ;; The pixel position of FRAME's top border. We usually
+ ;; try to leave this alone.
+ (top
+ (let ((top (frame-parameter nil 'top)))
+ (if (consp top)
+ (funcall (car top) (cadr top))
+ top)))
+ ;; Sanitize minimum and maximum sizes.
+ (sizes (or (frame-parameter frame 'fit-frame-to-buffer-sizes)
+ fit-frame-to-buffer-sizes))
+ (max-height
+ (cond
+ ((numberp (nth 0 sizes)) (* (nth 0 sizes) char-height))
+ ((numberp max-height) (* max-height char-height))))
+ (min-height
+ (cond
+ ((numberp (nth 1 sizes)) (* (nth 1 sizes) char-height))
+ ((numberp min-height) (* min-height char-height))))
+ (max-width
+ (cond
+ ((numberp (nth 2 sizes))
+ (- (* (nth 2 sizes) char-width) window-extra-width))
+ ((numberp max-width)
+ (- (* max-width char-width) window-extra-width))))
+ (min-width
+ (cond
+ ((numberp (nth 3 sizes))
+ (- (* (nth 3 sizes) char-width) window-extra-width))
+ ((numberp min-width)
+ (- (* min-width char-width) window-extra-width))))
+ ;; Note: Currently, for a new frame the sizes of the header
+ ;; and mode line may be estimated incorrectly
+ (value (window-text-pixel-size
+ nil t t workarea-width workarea-height t))
+ (width (+ (car value) (window-right-divider-width)))
+ (height (+ (cdr value) (window-bottom-divider-width)))
+ remainder)
+ (unless window-resize-pixelwise
+ ;; Round sizes to character sizes.
+ (setq remainder (% width char-width))
+ (unless (zerop remainder)
+ (setq width (+ width (- char-width remainder))))
+ (setq remainder (% height char-height))
+ (setq height (+ height (- char-height remainder))))
+ ;; Now make sure that we don't get larger than our rounded
+ ;; maximum lines and columns.
+ (when (> width fit-width)
+ (setq width (- fit-width (% fit-width char-width))))
+ (when (> height fit-height)
+ (setq height (- fit-height (% fit-height char-height))))
+ ;; Don't change height or width when the window's size is fixed
+ ;; in either direction.
(cond
- ((not min-height)
- (setq min-height frame-min-height))
- ((numberp min-height)
- (setq min-height (min min-height frame-min-height)))
- (t
- (error "%s is an invalid minimum height" min-height)))
- ;; When tool-bar-mode is enabled and we have just created a new
- ;; frame, reserve lines for toolbar resizing. This is needed
- ;; because for reasons unknown to me Emacs (1) reserves one line
- ;; for the toolbar when making the initial frame and toolbars
- ;; are enabled, and (2) later adds the remaining lines needed.
- ;; Our code runs IN BETWEEN (1) and (2). YMMV when you're on a
- ;; system that behaves differently.
- (let ((quit-restore (window-parameter root 'quit-restore))
- (lines (tool-bar-lines-needed frame)))
- (when (and quit-restore (eq (car quit-restore) 'frame)
- (not (zerop lines)))
- (setq compensate (1- lines))))
- (message "%s" compensate)
- (setq delta
- ;; Always count a final newline - we don't do any
- ;; post-processing, so let's play safe.
- (+ (count-screen-lines nil nil t)
- (- (window-body-size))
- compensate)))
- ;; Move away from final newline.
- (when (and (eobp) (bolp) (not (bobp)))
- (set-window-point root (line-beginning-position 0)))
- (set-window-start root (point-min))
- (set-window-vscroll root 0)
- (condition-case nil
- (set-frame-height
- frame
- (min (max (+ (frame-height frame) delta)
- min-height)
- max-height))
- (error (setq delta nil))))
- delta))
-
-(defun fit-window-to-buffer (&optional window max-height min-height)
- "Adjust height of WINDOW to display its buffer's contents exactly.
+ ((eq window-size-fixed 'height)
+ (setq height nil))
+ ((eq window-size-fixed 'width)
+ (setq height nil)))
+ (when width
+ ;; Fit to maximum and minimum widths.
+ (when max-width
+ (setq width (min width max-width)))
+ (when min-width
+ (setq width (max width min-width)))
+ ;; Add extra width.
+ (setq width (+ width extra-width))
+ ;; Preserve right margin.
+ (let ((right (+ left width extra-width))
+ (max-right (- workarea-width right-margin)))
+ (cond
+ ((> right max-right)
+ ;; Move FRAME to left.
+ (setq left (max 0 (- left (- right max-right)))))
+ ((< left left-margin)
+ ;; Move frame to right.
+ (setq left left-margin)))))
+ (when height
+ ;; Fit to maximum and minimum heights.
+ (when max-height
+ (setq height (min height max-height)))
+ (when min-height
+ (setq height (max height min-height)))
+ ;; Add extra height.
+ (setq height (+ height extra-height))
+ ;; Preserve bottom and top margins.
+ (let ((bottom (+ top height extra-height))
+ (max-bottom (- workarea-height bottom-margin)))
+ (cond
+ ((> bottom max-bottom)
+ ;; Move FRAME to left.
+ (setq top (max 0 (- top (- bottom max-bottom)))))
+ ((< top top-margin)
+ ;; Move frame down.
+ (setq top top-margin)))))
+ ;; Apply changes.
+ (set-frame-position frame left top)
+ ;; Clumsily try to translate our calculations to what
+ ;; `set-frame-size' wants.
+ (when width
+ (setq width (- (+ (frame-text-width) width)
+ extra-width window-body-width)))
+ (when height
+ (setq height (- (+ (frame-text-height) height)
+ extra-height window-height)))
+ (set-frame-size
+ frame
+ (if width
+ (if window-resize-pixelwise
+ width
+ (/ width char-width))
+ (frame-text-width))
+ (if height
+ (if window-resize-pixelwise
+ height
+ (/ height char-height))
+ (frame-text-height))
+ window-resize-pixelwise)))))
+
+(defun fit-window-to-buffer (&optional window max-height min-height max-width min-width)
+ "Adjust size of WINDOW to display its buffer's contents exactly.
WINDOW must be a live window and defaults to the selected one.
-Optional argument MAX-HEIGHT specifies the maximum height of
-WINDOW and defaults to the height of WINDOW's frame. Optional
-argument MIN-HEIGHT specifies the minimum height of WINDOW and
-defaults to `window-min-height'. Both MAX-HEIGHT and MIN-HEIGHT
-are specified in lines and include the mode line and header line,
-if any.
-
-If WINDOW is a full height window, then if the option
-`fit-frame-to-buffer' is non-nil, this calls the function
-`fit-frame-to-buffer' to adjust the frame height.
-
-Return the number of lines by which WINDOW was enlarged or
-shrunk. If an error occurs during resizing, return nil but don't
-signal an error.
+If WINDOW is part of a vertical combination, adjust WINDOW's
+height. The new height is calculated from the number of lines of
+the accessible portion of its buffer. The optional argument
+MAX-HEIGHT specifies a maximum height and defaults to the height
+of WINDOW's frame. The optional argument MIN-HEIGHT specifies a
+minimum height and defaults to `window-min-height'. Both
+MAX-HEIGHT and MIN-HEIGHT are specified in lines and include the
+mode line and header line, if any.
+
+If WINDOW is part of a horizontal combination and the value of
+the option `fit-window-to-buffer-horizontally' is non-nil, adjust
+WINDOW's height. The new width of WINDOW is calculated from the
+maximum length of its buffer's lines that follow the current
+start position of WINDOW. The optional argument MAX-WIDTH
+specifies a maximum width and defaults to the width of WINDOW's
+frame. The optional argument MIN-WIDTH specifies a minimum width
+and defaults to `window-min-width'. Both MAX-WIDTH and MIN-WIDTH
+are specified in columns and include fringes, margins and
+scrollbars, if any.
+
+Fit pixelwise if the option `window-resize-pixelwise' is non-nil.
+If WINDOW is its frame's root window, then if the option
+`fit-frame-to-buffer' is non-nil, call `fit-frame-to-buffer' to
+adjust the frame's size.
Note that even if this function makes WINDOW large enough to show
-_all_ lines of its buffer you might not see the first lines when
-WINDOW was scrolled."
+_all_ parts of its buffer you might not see the first part when
+WINDOW was scrolled. If WINDOW is resized horizontally, you will
+not see the top of its buffer unless WINDOW starts at its minimum
+accessible position."
(interactive)
(setq window (window-normalize-window window t))
- (cond
- ((window-size-fixed-p window))
- ((window-full-height-p window)
- (when fit-frame-to-buffer
- (fit-frame-to-buffer (window-frame window))))
- (t
+ (if (eq window (frame-root-window window))
+ (when fit-frame-to-buffer
+ ;; Fit WINDOW's frame to buffer.
+ (fit-frame-to-buffer
+ (window-frame window)
+ max-height min-height max-width min-width))
(with-selected-window window
- (let* ((height (window-total-size))
+ (let* ((pixelwise window-resize-pixelwise)
+ (frame (window-frame))
+ (char-height (frame-char-height))
+ (char-width (frame-char-width))
+ (display-height (display-pixel-height))
+ (total-height (window-size window nil pixelwise))
+ (body-height (window-body-height window pixelwise))
+ (body-width (window-body-width window pixelwise))
(min-height
- ;; Adjust MIN-HEIGHT.
+ ;; Sanitize MIN-HEIGHT.
(if (numberp min-height)
;; Can't get smaller than `window-safe-min-height'.
- (max min-height window-safe-min-height)
+ (max (if pixelwise
+ (* char-height min-height)
+ min-height)
+ (if pixelwise
+ (window-safe-min-pixel-height window)
+ window-safe-min-height))
;; Preserve header and mode line if present.
- (window-min-size nil nil t)))
+ (window-min-size nil nil t pixelwise)))
(max-height
- ;; Adjust MAX-HEIGHT.
+ ;; Sanitize MAX-HEIGHT.
(if (numberp max-height)
- ;; Can't get larger than height of frame.
- (min max-height
- (window-total-size (frame-root-window window)))
- ;; Don't delete other windows.
- (+ height (window-max-delta nil nil window))))
- ;; Make `desired-height' the height necessary to show
- ;; all of WINDOW's buffer, constrained by MIN-HEIGHT
- ;; and MAX-HEIGHT.
- (desired-height
- (max
- (min
- (+ (count-screen-lines)
- ;; For non-minibuffers count the mode line, if any.
- (if (and (not (window-minibuffer-p window))
- mode-line-format)
- 1
- 0)
- ;; Count the header line, if any.
- (if header-line-format 1 0))
- max-height)
- min-height))
- (desired-delta
- (- desired-height (window-total-size window)))
- (delta
- (if (> desired-delta 0)
- (min desired-delta
- (window-max-delta window nil window))
- (max desired-delta
- (- (window-min-delta window nil window))))))
- (condition-case nil
- (if (zerop delta)
- ;; Return zero if DELTA became zero in the process.
- 0
- ;; Don't try to redisplay with the cursor at the end on its
- ;; own line--that would force a scroll and spoil things.
- (when (and (eobp) (bolp) (not (bobp)))
- ;; It's silly to put `point' at the end of the previous
- ;; line and so maybe force horizontal scrolling.
- (set-window-point window (line-beginning-position 0)))
- ;; Call `window-resize' with OVERRIDE argument equal WINDOW.
- (window-resize window delta nil window)
- ;; Check if the last line is surely fully visible. If
- ;; not, enlarge the window.
- (let ((end (save-excursion
- (goto-char (point-max))
- (when (and (bolp) (not (bobp)))
- ;; Don't include final newline.
- (backward-char 1))
- (when truncate-lines
- ;; If line-wrapping is turned off, test the
- ;; beginning of the last line for
- ;; visibility instead of the end, as the
- ;; end of the line could be invisible by
- ;; virtue of extending past the edge of the
- ;; window.
- (forward-line 0))
- (point))))
- (set-window-vscroll window 0)
- ;; This loop might in some rare pathological cases raise
- ;; an error - another reason for the `condition-case'.
- (while (and (< desired-height max-height)
- (= desired-height (window-total-size))
- (not (pos-visible-in-window-p end)))
- (window-resize window 1 nil window)
- (setq desired-height (1+ desired-height)))))
- (error (setq delta nil)))
- delta)))))
+ (min
+ (+ total-height
+ (window-max-delta
+ window nil nil nil nil nil pixelwise))
+ (if pixelwise
+ (* char-height max-height)
+ max-height))
+ (+ total-height (window-max-delta
+ window nil nil nil nil nil pixelwise))))
+ height)
+ (cond
+ ;; If WINDOW is vertically combined, try to resize it
+ ;; vertically.
+ ((and (not (eq fit-window-to-buffer-horizontally 'only))
+ (not (window-size-fixed-p window))
+ (window-combined-p))
+ ;; Vertically we always want to fit the entire buffer.
+ ;; WINDOW'S height can't get larger than its frame's pixel
+ ;; height. Its width remains fixed.
+ (setq height (+ (cdr (window-text-pixel-size
+ nil nil t nil (frame-pixel-height) t))
+ (window-bottom-divider-width)))
+ ;; Round height.
+ (unless pixelwise
+ (setq height (+ (/ height char-height)
+ (if (zerop (% height char-height)) 0 1))))
+ (unless (= height total-height)
+ (window-resize-no-error
+ window
+ (- (max min-height (min max-height height)) total-height)
+ nil window pixelwise)))
+ ;; If WINDOW is horizontally combined, try to resize it
+ ;; horizontally.
+ ((and fit-window-to-buffer-horizontally
+ (not (window-size-fixed-p window t))
+ (window-combined-p nil t))
+ (let* ((display-width (display-pixel-width))
+ (total-width (window-size window nil pixelwise))
+ (min-width
+ ;; Sanitize MIN-WIDTH.
+ (if (numberp min-width)
+ ;; Can't get smaller than `window-safe-min-width'.
+ (max (if pixelwise
+ (* char-width min-width)
+ min-width)
+ (if pixelwise
+ (window-safe-min-pixel-width)
+ window-safe-min-width))
+ ;; Preserve fringes, margins, scrollbars if present.
+ (window-min-size nil nil t pixelwise)))
+ (max-width
+ ;; Sanitize MAX-WIDTH.
+ (if (numberp max-width)
+ (min (+ total-width
+ (window-max-delta
+ nil t nil nil nil nil pixelwise))
+ (if pixelwise
+ (* char-width max-width)
+ max-width))
+ (+ total-width (window-max-delta
+ nil t nil nil nil nil pixelwise))))
+ ;; When fitting vertically, assume that WINDOW's start
+ ;; position remains unaltered. WINDOW can't get wider
+ ;; than its frame's pixel width, its height remains
+ ;; unaltered.
+ (width (+ (car (window-text-pixel-size
+ nil (window-start) (point-max)
+ (frame-pixel-width)
+ ;; Add one char-height to assure that
+ ;; we're on the safe side. This
+ ;; overshoots when the first line below
+ ;; the bottom is wider than the window.
+ (* body-height
+ (if pixelwise char-height 1))))
+ (window-right-divider-width))))
+ (unless pixelwise
+ (setq width (+ (/ width char-width)
+ (if (zerop (% width char-width)) 0 1))))
+ (unless (= width body-width)
+ (window-resize-no-error
+ window
+ (- (max min-width
+ (min max-width
+ (+ total-width (- width body-width))))
+ total-width)
+ t window pixelwise)))))))))
(defun window-safely-shrinkable-p (&optional window)
"Return t if WINDOW can be shrunk without shrinking other windows.
@@ -6365,7 +7168,7 @@ Return non-nil if the window was shrunk, nil otherwise."
;; should be taken care of by `fit-window-to-buffer'.
(when (and (window-combined-p window)
(pos-visible-in-window-p (point-min) window))
- (fit-window-to-buffer window (window-total-size window))))
+ (fit-window-to-buffer window (window-total-height window))))
(defun kill-buffer-and-window ()
"Kill the current buffer and delete the selected window."
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog
index e4ab1a91cac..27bf65db84b 100644
--- a/lwlib/ChangeLog
+++ b/lwlib/ChangeLog
@@ -396,7 +396,7 @@
Add eventhandler for expose to expose_cb. Remove creation of xft_draw.
(create_pixmap_for_menu): New function.
(remap_menubar): Pop down menus that aren't the same as in old_stack.
- Set width, heigh, x, y on widget with XtVaSetValues.
+ Set width, height, x, y on widget with XtVaSetValues.
Call create_pixmap_for_menu.
Replace XUnmapWindow with XtPopdown.
Remowe two last parameters to display_menu.
diff --git a/make-dist b/make-dist
index fe4f5ccbdf3..fc87ea7ec63 100755
--- a/make-dist
+++ b/make-dist
@@ -201,13 +201,11 @@ fi
if [ $check = yes ]; then
ls -1 lisp/[a-zA-Z]*.el lisp/[a-z]*/[a-zA-Z0-9]*.el \
lisp/[a-z]*/[a-z]*/[a-zA-Z0-9]*.el \
- lisp/[a-z]*/[a-z]*/[a-z]*/[a-zA-Z0-9]*.el \
- leim/[a-z]*/[a-z]*.el > /tmp/el
+ lisp/[a-z]*/[a-z]*/[a-z]*/[a-zA-Z0-9]*.el > /tmp/el
ls -1 lisp/[a-zA-Z]*.elc lisp/[a-z]*/[a-zA-Z0-9]*.elc \
lisp/[a-z]*/[a-z]*/[a-zA-Z0-9]*.elc \
- lisp/[a-z]*/[a-z]*/[a-z]*/[a-zA-Z0-9]*.elc \
- leim/[a-z]*/[a-z]*.elc > /tmp/elc
+ lisp/[a-z]*/[a-z]*/[a-z]*/[a-zA-Z0-9]*.elc > /tmp/elc
## Check for .elc files with no corresponding .el file.
sed 's/\.el$/.elc/' /tmp/el > /tmp/elelc
@@ -262,7 +260,7 @@ if [ $update = yes ]; then
(cd leim && make leim-list.el EMACS="$EMACS")
echo "Recompiling Lisp files"
- $EMACS -batch -f batch-byte-recompile-directory lisp leim
+ $EMACS -batch -f batch-byte-recompile-directory lisp
fi # $update = yes
echo "Creating staging directory: \`${tempparent}'"
@@ -291,8 +289,7 @@ ln aclocal.m4 ${tempdir}
echo "Creating subdirectories"
for subdir in site-lisp \
- leim leim/CXTERM-DIC leim/MISC-DIC \
- leim/SKK-DIC leim/ja-dic leim/quail \
+ leim leim/CXTERM-DIC leim/MISC-DIC leim/SKK-DIC \
build-aux build-aux/snippet \
src src/bitmaps lib lib-src oldXMenu lwlib \
nt nt/inc nt/inc/sys nt/inc/arpa nt/inc/netinet nt/icons \
@@ -340,20 +337,12 @@ echo "Making links to \`leim' and its subdirectories"
ln CXTERM-DIC/README CXTERM-DIC/*.tit ../${tempdir}/leim/CXTERM-DIC
ln SKK-DIC/README SKK-DIC/SKK-JISYO.L ../${tempdir}/leim/SKK-DIC
ln MISC-DIC/README MISC-DIC/*.* ../${tempdir}/leim/MISC-DIC
- ln ja-dic/*.el ja-dic/*.elc ../${tempdir}/leim/ja-dic
ln Makefile.in ../${tempdir}/leim/Makefile.in
- ln leim-ext.el ../${tempdir}/leim/leim-ext.el
- ## Lisp files that start with a capital (also 4Corner.el) are
- ## generated from TIT dictionaries so we don't distribute them.
- ln quail/[a-z]*.el quail/[a-z]*.elc ../${tempdir}/leim/quail
- rm -f ../${tempdir}/leim/quail/quick-b5.*
- rm -f ../${tempdir}/leim/quail/quick-cns.*
- rm -f ../${tempdir}/leim/quail/tsang-b5.*
- rm -f ../${tempdir}/leim/quail/tsang-cns.*)
+ ln leim-ext.el ../${tempdir}/leim/leim-ext.el)
echo "Making links to \`build-aux'"
(cd build-aux
- ln compile config.guess config.sub depcomp ../${tempdir}/build-aux
+ ln compile config.guess config.sub depcomp msys-to-w32 ../${tempdir}/build-aux
ln install-sh missing move-if-change update-subdirs ../${tempdir}/build-aux)
echo "Making links to \`build-aux/snippet'"
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 1b766f0f349..3e9f7683b63 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,14 @@
+2013-11-27 Glenn Morris <rgm@gnu.org>
+
+ * README.W32:
+ * addpm.c (env_vars):
+ * epaths.nt (PATH_LOADSEARCH, PATH_DUMPLOADSEARCH):
+ * paths.h (PATH_LOADSEARCH): No more leim directory.
+
+2013-11-26 Glenn Morris <rgm@gnu.org>
+
+ * epaths.nt (PATH_DUMPLOADSEARCH): Add leim/.
+
2013-11-12 Dani Moncayo <dmoncayo@gmail.com>
* msysconfig.sh: Remove.
diff --git a/nt/README.W32 b/nt/README.W32
index d81a308ae05..2b546428c6b 100644
--- a/nt/README.W32
+++ b/nt/README.W32
@@ -20,8 +20,8 @@ See the end of the file for license conditions.
* Preliminaries
- Along with this file should be six subdirectories (bin, etc, info,
- lisp, leim, site-lisp). If you have downloaded the barebin
+ Along with this file should be five subdirectories (bin, etc, info,
+ lisp, site-lisp). If you have downloaded the barebin
distribution, then it will contain only the bin directory and the
built in documentation in etc/DOC, the rest of the subdirectories
are in the src distribution, which the barebin distribution is
diff --git a/nt/addpm.c b/nt/addpm.c
index 48c77821c8c..6669109de43 100644
--- a/nt/addpm.c
+++ b/nt/addpm.c
@@ -82,7 +82,7 @@ env_vars[] =
{
#ifdef OLD_PATHS
{"emacs_dir", NULL},
- {"EMACSLOADPATH", "%emacs_dir%/site-lisp;%emacs_dir%/../site-lisp;%emacs_dir%/lisp;%emacs_dir%/leim"},
+ {"EMACSLOADPATH", "%emacs_dir%/site-lisp;%emacs_dir%/../site-lisp;%emacs_dir%/lisp"},
{"SHELL", "%emacs_dir%/bin/cmdproxy.exe"},
{"EMACSDATA", "%emacs_dir%/etc"},
{"EMACSPATH", "%emacs_dir%/bin"},
diff --git a/nt/epaths.nt b/nt/epaths.nt
index 6e297476528..033ba889b95 100644
--- a/nt/epaths.nt
+++ b/nt/epaths.nt
@@ -12,8 +12,7 @@
the host system (e.g., i686-pc-mingw32), and @SRC@ by the root of
the Emacs source tree used to build Emacs. */
/*
-Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software
-Foundation, Inc.
+Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -35,10 +34,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
load-path, which is the search path for the Lisp function "load".
Configure (using "make epaths-force") sets this to
${standardlisppath}, which typically has a value like:
- <datadir>/emacs/VERSION/lisp:<datadir>/emacs/VERSION/leim
- where datadir is eg /usr/local/share.
+ <datadir>/emacs/VERSION/lisp where datadir is eg /usr/local/share.
*/
-#define PATH_LOADSEARCH "%emacs_dir%/share/emacs/@VER@/lisp;%emacs_dir%/share/emacs/@VER@/leim"
+#define PATH_LOADSEARCH "%emacs_dir%/share/emacs/@VER@/lisp"
/* Like PATH_LOADSEARCH, but contains the non-standard pieces.
These are the site-lisp directories. Configure sets this to
@@ -51,7 +49,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define PATH_SITELOADSEARCH "%emacs_dir%/share/emacs/@VER@/site-lisp;%emacs_dir%/share/emacs/site-lisp"
/* Like PATH_LOADSEARCH, but used only during the build process
- when Emacs is dumping. Configure (using "make epaths-force") sets
+ when Emacs is dumping. Configure (using "make epaths-force-w32") sets
this to $buildlisppath, which normally has the value: <srcdir>/lisp.
*/
#define PATH_DUMPLOADSEARCH "@SRC@/lisp"
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index 3691b303b80..bcccebc13a0 100644
--- a/nt/inc/ms-w32.h
+++ b/nt/inc/ms-w32.h
@@ -159,9 +159,6 @@ extern char *getenv ();
# ifndef HAVE_WINDOW_SYSTEM
# define HAVE_WINDOW_SYSTEM 1
# endif
-# ifndef HAVE_MENUS
-# define HAVE_MENUS 1
-# endif
#endif
/* Get some redefinitions in place. */
@@ -179,7 +176,7 @@ extern char *getenv ();
extern struct tm * sys_localtime (const time_t *);
/* MinGW64 uses a 2-argument _setjmp, and setjmp is a macro defined to
supply the 2nd arg correctly, so don't use _setjmp directly in that
- case. */
+ case. */
#undef HAVE__SETJMP
#endif
diff --git a/nt/paths.h b/nt/paths.h
index e3fc3f1e8ab..e701cdd41ee 100644
--- a/nt/paths.h
+++ b/nt/paths.h
@@ -1,7 +1,6 @@
/* paths.h file for MS Windows
-Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software
-Foundation, Inc.
+Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -26,7 +25,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* The default search path for Lisp function "load".
Together with PATH_SITELOADSEARCH, this sets load-path. */
/* #define PATH_LOADSEARCH "/usr/local/lib/emacs/lisp" */
-#define PATH_LOADSEARCH "%emacs_dir%/lisp;%emacs_dir%/leim"
+#define PATH_LOADSEARCH "%emacs_dir%/lisp"
/* Like PATH_LOADSEARCH, but contains the non-standard pieces. */
#define PATH_SITELOADSEARCH "%emacs_dir%/site-lisp;%emacs_dir%/../site-lisp"
diff --git a/src/.gdbinit b/src/.gdbinit
index 1bfc293c466..275a1d8db88 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -67,7 +67,7 @@ define xgettype
else
set $bugfix = $arg0
end
- set $type = (enum Lisp_Type) (USE_LSB_TAG ? $bugfix & (1 << GCTYPEBITS) - 1 : $bugfix >> VALBITS)
+ set $type = (enum Lisp_Type) (USE_LSB_TAG ? $bugfix & (1 << GCTYPEBITS) - 1 : (EMACS_UINT) $bugfix >> VALBITS)
end
# Set up something to print out s-expressions.
diff --git a/src/ChangeLog b/src/ChangeLog
index a2dfa5bf613..e67fdada36f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,10 +1,766 @@
+2013-12-07 Jan Djärv <jan.h.d@swipnet.se>
+
+ Pixel resize changes for NS (Bug#16049).
+ * nsterm.m (x_set_window_size): Change parameters rows/cols to
+ height/width. row/cols are locals.
+ Pass pixelwise to check_frame_size. Don't set FRAME_PIXEL_WIDTH/HEIGHT.
+ (updateFrameSize:): Remove gsextra. Adjust for pixelwise resize.
+ (windowWillResize): Remove gsextra. Calculate extra as in
+ updateFrameSize.
+ (x_new_font): Don't change frame size if fullscreen. Change
+ size pixelwise.
+
+ * nsfns.m (Fx_create_frame): Call change_frame_size twice as per
+ comment in xfns.c. Change to pixelwise call.
+
+2013-12-06 Eli Zaretskii <eliz@gnu.org>
+
+ * buffer.c (Fset_buffer_multibyte): Invalidate buffer caches.
+ (Bug#16070)
+
+2013-12-06 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * xterm.c (input_signal_count): Remove.
+ (x_dispatch_event): Define unconditionally.
+ (x_make_frame_visible): Process X events until the frame
+ is really visible (Bug#16027).
+ * xterm.h (x_dispatch_event): Declare unconditionally.
+
+2013-12-05 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsfns.m (ns_frame_parm_handlers): Add right/bottom_divider_width.
+
+ * nsterm.m (x_set_window_size): Handle pixelwise.
+
+2013-12-05 Martin Rudalics <rudalics@gmx.at>
+
+ * w32term.c (x_new_font):
+ * xterm.c (x_new_font): Calculate new frame size from new font
+ size (Bug#16028).
+
+2013-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * lisp.h (FOR_EACH_TAIL): New macro.
+ * fns.c (Fdelq): Use it to avoid inf-loops; remove QUIT.
+
+ * window.c (select_window): Call second wset_redisplay before we change
+ selected_window (bug#16034).
+
+2013-12-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bidi.c (LRM_CHAR, RLM_CHAR): Remove; no longer used.
+
+2013-12-04 Eli Zaretskii <eliz@gnu.org>
+
+ * w32xfns.c: Include window.h, to avoid a compiler warning.
+
+2013-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * window.c (window_scroll): Mark window for redisplay (bug#16034).
+ (scroll_command, Fscroll_other_window): Don't cause redisplay now that
+ window_scroll takes care of it.
+ (Fset_window_point, Fdelete_other_windows_internal)
+ (set_window_buffer, Fwindow_resize_apply, resize_frame_windows)
+ (Fsplit_window_internal, Fdelete_window_internal)
+ (Fresize_mini_window_internal, Fset_window_configuration)
+ (apply_window_adjustment): Use fset_redisplay and wset_redisplay to
+ cause redisplay instead of forcing a complete redisplay.
+ * xdisp.c (wset_redisplay): Don't set windows_or_buffers_changed if
+ we're only affecting the selected_window.
+
+2013-12-04 Eli Zaretskii <eliz@gnu.org>
+
+ * bidi.c (bidi_get_type, bidi_get_category): Handle the isolate
+ directional control characters. Update type and category
+ determination according to the UBA from Unicode v6.3.
+ (bidi_category_t): New category EXPLICIT_FORMATTING.
+
+ * dispextern.h (bidi_type_t): Update to include new bidirectional
+ properties introduced with Unicode v6.3. (Bug#16043)
+
+2013-12-04 Martin Rudalics <rudalics@gmx.at>
+
+ * xterm.c (XTflash): Fix coordinate of bottom area to flash
+ (Bug#16044).
+
+2013-12-04 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * font.c (font_list_entities): Remove dummy assignment.
+ * font.h (struct font) [HAVE_WINDOW_SYSTEM]: Group members which are
+ used on graphic displays only. Remove unused 'font_encoder' member.
+ (struct font_bitmap): Remove unused 'extra' member.
+ * nsfont.m (nsfont_open):
+ * w32font.c (w32font_open_internal):
+ * ftfont.c (ftfont_get_bitmap): Adjust users.
+
+2013-12-03 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use bool for boolean.
+ * tparam.c (tparam1):
+ * undo.c (record_point, record_property_change):
+ Use bool for boolean, for local vars that are always true or false.
+
+ Minor integer overflow fixes (Bug#16033).
+ * window.c (Fset_window_new_pixel): Don't let new_pixel go negative.
+ This improves on the previous fix to this function.
+ (window_resize_check): When summing up pixel counts, don't rely on
+ undefined behavior if the sum overflows.
+
+2013-12-03 Martin Rudalics <rudalics@gmx.at>
+
+ * window.c (Fset_window_new_pixel): Don't choke at negative
+ argument value (Bug#16033).
+
+ * xfns.c (Fx_create_frame): Add another call to change_frame_size
+ to avoid crash in window_box_height.
+
+ * gtkutil.h: Fix external declaration of xg_frame_set_char_size.
+ * gtkutil.c (xg_frame_set_char_size, style_changed_cb): Fix size
+ calculation.
+ * xterm.c (x_set_window_size): Fix size calculation (Bug#16013).
+
+2013-12-03 Paul Eggert <eggert@cs.ucla.edu>
+
+ Minor integer overflow fixes.
+ * window.c (Fset_window_new_pixel, grow_mini_window):
+ * xdisp.c (Fwindow_text_pixel_size):
+ Avoid undefined behavior on signed integer overflow.
+ * xfns.c (x_set_mouse_color):
+ Check that drag shape fits in 'unsigned', since that's what X wants.
+
+2013-12-02 Eli Zaretskii <eliz@gnu.org>
+
+ Improve reporting of fatal exception on MS-Windows.
+ * w32fns.c (my_exception_handler): New function.
+ (globals_of_w32fns): Set it up as the unhandled exception
+ handler. Initialize exception code and address to zeros.
+ (emacs_abort): If the exception code and address are available,
+ print them at the beginning of the backtrace. Fix the format of
+ printing addresses (was producing 0x0x12345678 on XP).
+ (Bug#15994)
+
+2013-12-02 Helmut Eller <eller.helmut@gmail.com>
+
+ * eval.c (Fbacktrace__locals): New function.
+ (syms_of_eval): Defsubr it.
+
+2013-12-02 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * font.h (FONT_WIDTH, FONT_HEIGHT, FONT_BASE, FONT_DESCENT):
+ Define here to unify between...
+ * nsterm.h, w32term.h, xterm.h: ...port-specific headers.
+ * w32term.h (CHECK_W32_FRAME): Remove unused macro.
+
+2013-12-02 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * xterm.h (struct scroll_bar): Remove member `fringe_extended_p'.
+
+ * xterm.c (x_draw_fringe_bitmap, x_scroll_run): Remove code for
+ fringe background extension.
+ (x_scroll_bar_create): Remove variables `sb_left' and `sb_width',
+ because they are now always the same as `left' and `width',
+ respectively. Remove code for the case that `width' and
+ `sb_width' are different.
+
+2013-12-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix minor problems found by static checking.
+ * dispextern.h, xdisp.c (x_draw_bottom_divider): Now static.
+ * frame.c (set_frame_param) [!HAVE_NTGUI]: Remove.
+ * xdisp.c (Ftool_bar_height) [USE_GTK || HAVE_NS]: Now const function.
+
+2013-12-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * image.c (imagemagick_compute_animated_image): Don't crash if we
+ have an animation with different-sized images (bug#15313).
+
+2013-11-30 Martin Rudalics <rudalics@gmx.at>
+
+ Remove some unused items introduced during pixelwise change.
+ * window.c (window_resize_total_check): Remove unused function.
+ * xdisp.c (remember_mouse_glyph): Remove unused label.
+ (Ftool_bar_height): Move declaration inside #if.
+ * xterm.c (x_set_window_size): Don't use r and c.
+
+2013-11-30 Juanma Barranquero <lekktu@gmail.com>
+
+ * xdisp.c (Fwindow_text_pixel_size): Remove unused variables
+ `value' and `endp'.
+
+ * window.c (Fset_window_configuration): Comment out unused variables.
+
+ * w32term.c (w32_read_socket): Remove unused variable `buf'.
+
+2013-11-30 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xdisp.c (redisplay_internal): unrequest_sigio => request_sigio.
+
+ * xfaces.c (NEAR_SAME_COLOR_THRESHOLD): Move inside HAVE_WINDOW_SYSTEM.
+
+ * gnutls.c (gnutls_audit_log_function): Only declare and define if
+ HAVE_GNUTLS3 (Bug#16001).
+
+ * xdisp.c (redisplay_internal): Call request_sigio at end_of_redisplay
+ if interrupts are deferred (Bug#15801).
+
+2013-11-30 Martin Rudalics <rudalics@gmx.at>
+
+ Support resizing frames and windows pixelwise.
+ * dispextern.h (enum window_part): Add ON_SCROLL_BAR,
+ ON_RIGHT_DIVIDER and ON_BOTTOM_DIVIDER.
+ (struct glyph_matrix): Replace window_left_col and
+ window_top_line by window_pixel_left and window_pixel_top.
+ (WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P): Minor
+ rewrite.
+ (enum face_id): Add WINDOW_DIVIDER_FACE_ID.
+ (draw_window_divider, move_it_to, x_draw_right_divider)
+ (x_draw_bottom_divider, change_frame_size): Add or fix
+ declarations.
+ * dispnew.c (change_frame_size_1): Change prototype.
+ (adjust_glyph_matrix, required_matrix_width)
+ (adjust_frame_glyphs_for_window_redisplay): Use pixel
+ values instead of lines and columns.
+ (marginal_area_string): Use WINDOW_FRINGES_WIDTH instead of
+ WINDOW_TOTAL_FRINGE_WIDTH.
+ (handle_window_change_signal, do_pending_window_change)
+ (init_display): Adjusts calls of change_frame_size.
+ (change_frame_size, change_frame_size_1): Handle pixelwise
+ changes.
+ * frame.c (Qright_divider_width, Qbottom_divider_width): New
+ Lisp objects.
+ (set_menu_bar_lines_1, set_menu_bar_lines, make_frame)
+ (make_terminal_frame, Fmake_terminal_frame, Fframe_parameters)
+ (x_set_internal_border_width, x_set_vertical_scroll_bars)
+ (x_set_scroll_bar_width, x_figure_window_size): Handle pixel
+ values.
+ (set_frame_param): New function.
+ (Fframe_text_cols, Fframe_text_lines, Fframe_total_cols)
+ (Fframe_text_width, Fframe_text_height, Fscroll_bar_width)
+ (Ffringe_width, Fborder_width, Fright_divider_width)
+ (Fbottom_divider_width): New functions, defsubr them.
+ (Fset_frame_height, Fset_frame_width, Fset_frame_size): New
+ argument pixelwise.
+ (struct frame_parm_table): New members Qright_divider_width and
+ Qbottom_divider_width.
+ (x_set_frame_parameters): Handle parameters for pixelwise sizes.
+ (x_report_frame_params): Handle Qright_divider_width and
+ Qbottom_divider_width.
+ (x_set_right_divider_width, x_set_bottom_divider_width): New
+ functions.
+ (frame_resize_pixelwise): New option.
+ * frame.h (struct frame): Add tool_bar_height, menu_bar_height,
+ new_pixelwise, right_divider_width and bottom_divider_width;
+ remove total_lines; rename text_lines, text_cols, new_text_lines
+ and new_text_cols to text_height, text_width, new_height and
+ new_width respectively.
+ (FRAME_LINES, FRAME_COLS): Rename to FRAME_TEXT_HEIGHT and
+ FRAME_TEXT_WIDTH respectively.
+ (FRAME_MENU_BAR_HEIGHT, FRAME_TOOL_BAR_HEIGHT)
+ (FRAME_RIGHT_DIVIDER_WIDTH, FRAME_BOTTOM_DIVIDER_WIDTH)
+ (FRAME_TEXT_TO_PIXEL_WIDTH, FRAME_PIXEL_TO_TEXT_WIDTH): New
+ macros.
+ (FRAME_TOP_MARGIN_HEIGHT, FRAME_LEFT_SCROLL_BAR_AREA_WIDTH)
+ (FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH, FRAME_SCROLL_BAR_AREA_WIDTH)
+ (SET_FRAME_COLS, SET_FRAME_WIDTH, SET_FRAME_HEIGHT)
+ (FRAME_TEXT_COLS_TO_PIXEL_WIDTH, FRAME_PIXEL_WIDTH_TO_TEXT_COLS)
+ (FRAME_TEXT_COLS_TO_PIXEL_WIDTH): Rewrite macros.
+ (FRAME_TOTAL_COLS_ARG): Remove macro.
+ * fringe.c (draw_fringe_bitmap_1): Handle right divder.
+ * gtkutil.c (xg_frame_resized, xg_frame_set_char_size)
+ (x_wm_set_size_hint): Handle frame pixel sizes.
+ * indent.c (compute_motion, Fcompute_motion): Call
+ window_body_width instead of window_body_cols.
+ * keyboard.c (Qright_divider, Qbottom_divider): New symbols.
+ (make_lispy_position): Handle right and bottom dividers.
+ (Fsuspend_emacs): Pixelize call of change_frame_size.
+ * keyboard.h: Extern Qright_divider, Qbottom_divider.
+ * lisp.h: Extern set_frame_param.
+ * nsfns.m (x_set_tool_bar_lines): Pixelize call of
+ x_set_window_size.
+ (Fx_create_frame): Add entry for vertical_drag_cursor. Pixelize
+ call of change_frame_size.
+ * nsterm.h (struct ns_output): Add vertical_drag_cursor.
+ * nsterm.m (ns_update_window_end): Optionally draw right
+ divider.
+ (x_set_window_size): Add argument pixelwise. Call
+ check_frame_size and change_frame_size with pixelwise zero.
+ (ns_draw_window_divider): New function.
+ (ns_redisplay_interface): Add ns_draw_window_divider.
+ (updateFrameSize:): Call change_frame_size with pixelwise zero.
+ (x_new_font): Call x_set_window_size with pixelwise zero.
+ * print.c (print_object): For a window print its sequence
+ number again.
+ * term.c (Fresume_tty): Pixelize call of change_frame_size.
+ * w32fns.c (x_set_mouse_color): Handle vertical drag cursor.
+ (x_set_menu_bar_lines, x_set_tool_bar_lines): Calculate pixelwise.
+ (w32_createwindow): Use scroll bar area width.
+ (w32_wnd_proc): Handle bottom divider width. For
+ WM_WINDOWPOSCHANGING return zero if we resize pixelwise.
+ (Fx_create_frame): Default divider width parameters. Caclulate
+ sizes pixelwise. Add vertical drag cursor support.
+ (x_create_tip_frame): Default divider widths to zero. Pixelize
+ call to change_frame_size.
+ (Fx_show_tip): Add handling of divider widths. Pixelize window
+ position and sizes.
+ (Fw32_frame_rect): New function.
+ (frame_parm_handler w32_frame_parm_handlers): Add divider
+ widths.
+ (Vx_window_vertical_drag_shape): Add variable.
+ * w32inevt.c (resize_event, maybe_generate_resize_event):
+ Pixelize change_frame_size calls.
+ * w32menu.c (set_frame_menubar): Pixelize x_set_window_size
+ call.
+ * w32term.c (w32_draw_window_divider): New function.
+ (x_update_window_end): Handle right divider.
+ (w32_draw_fringe_bitmap, x_scroll_run)
+ (w32_set_vertical_scroll_bar): Pixelize scrollbar widths.
+ (w32_read_socket): Handle SIZE_MAXIMIZED separately. Calculate
+ new frame sizes pixelwise.
+ (x_new_font): Pixelize call to x_set_window_size.
+ (x_check_fullscreen): Pixelize call to change_frame_size.
+ (x_set_window_size_1, x_set_window_size): New argument
+ pixelwise. Calculate pixelwise.
+ (x_wm_set_size_hint): Use scroll bar area width.
+ (w32_redisplay_interface): Add w32_draw_window_divider.
+ * w32term.h (struct w32_output): Add vertical drag cursor.
+ * widget.c (set_frame_size, update_wm_hints)
+ (EmacsFrameResize, EmacsFrameSetValues): Pixelize calls of
+ change_frame_size.
+ (EmacsFrameSetCharSize): Pixelize call of x_set_window_size.
+ * window.c (sequence_number): Restore.
+ (Fwindow_pixel_width, Fwindow_pixel_height)
+ (Fwindow_mode_line_height, Fwindow_header_line_height)
+ (window_pixel_to_total, Frun_window_scroll_functions)
+ (Fset_window_new_pixel, window_resize_apply_total)
+ (Fwindow_resize_apply_total): New functions.
+ (window_body_height, window_body_width): Rename from
+ window_body_lines. New argument PIXELWISE. Calculate
+ pixelwise.
+ (Fwindow_body_height, Fwindow_body_width): New argument
+ PIXELWISE.
+ (coordinates_in_window, window_relative_x_coord): Use window's
+ pixel width instead of total width.
+ (replace_window, recombine_windows): Initialize pixel values.
+ (resize_root_window, resize_frame_windows, grow_mini_window)
+ (shrink_mini_window): New argument PIXELWISE. Calculate
+ pixelwise.
+ (Fdelete_other_windows_internal, adjust_window_margins)
+ (window_resize_check, window_resize_apply)
+ (Fdelete_window_internal, Fresize_mini_window_internal)
+ (Fwindow_text_width, Fwindow_text_height): Calculate pixelwise.
+ (check_frame_size): Rename arguments. New argument PIXELWISE.
+ Calculate pixelwise.
+ (set_window_buffer): Make samebuf bool. Run configuration change
+ hook only if buffer changed.
+ (Fset_window_buffer): Rewrite doc-string.
+ (make_window): Initialize new_pixel slot.
+ (Fwindow_resize_apply): Check pixel size of root window.
+ (Fsplit_window_internal): Call 2nd argument pixel_size.
+ Calculate pixelwise.
+ (Fscroll_left, Fscroll_right): Call window_body_width instead of
+ window_body_cols.
+ (save_window_data): New slots frame_text_width,
+ frame_text_height, frame_menu_bar_height, frame_tool_bar_height.
+ (saved_window): New slots pixel_left, pixel_top, pixel_height,
+ pixel_width.
+ (Fcurrent_window_configuration, Fset_window_configuration)
+ (save_window_save, compare_window_configurations): Handle new
+ slots in save_window_data and saved_window.
+ (Fset_window_scroll_bars): Fix doc-string.
+ (window_resize_pixelwise): New variable.
+ (coordinates_in_window, Fcoordinates_in_window_p): Handle
+ dividers.
+ (make_parent_window): Adjust sequence_number.
+ (Fwindow_right_divider_width, Fwindow_bottom_divider_width): New
+ functions.
+ * window.h (struct window): New members new_pixel, pixel_left,
+ pixel_top, pixel_width, pixel_height. Restore sequence_number.
+ (wset_new_pixel): New function.
+ (WINDOW_PIXEL_WIDTH, WINDOW_PIXEL_HEIGHT)
+ (MIN_SAFE_WINDOW_PIXEL_WIDTH, MIN_SAFE_WINDOW_PIXEL_HEIGHT)
+ (WINDOW_LEFT_PIXEL_EDGE, WINDOW_RIGHT_PIXEL_EDGE)
+ (WINDOW_TOP_PIXEL_EDGE, WINDOW_BOTTOM_PIXEL_EDGE)
+ (WINDOW_BOTTOMMOST_P, WINDOW_BOX_LEFT_PIXEL_EDGE)
+ (WINDOW_BOX_RIGHT_PIXEL_EDGE, WINDOW_MARGINS_COLS)
+ (WINDOW_MARGINS_WIDTH, WINDOW_RIGHT_DIVIDER_WIDTH)
+ (WINDOW_BOTTOM_DIVIDER_WIDTH): New macros.
+ (WINDOW_TOTAL_FRINGE_WIDTH): Rename to WINDOW_FRINGES_WIDTH.
+ (WINDOW_TOTAL_WIDTH, WINDOW_TOTAL_HEIGHT): Remove macros.
+ (WINDOW_RIGHT_EDGE_X, WINDOW_LEFT_EDGE_X, WINDOW_TOP_EDGE_Y)
+ (WINDOW_BOTTOM_EDGE_Y, WINDOW_FULL_WIDTH_P, WINDOW_LEFTMOST_P)
+ (WINDOW_RIGHTMOST_P, WINDOW_BOX_LEFT_EDGE_X)
+ (WINDOW_BOX_RIGHT_EDGE_X, WINDOW_FRINGE_COLS)
+ (WINDOW_BOX_HEIGHT_NO_MODE_LINE, WINDOW_BOX_TEXT_HEIGHT):
+ Rewrite.
+ (resize_frame_windows, grow_mini_window, shrink_mini_window)
+ (window_body_width, check_frame_size): Adapt external declarations.
+ * xdisp.c (last_max_ascent): New integer.
+ (window_text_bottom_y): Handle bottom divider.
+ (window_box_width, window_box_height): Calculate pixelwise.
+ (get_glyph_string_clip_rects): Handle right divider.
+ (remember_mouse_glyph): When windows are resized pixelwise
+ proceed with width and height set to 1.
+ (init_iterator): Use WINDOW_PIXEL_WIDTH instead of
+ WINDOW_TOTAL_WIDTH.
+ (move_it_to): Calculate and return maximum x position
+ encountered.
+ (Fwindow_text_pixel_size): New function.
+ (resize_mini_window, update_tool_bar): Calculate pixelwise.
+ (tool_bar_lines_needed): Rename to tool_bar_height. Calculate
+ pixelwise.
+ (Ftool_bar_lines_needed): Rename to Ftool_bar_height. Calculate
+ pixelwise.
+ (redisplay_tool_bar): Calculate pixelwise.
+ (redisplay_window): Calculate pixelwise. Handle dividers.
+ (draw_glyphs, x_clear_end_of_line, note_mouse_highlight)
+ (x_draw_vertical_border): Handle dividers.
+ (define_frame_cursor1): Handle vertical drag cursor.
+ (x_draw_right_divider, x_draw_bottom_divider): New functions.
+ (expose_window): Calculate pixelwise. Handle dividers.
+ (init_xdisp): Initialize pixel values.
+ * xfaces.c (Qwindow_divider): New face.
+ (realize_basic_faces): Realize it.
+ * xfns.c (x_set_mouse_color): Handle vertical_drag_cursor.
+ (x_set_menu_bar_lines, x_set_tool_bar_lines): Calculate pixelwise.
+ (x_set_scroll_bar_default_width): Default actual width to 16.
+ (Fx_create_frame): Set sizes pixelwise.
+ (x_create_tip_frame): Default divider widths to zero. Pixelize
+ call of change_frame_size.
+ (Fx_show_tip): Handle divider widths. Initial pixel position
+ and sizes.
+ (frame_parm_handler x_frame_parm_handlers): Add divider widths.
+ (Vx_window_vertical_drag_shape): New option.
+ * xmenu.c (free_frame_menubar): Pixelize call of
+ x_set_window_size.
+ * xterm.c (x_draw_window_divider): New function.
+ (x_update_window_end): Optionally draw right divider.
+ (x_draw_fringe_bitmap, x_scroll_run, x_scroll_bar_create)
+ (XTset_vertical_scroll_bar): Use scroll bar pixel width.
+ (handle_one_xevent, x_new_font): Calculate pixelwise.
+ (x_set_window_size_1, x_set_window_size): New argument
+ pixelwise. Calculate pixelwise.
+ (x_wm_set_size_hint): Pixelize call of check_frame_size.
+ (struct x_redisplay_interface): Add x_draw_window_divider.
+ * xterm.h (struct x_output): Add vertical_drag_cursor.
+
+2013-11-30 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xdisp.c (redisplay_internal): Don't call set_window_update_flags.
+ Set invisible frames's `redisplay' when a full redisplay is requested.
+ (redisplay_window): Set must_be_updated_p instead (bug#15999).
+ (redisplay_mode_lines): Don't set must_be_updated_p any more.
+ (display_mode_lines): Set it here instead.
+
+ * dispnew.c (set_window_update_flags): Remove `b' argument; make static.
+
+ * dispextern.h (set_window_update_flags): Remove.
+
+2013-11-29 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * fns.c (internal_equal): Add a hash_table argument to handle cycles.
+
+ * xdisp.c (REDISPLAY_SOME_P): New macro.
+ (redisplay_internal): Use it (bug#15999).
+ (prepare_menu_bars, redisplay_window): Use it as well.
+
+ * lisp.mk (lisp): Add electric.elc and uniquify.elc.
+
+2013-11-29 Tom Seddon <emacs@tomseddon.plus.com> (tiny change)
+
+ * w32font.c (g_b_init_get_char_width_32_w): New static var.
+ (globals_of_w32font): Zero it out.
+ (GetCharWidth32W_Proc): New function pointer.
+ (get_char_width_32_w): New function.
+ (compute_metrics): If get_glyph_outline_w returns an error, try
+ get_char_width_32_w before declaring a failure. This avoids
+ punishing raster (a.k.a. "bitmap") fonts by slowing down
+ redisplay. (Bug#6364).
+
+2013-11-29 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (clear_mouse_face): Don't invalidate the entire
+ mouse-highlight info, just signal frame_up_to_date_hook that mouse
+ highlight needs to be redisplayed. (Bug#15913)
+
+2013-11-29 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix minor problems found by static checking.
+ * buffer.h (struct buffer_text, struct buffer):
+ * frame.h (struct frame):
+ * window.h (struct window):
+ Avoid 'bool foo : 1;', as it's not portable to pre-C99 compilers,
+ as described in ../lib/stdbool.in.h. Use 'unsigned foo : 1;' instead.
+ * menu.c (syms_of_menu): Define x-popup-dialog, removing a
+ no-longer-valid use of HAVE_MENUS.
+ * xdisp.c (propagate_buffer_redisplay): Now static.
+
+2013-11-29 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xmenu.c (Fmenu_or_popup_active_p):
+ * window.c (Fset_window_configuration):
+ * menu.c (Fx_popup_menu, Fx_popup_dialog):
+ * keyboard.c (record_menu_key, read_char_x_menu_prompt):
+ * fns.c (Fyes_or_no_p):
+ * editfns.c (Fmessage_box, Fmessage_or_box):
+ * alloc.c (make_save_ptr_ptr):
+ * xdisp.c, w32menu.c, term.c, xterm.h, xterm.c: Remove HAVE_MENUS.
+
+ * window.c (Fset_window_configuration): Move select_window later.
+
+2013-11-28 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Refine redisplay optimizations to only redisplay *some* frames/windows
+ rather than all of them.
+ * xdisp.c (REDISPLAY_SOME): New constant.
+ (redisplay_other_windows, wset_redisplay, fset_redisplay)
+ (bset_redisplay, bset_update_mode_line): New functions.
+ (message_dolog): Use bset_redisplay.
+ (clear_garbaged_frames): Use fset_redisplay.
+ (echo_area_display): Use wset_redisplay.
+ (buffer_shared_and_changed): Remove.
+ (prepare_menu_bars): Call Vpre_redisplay_function before updating
+ frame titles. Compute the actual set of windows redisplayed.
+ Don't update frame titles and menu bars for frames that don't need to
+ be redisplayed.
+ (propagate_buffer_redisplay): New function.
+ (AINC): New macro.
+ (redisplay_internal): Use it. Be more selective in the set of windows
+ we redisplay. Propagate windows_or_buffers_changed to
+ update_mode_lines a bit later to simplify the code.
+ (mark_window_display_accurate_1): Reset window and buffer's
+ `redisplay' flag.
+ (redisplay_window): Do nothing if neither the window nor the buffer nor
+ the frame needs redisplay.
+ * window.h (struct window): Add `redisplay' field.
+ (wset_redisplay, fset_redisplay, bset_redisplay, bset_update_mode_line)
+ (redisplay_other_windows, window_list): New declarations.
+ * window.c (select_window, Fset_window_start): Use wset_redisplay.
+ (window_list): Not static any more.
+ (grow_mini_window, shrink_mini_window): Use fset_redisplay.
+ * minibuf.c (read_minibuf_unwind): Don't redisplay everything.
+ * insdel.c (prepare_to_modify_buffer_1): Use bset_redisplay.
+ * frame.c (Fmake_frame_visible): Don't redisplay everything.
+ * frame.h (struct frame): Add `redisplay' field.
+ Move `external_menu_bar' bitfield next to other bit-fields.
+ (SET_FRAME_GARBAGED): Use fset_redisplay.
+ (SET_FRAME_VISIBLE): Don't garbage the frame;
+ Use redisplay_other_windows.
+ * buffer.h (struct buffer): Add `redisplay' field.
+ * buffer.c (Fforce_mode_line_update): Pay attention to the `all' flag.
+ (modify_overlay): Use bset_redisplay.
+ * alloc.c (gc_sweep): Don't unmark strings while sweeping symbols.
+
+2013-11-28 Eli Zaretskii <eliz@gnu.org>
+
+ Support w32 file notifications in batch mode.
+ * w32proc.c (sys_select): Don't wait on interrupt_handle if it is
+ invalid (which happens in batch mode). If non-interactive, call
+ handle_file_notifications to store file notification events in the
+ input queue. (Bug#15933)
+
+ * w32notify.c (send_notifications): Handle FRAME_INITIAL frames as well.
+
+ * w32inevt.c (handle_file_notifications): Now external, not static.
+
+ * w32term.h (handle_file_notifications): Provide prototype.
+
+ * emacs.c (main) [HAVE_W32NOTIFY]: When non-interactive, call
+ init_crit, since init_display, which does that otherwise, is not
+ called.
+
+2013-11-27 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in ($(lispsource)/international/charprop.el): New.
+ (emacs$(EXEEXT)): Depend on charprop.el.
+
+2013-11-27 Eli Zaretskii <eliz@gnu.org>
+
+ * fileio.c (Finsert_file_contents): Invalidate buffer caches when
+ deleting portions of the buffer under non-nil REPLACE argument.
+ (Bug#15973)
+
+ * w32notify.c (Fw32notify_add_watch): If the argument FILE is a
+ directory, watch it and not its parent.
+ (add_watch): Allow empty string in FILE.
+
+2013-11-27 Martin Rudalics <rudalics@gmx.at>
+
+ * window.c (Fset_window_start, window_resize_apply)
+ (window_scroll): Reset window_end_valid (Bug#15957).
+
+2013-11-27 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (leimdir): Now in lisp source directory.
+ ($(leimdir)/leim-list.el): Just use ../leim .
+ * epaths.in (PATH_DUMPLOADSEARCH):
+ * lread.c (load_path_default):
+ * nsterm.m (ns_load_path): No more leim directory.
+
+2013-11-26 Andreas Schwab <schwab@suse.de>
+
+ * .gdbinit (xgettype): Add cast.
+
+2013-11-26 Glenn Morris <rgm@gnu.org>
+
+ Preload leim-list.el.
+ * epaths.in (PATH_DUMPLOADSEARCH): Add leim/.
+ * callproc.c (init_callproc): Don't assume PATH_DUMPLOADSEARCH
+ is a single directory.
+
+2013-11-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ bool-vector-subsetp is now the normal direction (Bug#15912).
+ * data.c (Fbool_vector_subsetp): Test whether the first argument
+ is a subset of the second one, not the reverse. Add doc string.
+
+ Fix minor problems found by static checking.
+ * lread.c (load_path_default): Now static.
+ * textprop.c (text_property_stickiness): Be consistent about the
+ test used when deciding whether to consider the previous character.
+ This simplifies the code a bit.
+
+2013-11-25 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * textprop.c (text_property_stickiness): Fix front-stickiness at BOB.
+
+ * frame.c (Fhandle_focus_in, Fhandle_focus_out): Move to frame.el.
+ (syms_of_frame): Don't defsubr them.
+
+2013-11-25 Glenn Morris <rgm@gnu.org>
+
+ * lread.c (load_path_default): Change the sense of the argument.
+ (init_lread): When EMACSLOADPATH is set, do not ignore changes
+ from dump_path. When it is not, avoid checking dump_path twice.
+
+ * lread.c (init_lread): Fix 2013-11-23 goof that was checking
+ uninstalled dump_path against installed Vload_path. (Bug#15964)
+
+2013-11-24 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Export get_pos_property to Elisp.
+ * editfns.c (Fget_pos_property): Rename from get_pos_property.
+ (syms_of_editfns): Export it to Elisp.
+
+ * data.c (Fmake_variable_buffer_local): Mention `permanent-local'.
+
+2013-11-23 Romain Francoise <romain@orebokech.com>
+
+ * fileio.c (init_fileio): Move `write_region_inhibit_fsync'
+ initialization here ...
+ (syms_of_fileio): ... from here.
+
+2013-11-23 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * lread.c (init_lread): Fix int/Lisp_Object mixup.
+ Please use --enable-check-lisp-object-type.
+
+2013-11-23 Glenn Morris <rgm@gnu.org>
+
+ * process.c (get_process): Explicit error for dead buffers.
+
+2013-11-23 Andreas Schwab <schwab@linux-m68k.org>
+
+ * process.c (get_process): Check that OBJ is a live buffer. (Bug#15923)
+
+2013-11-23 Glenn Morris <rgm@gnu.org>
+
+ Empty elements in EMACSLOADPATH stand for the default. (Bug#12100)
+ * lread.c (load_path_check): Take path to check as argument.
+ (load_path_default): New, split from init_lread.
+ (init_lread): Move calc of default load-path to load_path_default.
+ Empty elements in EMACSLOADPATH now stand for the default.
+ (load-path): Doc fix.
+ * emacs.c (decode_env_path): Add option to treat empty elements
+ as nil rather than ".".
+ * callproc.c (init_callproc_1, init_callproc):
+ * image.c (Vx_bitmap_file_path):
+ * lisp.h (decode_env_path):
+ * lread.c (Vsource_directory):
+ Update for new argument spec of decode_env_path.
+
+2013-11-22 Eli Zaretskii <eliz@gnu.org>
+
+ * bidi.c (bidi_find_paragraph_start): Limit the returned positions
+ to BEGV_BYTE..ZV_BYTE range. (Bug#15951)
+
+2013-11-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix some dependency problems that cause unnecessary recompiles.
+ Problem reported by RMS in
+ <http://lists.gnu.org/archive/html/emacs-devel/2013-11/msg00421.html>.
+ * Makefile.in (OLDXMENU_TARGET, OLDXMENU, OLDXMENU_DEPS)
+ (really-lwlib, really-oldXMenu, stamp-oldxmenu)
+ (../src/$(OLDXMENU), $(OLDXMENU)): Remove.
+ (temacs$(EXEEXT)): Depend on $(LIBXMENU), not stamp-oldxmenu.
+ ($(lwlibdir)/liblw.a, $(oldXMenudir)/libXMenu11.a, FORCE): New targets.
+ (boostrap-clean): No need to remove stamp-oldxmenu.
+
+ Fix recently introduced bool vector overrun.
+ This was due to an optimization that went awry.
+ Reported by Glenn Morris in
+ <http://lists.gnu.org/archive/html/emacs-devel/2013-11/msg00622.html>.
+ * alloc.c (make_uninit_bool_vector): Don't allocate a dummy word
+ for empty vectors, undoing the 2013-11-18 change.
+ * data.c (bool_vector_binop_driver): Rely on this.
+ Fix bug that occasionally overran the destination.
+ * lisp.h (struct Lisp_Bool_vector): Document this.
+
+2013-11-20 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsterm.m (init, run, stop:): Enable again. stop calls super stop
+ to handle dialogs.
+
+ * nsterm.m (init, run, stop:): Comment out for now, does not work
+ with dialogs.
+
+2013-11-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ * charset.c (syms_of_charset): Don't read past end of string.
+
+2013-11-19 Glenn Morris <rgm@gnu.org>
+
+ * frame.c (Fhandle_focus_in, Fhandle_focus_out): Doc fixes.
+
+2013-11-19 Brian Jenkins <brian@brianjenkins.org> (tiny change)
+
+ Add hooks to run on gaining/losing focus. (Bug#15029)
+ * frame.c (Qfocus_in_hook, Qfocus_out_hook): New static lisp objects.
+ (Fhandle_focus_in, Fhandle_focus_out): Run focus hooks.
+ (syms_of_frame): Add focus-in-hook, focus-out-hook.
+
+2013-11-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data.c (bool_vector_binop_driver): Rename locals for sanity's sake.
+ The old names predated the API change that put destination at end.
+
+ Improve API of recently-added bool vector functions (Bug#15912).
+ The old API had (bool-vector-count-matches A B)
+ and (bool-vector-count-matches-at A B I), which gave the
+ misleading impression that the two functions were variants, one
+ with a location I. The new API has (bool-vector-count-population A)
+ and (bool-vector-count-consecutive A B I) to make the distinction
+ clearer. The first function no longer has a B argument, since the
+ caller can easily determine the number of nils if the length and
+ number of ts is known.
+ * data.c (Fbool_vector_count_population): Rename from
+ bool_vector_count_matches, and accept just 1 argument.
+ (Fbool_vector_count_consecutive): Rename from
+ Fbool_vector_count_matches_at.
+
+ Always allocate at least one bits_word per bool vector.
+ See Daniel Colascione in:
+ http://lists.gnu.org/archive/html/emacs-devel/2013-11/msg00518.html
+ * alloc.c (make_uninit_bool_vector): Always allocate at least one word.
+ * data.c (bool_vector_binop_driver): Rely on this. Tune.
+ * lisp.h (struct Lisp_Bool_vector): Document this.
+
2013-11-18 Eli Zaretskii <eliz@gnu.org>
* insdel.c (invalidate_buffer_caches): New function, consolidated
from part of prepare_to_modify_buffer.
(insert_from_gap, prepare_to_modify_buffer):
- * coding.c (code_convert_region, code_convert_string): Call
- invalidate_buffer_caches. (Bug#15841)
+ * coding.c (code_convert_region, code_convert_string):
+ Call invalidate_buffer_caches. (Bug#15841)
* lisp.h (invalidate_buffer_caches): Add prototype.
@@ -141,7 +897,7 @@
"dumb loop", adjust C pointers into buffer text to follow suit.
(Bug#15841)
-2013-11-09 Łukasz Stelmach <stlman@poczta.fm> (tiny change)
+2013-11-09 Łukasz Stelmach <stlman@poczta.fm> (tiny change)
* gtkutil.c (xg_check_special_colors): Use rgb: instead of rgbi:
for conversion (Bug#15837).
diff --git a/src/ChangeLog.12 b/src/ChangeLog.12
index b14ce20ede3..02940840eaa 100644
--- a/src/ChangeLog.12
+++ b/src/ChangeLog.12
@@ -2840,7 +2840,7 @@
2012-11-19 Daniel Colascione <dancol@dancol.org>
* w32fns.c (Fx_file_dialog):
- (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
+ (Fx_file_dialog): Accommodate rename of cygwin_convert_path* to
cygwin_convert_file_name*.
* cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
diff --git a/src/Makefile.in b/src/Makefile.in
index ca0b25a2f69..7d91928acfe 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -52,7 +52,7 @@ lispsource = $(srcdir)/../lisp
lib = ../lib
libsrc = ../lib-src
etc = ../etc
-leimdir = ../leim
+leimdir = ${lispsource}/leim
oldXMenudir = ../oldXMenu
lwlibdir = ../lwlib
@@ -179,30 +179,8 @@ LIBXTR6=@LIBXTR6@
LIBXT_OTHER=@LIBXT_OTHER@
## If !HAVE_X11 || USE_GTK, empty.
-## Else if USE_X_TOOLKIT really-lwlib, else really-oldxmenu.
-OLDXMENU_TARGET=@OLDXMENU_TARGET@
-
-## If !HAVE_X11 || USE_GTK, empty.
## Else if USE_X_TOOLKIT, $(lwlibdir)/liblw.a.
## Else $(oldXMenudir)/libXMenu11.a.
-## (Actually, rather than being empty, it is set to "nothing".
-## It is never actually used for anything in this case.
-## This is done because there is a rule with target $(OLDXMENU) below,
-## and I think it might be a syntax error with some makes to have
-## an empty target, even if the associated rule is never run.
-## http://lists.gnu.org/archive/html/help-make/2010-05/msg00058.html
-## The alternative would be to put that rule in a makefile fragment.)
-OLDXMENU=@OLDXMENU@
-
-## If HAVE_X11 && !USE_GTK, $(OLDXMENU) ../src/$(OLDXMENU); else empty.
-## We use stamp-xmenu with these two deps to both ensure that lwlib
-## gets remade based on its dependencies in its own makefile,
-## and remake temacs if lwlib gets changed by this.
-OLDXMENU_DEPS=@OLDXMENU_DEPS@
-
-## If !HAVE_X11 && HAVE_X_WINDOWS, -lXMenu (this case no longer possible).
-## Else if !HAVE_X11 || USE_GTK, empty.
-## Else $(OLDXMENU).
LIBXMENU=@LIBXMENU@
## xmenu.o if HAVE_X_WINDOWS, else empty.
@@ -222,7 +200,7 @@ LIBXT=$(TOOLKIT_LIBW) $(LIBXT_OTHER)
## If HAVE_X11, $(LIBXT) $(LIBX_EXTRA), else empty.
LIBX_OTHER=@LIBX_OTHER@
-## LIBXMENU is nil if !HAVE_X_WINDOWS.
+## LIBXMENU is empty if !HAVE_X_WINDOWS.
## LD_SWITCH_X_SITE should not be used if not using X, but nothing
## sets it at present, and if something ever does, it should be
## configure, which should set it to nil in non-X builds.
@@ -437,7 +415,10 @@ all: emacs$(EXEEXT) $(OTHER_FILES)
.PHONY: all
$(leimdir)/leim-list.el: bootstrap-emacs$(EXEEXT)
- cd $(leimdir) && $(MAKE) $(MFLAGS) leim-list.el EMACS="$(bootstrap_exe)"
+ cd ../leim && $(MAKE) $(MFLAGS) leim-list.el EMACS="$(bootstrap_exe)"
+
+$(lispsource)/international/charprop.el: bootstrap-emacs$(EXEEXT)
+ cd ../admin/unidata && $(MAKE) $(MFLAGS) all EMACS="../$(bootstrap_exe)"
## The dumped Emacs is as functional and more efficient than
## bootstrap-emacs, so we replace the latter with the former.
@@ -445,7 +426,8 @@ $(leimdir)/leim-list.el: bootstrap-emacs$(EXEEXT)
## since not all pieces are used on all platforms. But DOC depends
## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here.
emacs$(EXEEXT): temacs$(EXEEXT) $(ADDSECTION) \
- $(etc)/DOC $(lisp) $(leimdir)/leim-list.el
+ $(etc)/DOC $(lisp) $(leimdir)/leim-list.el \
+ $(lispsource)/international/charprop.el
if test "$(CANNOT_DUMP)" = "yes"; then \
rm -f emacs$(EXEEXT); \
ln temacs$(EXEEXT) emacs$(EXEEXT); \
@@ -504,7 +486,7 @@ $(lib)/libgnu.a: $(config_h)
## existence when setting Vinstallation_directory (FIXME?).
## This goes on to affect various things, and the emacs binary fails
## to start if Vinstallation_directory has the wrong value.
-temacs$(EXEEXT): stamp-oldxmenu $(ALLOBJS) \
+temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) \
$(lib)/libgnu.a $(EMACSRES)
$(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
-o temacs $(ALLOBJS) $(lib)/libgnu.a $(W32_RES_LINK) $(LIBES)
@@ -514,29 +496,17 @@ temacs$(EXEEXT): stamp-oldxmenu $(ALLOBJS) \
test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
## The following oldxmenu-related rules are only (possibly) used if
-## HAVE_X11 && !USE_GTK, but there is no harm in always defining them
-## (provided we take a little care that OLDXMENU is never empty).
-really-lwlib: globals.h
- cd $(lwlibdir); $(MAKE) $(MFLAGS) \
- CC='$(CC)' CFLAGS='$(CFLAGS)' MAKE='$(MAKE)'
- @true # make -t should not create really-lwlib.
-.PHONY: really-lwlib
-
-really-oldXMenu:
- cd $(oldXMenudir); $(MAKE) $(MFLAGS) \
- CC='$(CC)' CFLAGS='$(CFLAGS)' MAKE='$(MAKE)'
- @true # make -t should not create really-oldXMenu.
-.PHONY: really-oldXMenu
-
-## We do not really need this when OLDXMENU_DEPS is empty, but as
-## things stand we need something to satisfy the temacs dependency.
-stamp-oldxmenu: $(OLDXMENU_DEPS)
- touch stamp-oldxmenu
-
-## Supply an ordering for parallel make.
-../src/$(OLDXMENU): $(OLDXMENU)
-
-$(OLDXMENU): $(OLDXMENU_TARGET)
+## HAVE_X11 && !USE_GTK, but there is no harm in always defining them.
+$(lwlibdir)/liblw.a: $(config_h) globals.h lisp.h FORCE
+ cd $(lwlibdir) && \
+ $(MAKE) $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' MAKE='$(MAKE)' \
+ liblw.a
+$(oldXMenudir)/libXMenu11.a: FORCE
+ cd $(oldXMenudir) && \
+ $(MAKE) $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' MAKE='$(MAKE)' \
+ libXMenu11.a
+FORCE:
+.PHONY: FORCE
../config.status: config.in epaths.in
@echo "The file ${?:.in=.h} needs to be set up from $?."
@@ -572,7 +542,7 @@ clean: mostlyclean
## It should remove all files generated during a compilation/bootstrap,
## but not things like config.status or TAGS.
bootstrap-clean: clean
- rm -f epaths.h config.h config.stamp stamp-h1 stamp-oldxmenu
+ rm -f epaths.h config.h config.stamp stamp-h1
if test -f ./.gdbinit; then \
mv ./.gdbinit ./.gdbinit.save; \
if test -f "$(srcdir)/.gdbinit"; then rm -f ./.gdbinit.save; \
diff --git a/src/alloc.c b/src/alloc.c
index f12fdc5c861..f076075a94f 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2066,20 +2066,20 @@ Lisp_Object
make_uninit_bool_vector (EMACS_INT nbits)
{
Lisp_Object val;
- struct Lisp_Bool_Vector *p;
- EMACS_INT word_bytes, needed_elements;
- word_bytes = bool_vector_words (nbits) * sizeof (bits_word);
- needed_elements = ((bool_header_size - header_size + word_bytes
- + word_size - 1)
- / word_size);
- p = (struct Lisp_Bool_Vector *) allocate_vector (needed_elements);
+ EMACS_INT words = bool_vector_words (nbits);
+ EMACS_INT word_bytes = words * sizeof (bits_word);
+ EMACS_INT needed_elements = ((bool_header_size - header_size + word_bytes
+ + word_size - 1)
+ / word_size);
+ struct Lisp_Bool_Vector *p
+ = (struct Lisp_Bool_Vector *) allocate_vector (needed_elements);
XSETVECTOR (val, p);
XSETPVECTYPESIZE (XVECTOR (val), PVEC_BOOL_VECTOR, 0, 0);
p->size = nbits;
/* Clear padding at the end. */
- if (nbits)
- p->data[bool_vector_words (nbits) - 1] = 0;
+ if (words)
+ p->data[words - 1] = 0;
return val;
}
@@ -3477,7 +3477,7 @@ make_save_ptr_int (void *a, ptrdiff_t b)
return val;
}
-#if defined HAVE_MENUS && ! (defined USE_X_TOOLKIT || defined USE_GTK)
+#if ! (defined USE_X_TOOLKIT || defined USE_GTK)
Lisp_Object
make_save_ptr_ptr (void *a, void *b)
{
@@ -4317,7 +4317,7 @@ live_buffer_p (struct mem_node *m, void *p)
void dump_zombies (void) EXTERNALLY_VISIBLE;
/* Array of objects that are kept alive because the C stack contains
- a pattern that looks like a reference to them . */
+ a pattern that looks like a reference to them. */
#define MAX_ZOMBIES 10
static Lisp_Object zombies[MAX_ZOMBIES];
@@ -6291,7 +6291,7 @@ survives_gc_p (Lisp_Object obj)
-/* Sweep: find all structures not marked, and free them. */
+/* Sweep: find all structures not marked, and free them. */
static void
gc_sweep (void)
@@ -6303,7 +6303,7 @@ gc_sweep (void)
sweep_strings ();
check_string_bytes (!noninteractive);
- /* Put all unmarked conses on free list */
+ /* Put all unmarked conses on free list. */
{
register struct cons_block *cblk;
struct cons_block **cprev = &cons_block;
@@ -6380,7 +6380,7 @@ gc_sweep (void)
total_free_conses = num_free;
}
- /* Put all unmarked floats on free list */
+ /* Put all unmarked floats on free list. */
{
register struct float_block *fblk;
struct float_block **fprev = &float_block;
@@ -6426,7 +6426,7 @@ gc_sweep (void)
total_free_floats = num_free;
}
- /* Put all unmarked intervals on free list */
+ /* Put all unmarked intervals on free list. */
{
register struct interval_block *iblk;
struct interval_block **iprev = &interval_block;
@@ -6475,7 +6475,7 @@ gc_sweep (void)
total_free_intervals = num_free;
}
- /* Put all unmarked symbols on free list */
+ /* Put all unmarked symbols on free list. */
{
register struct symbol_block *sblk;
struct symbol_block **sprev = &symbol_block;
@@ -6512,7 +6512,7 @@ gc_sweep (void)
{
++num_used;
if (!pure_p)
- UNMARK_STRING (XSTRING (sym->s.name));
+ eassert (!STRING_MARKED_P (XSTRING (sym->s.name)));
sym->s.gcmarkbit = 0;
}
}
diff --git a/src/bidi.c b/src/bidi.c
index dc905cd9e5f..18dce1931db 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -67,16 +67,15 @@ static bool bidi_initialized = 0;
static Lisp_Object bidi_type_table, bidi_mirror_table;
-#define LRM_CHAR 0x200E
-#define RLM_CHAR 0x200F
-#define BIDI_EOB -1
+#define BIDI_EOB (-1)
/* Data type for describing the bidirectional character categories. */
typedef enum {
UNKNOWN_BC,
NEUTRAL,
WEAK,
- STRONG
+ STRONG,
+ EXPLICIT_FORMATTING
} bidi_category_t;
/* UAX#9 says to search only for L, AL, or R types of characters, and
@@ -115,13 +114,9 @@ bidi_get_type (int ch, bidi_dir_t override)
if (default_type == UNKNOWN_BT)
emacs_abort ();
- if (override == NEUTRAL_DIR)
- return default_type;
-
switch (default_type)
{
- /* Although UAX#9 does not tell, it doesn't make sense to
- override NEUTRAL_B and LRM/RLM characters. */
+ case WEAK_BN:
case NEUTRAL_B:
case LRE:
case LRO:
@@ -129,20 +124,20 @@ bidi_get_type (int ch, bidi_dir_t override)
case RLO:
case PDF:
return default_type;
+ /* FIXME: The isolate controls are treated as BN until we add
+ support for UBA v6.3. */
+ case LRI:
+ case RLI:
+ case FSI:
+ case PDI:
+ return WEAK_BN;
default:
- switch (ch)
- {
- case LRM_CHAR:
- case RLM_CHAR:
- return default_type;
- default:
- if (override == L2R) /* X6 */
- return STRONG_L;
- else if (override == R2L)
- return STRONG_R;
- else
- emacs_abort (); /* can't happen: handled above */
- }
+ if (override == L2R)
+ return STRONG_L;
+ else if (override == R2L)
+ return STRONG_R;
+ else
+ return default_type;
}
}
@@ -163,12 +158,7 @@ bidi_get_category (bidi_type_t type)
case STRONG_L:
case STRONG_R:
case STRONG_AL:
- case LRE:
- case LRO:
- case RLE:
- case RLO:
return STRONG;
- case PDF: /* ??? really?? */
case WEAK_EN:
case WEAK_ES:
case WEAK_ET:
@@ -176,12 +166,30 @@ bidi_get_category (bidi_type_t type)
case WEAK_CS:
case WEAK_NSM:
case WEAK_BN:
+ /* FIXME */
+ case LRI:
+ case RLI:
+ case FSI:
+ case PDI:
return WEAK;
case NEUTRAL_B:
case NEUTRAL_S:
case NEUTRAL_WS:
case NEUTRAL_ON:
return NEUTRAL;
+ case LRE:
+ case LRO:
+ case RLE:
+ case RLO:
+ case PDF:
+#if 0
+ /* FIXME: This awaits implementation of isolate support. */
+ case LRI:
+ case RLI:
+ case FSI:
+ case PDI:
+#endif
+ return EXPLICIT_FORMATTING;
default:
emacs_abort ();
}
@@ -1148,6 +1156,9 @@ bidi_find_paragraph_start (ptrdiff_t pos, ptrdiff_t pos_byte)
pos = BEGV, pos_byte = BEGV_BYTE;
if (bpc)
know_region_cache (current_buffer, bpc, pos, oldpos);
+ /* Positions returned by the region cache are not limited to
+ BEGV..ZV range, so we limit them here. */
+ pos_byte = clip_to_bounds (BEGV_BYTE, pos_byte, ZV_BYTE);
return pos_byte;
}
diff --git a/src/blockinput.h b/src/blockinput.h
index 8f1b1e18985..6c69b01d3dd 100644
--- a/src/blockinput.h
+++ b/src/blockinput.h
@@ -59,7 +59,7 @@ extern void unblock_input (void);
extern void totally_unblock_input (void);
extern void unblock_input_to (int);
-/* In critical section ? */
+/* In critical section? */
INLINE bool
input_blocked_p (void)
diff --git a/src/buffer.c b/src/buffer.c
index 61b685ea5c5..e4a550fed95 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1336,10 +1336,16 @@ header lines. This function also forces recomputation of the
menu bar menus and the frame title. */)
(Lisp_Object all)
{
- if (!NILP (all) || buffer_window_count (current_buffer))
+ if (!NILP (all))
{
update_mode_lines = 10;
- current_buffer->prevent_redisplay_optimizations_p = 1;
+ /* FIXME: This can't be right. */
+ current_buffer->prevent_redisplay_optimizations_p = true;
+ }
+ else if (buffer_window_count (current_buffer))
+ {
+ bset_update_mode_line (current_buffer);
+ current_buffer->prevent_redisplay_optimizations_p = true;
}
return all;
}
@@ -2476,6 +2482,8 @@ current buffer is cleared. */)
if (narrowed)
error ("Changing multibyteness in a narrowed buffer");
+ invalidate_buffer_caches (current_buffer, BEGV, ZV);
+
if (NILP (flag))
{
ptrdiff_t pos, stop;
@@ -3895,17 +3903,7 @@ modify_overlay (struct buffer *buf, ptrdiff_t start, ptrdiff_t end)
BUF_COMPUTE_UNCHANGED (buf, start, end);
- /* If BUF is visible, consider updating the display if ... */
- if (buffer_window_count (buf) > 0)
- {
- /* ... it's visible in other window than selected, */
- if (buf != XBUFFER (XWINDOW (selected_window)->contents))
- windows_or_buffers_changed = 11;
- /* ... or if we modify an overlay at the end of the buffer
- and so we cannot be sure that window end is still valid. */
- else if (end >= ZV && start <= ZV)
- windows_or_buffers_changed = 12;
- }
+ bset_redisplay (buf);
++BUF_OVERLAY_MODIFF (buf);
}
diff --git a/src/buffer.h b/src/buffer.h
index d1a3e50d7cf..10d5fdc23e0 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -475,7 +475,10 @@ struct buffer_text
/* Usually 0. Temporarily set to 1 in decode_coding_gap to
prevent Fgarbage_collect from shrinking the gap and losing
not-yet-decoded bytes. */
- bool inhibit_shrinking;
+ unsigned inhibit_shrinking : 1;
+
+ /* True if it needs to be redisplayed. */
+ unsigned redisplay : 1;
};
/* Most code should use this macro to access Lisp fields in struct buffer. */
@@ -738,7 +741,7 @@ struct buffer
Lisp_Object INTERNAL_FIELD (cursor_in_non_selected_windows);
/* No more Lisp_Object beyond this point. Except undo_list,
- which is handled specially in Fgarbage_collect . */
+ which is handled specially in Fgarbage_collect. */
/* This structure holds the coordinates of the buffer contents
in ordinary buffers. In indirect buffers, this is not used. */
diff --git a/src/callproc.c b/src/callproc.c
index 2966711978b..b44f680b352 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -1,6 +1,6 @@
/* Synchronous subprocess invocation for GNU Emacs.
- Copyright (C) 1985-1988, 1993-1995, 1999-2013
- Free Software Foundation, Inc.
+
+Copyright (C) 1985-1988, 1993-1995, 1999-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -1520,14 +1520,14 @@ init_callproc_1 (void)
#ifdef HAVE_NS
etc_dir ? etc_dir :
#endif
- PATH_DATA);
+ PATH_DATA, 0);
Vdata_directory = Ffile_name_as_directory (Fcar (Vdata_directory));
Vdoc_directory = decode_env_path ("EMACSDOC",
#ifdef HAVE_NS
etc_dir ? etc_dir :
#endif
- PATH_DOC);
+ PATH_DOC, 0);
Vdoc_directory = Ffile_name_as_directory (Fcar (Vdoc_directory));
/* Check the EMACSPATH environment variable, defaulting to the
@@ -1536,10 +1536,10 @@ init_callproc_1 (void)
#ifdef HAVE_NS
path_exec ? path_exec :
#endif
- PATH_EXEC);
+ PATH_EXEC, 0);
Vexec_directory = Ffile_name_as_directory (Fcar (Vexec_path));
/* FIXME? For ns, path_exec should go at the front? */
- Vexec_path = nconc2 (decode_env_path ("PATH", ""), Vexec_path);
+ Vexec_path = nconc2 (decode_env_path ("PATH", "", 0), Vexec_path);
}
/* This is run after init_cmdargs, when Vinstallation_directory is valid. */
@@ -1580,9 +1580,9 @@ init_callproc (void)
#ifdef HAVE_NS
path_exec ? path_exec :
#endif
- PATH_EXEC);
+ PATH_EXEC, 0);
Vexec_path = Fcons (tem, Vexec_path);
- Vexec_path = nconc2 (decode_env_path ("PATH", ""), Vexec_path);
+ Vexec_path = nconc2 (decode_env_path ("PATH", "", 0), Vexec_path);
}
Vexec_directory = Ffile_name_as_directory (tem);
@@ -1606,24 +1606,17 @@ init_callproc (void)
source directory. */
if (data_dir == 0)
{
- Lisp_Object tem, tem1, tem2, srcdir;
-#ifdef WINDOWSNT
- /* PATH_DUMPLOADSEARCH is in ANSI codepage; convert to UTF-8. */
- char dumpload_dir[MAX_UTF8_PATH];
+ Lisp_Object tem, tem1, srcdir;
+ Lisp_Object lispdir = Fcar (decode_env_path (0, PATH_DUMPLOADSEARCH, 0));
- filename_from_ansi (PATH_DUMPLOADSEARCH, dumpload_dir);
- tem2 = build_unibyte_string (dumpload_dir);
-#else
- tem2 = build_unibyte_string (PATH_DUMPLOADSEARCH);
-#endif
+ srcdir = Fexpand_file_name (build_string ("../src/"), lispdir);
- srcdir = Fexpand_file_name (build_string ("../src/"), tem2);
tem = Fexpand_file_name (build_string ("GNU"), Vdata_directory);
tem1 = Ffile_exists_p (tem);
if (!NILP (Fequal (srcdir, Vinvocation_directory)) || NILP (tem1))
{
Lisp_Object newdir;
- newdir = Fexpand_file_name (build_string ("../etc/"), tem2);
+ newdir = Fexpand_file_name (build_string ("../etc/"), lispdir);
tem = Fexpand_file_name (build_string ("GNU"), newdir);
tem1 = Ffile_exists_p (tem);
if (!NILP (tem1))
diff --git a/src/charset.c b/src/charset.c
index 4a36f8059ae..2ef060228ee 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -2428,19 +2428,19 @@ the value may be a list of mnemonics. */);
Vcurrent_iso639_language = Qnil;
charset_ascii
- = define_charset_internal (Qascii, 1, "\x00\x7F\x00\x00\x00\x00",
+ = define_charset_internal (Qascii, 1, "\x00\x7F\0\0\0\0\0",
0, 127, 'B', -1, 0, 1, 0, 0);
charset_iso_8859_1
- = define_charset_internal (Qiso_8859_1, 1, "\x00\xFF\x00\x00\x00\x00",
+ = define_charset_internal (Qiso_8859_1, 1, "\x00\xFF\0\0\0\0\0",
0, 255, -1, -1, -1, 1, 0, 0);
charset_unicode
- = define_charset_internal (Qunicode, 3, "\x00\xFF\x00\xFF\x00\x10",
+ = define_charset_internal (Qunicode, 3, "\x00\xFF\x00\xFF\x00\x10\0",
0, MAX_UNICODE_CHAR, -1, 0, -1, 1, 0, 0);
charset_emacs
- = define_charset_internal (Qemacs, 3, "\x00\xFF\x00\xFF\x00\x3F",
+ = define_charset_internal (Qemacs, 3, "\x00\xFF\x00\xFF\x00\x3F\0",
0, MAX_5_BYTE_CHAR, -1, 0, -1, 1, 1, 0);
charset_eight_bit
- = define_charset_internal (Qeight_bit, 1, "\x80\xFF\x00\x00\x00\x00",
+ = define_charset_internal (Qeight_bit, 1, "\x80\xFF\0\0\0\0\0",
128, 255, -1, 0, -1, 0, 1,
MAX_5_BYTE_CHAR + 1);
charset_unibyte = charset_iso_8859_1;
diff --git a/src/charset.h b/src/charset.h
index 6e6a8891b4a..d5c41ec6f49 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -208,7 +208,7 @@ struct charset
unsigned min_code, max_code;
/* Offset value used by macros CODE_POINT_TO_INDEX and
- INDEX_TO_CODE_POINT. . */
+ INDEX_TO_CODE_POINT. */
unsigned char_index_offset;
/* Minimum and Maximum character codes of the charset. If the
diff --git a/src/chartab.c b/src/chartab.c
index 16dd85c12c0..2a8bbc6983a 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -1272,7 +1272,7 @@ uniprop_encode_value_run_length (Lisp_Object table, Lisp_Object value)
/* Encode VALUE as an element of char-table TABLE which adopts RUN-LENGTH
- compression and contains numbers as elements . */
+ compression and contains numbers as elements. */
static Lisp_Object
uniprop_encode_value_numeric (Lisp_Object table, Lisp_Object value)
diff --git a/src/composite.c b/src/composite.c
index 2ab5dbc9133..cef2ed86e57 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1191,7 +1191,7 @@ composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos,
/* Check if the character at CHARPOS (and BYTEPOS) is composed
(possibly with the following characters) on window W. ENDPOS limits
- characters to be composed. FACE, in non-NULL, is a base face of
+ characters to be composed. FACE, if non-NULL, is a base face of
the character. If STRING is not nil, it is a string containing the
character to check, and CHARPOS and BYTEPOS are indices in the
string. In that case, FACE must not be NULL.
diff --git a/src/data.c b/src/data.c
index d0171b5d758..1fe7a1c9b65 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1551,8 +1551,12 @@ Note that binding the variable with `let', or setting it while
a `let'-style binding made in this buffer is in effect,
does not make the variable buffer-local. Return VARIABLE.
-In most cases it is better to use `make-local-variable',
-which makes a variable local in just one buffer.
+This globally affects all uses of this variable, so it belongs together with
+the variable declaration, rather than with its uses (if you just want to make
+a variable local to the current buffer for one particular use, use
+`make-local-variable'). Buffer-local bindings are normally cleared
+while setting up a new major mode, unless they have a `permanent-local'
+property.
The function `default-value' gets the default value and `set-default' sets it. */)
(register Lisp_Object variable)
@@ -3018,64 +3022,103 @@ enum bool_vector_op { bool_vector_exclusive_or,
bool_vector_subsetp };
static Lisp_Object
-bool_vector_binop_driver (Lisp_Object op1,
- Lisp_Object op2,
+bool_vector_binop_driver (Lisp_Object a,
+ Lisp_Object b,
Lisp_Object dest,
enum bool_vector_op op)
{
EMACS_INT nr_bits;
- bits_word *adata, *bdata, *cdata;
- ptrdiff_t i;
- bool changed = 0;
- bits_word mword;
+ bits_word *adata, *bdata, *destdata;
+ ptrdiff_t i = 0;
ptrdiff_t nr_words;
- CHECK_BOOL_VECTOR (op1);
- CHECK_BOOL_VECTOR (op2);
+ CHECK_BOOL_VECTOR (a);
+ CHECK_BOOL_VECTOR (b);
- nr_bits = bool_vector_size (op1);
- if (bool_vector_size (op2) != nr_bits)
- wrong_length_argument (op1, op2, dest);
+ nr_bits = bool_vector_size (a);
+ if (bool_vector_size (b) != nr_bits)
+ wrong_length_argument (a, b, dest);
+
+ nr_words = bool_vector_words (nr_bits);
+ adata = bool_vector_data (a);
+ bdata = bool_vector_data (b);
if (NILP (dest))
{
dest = make_uninit_bool_vector (nr_bits);
- changed = 1;
+ destdata = bool_vector_data (dest);
}
else
{
CHECK_BOOL_VECTOR (dest);
+ destdata = bool_vector_data (dest);
if (bool_vector_size (dest) != nr_bits)
- wrong_length_argument (op1, op2, dest);
- }
+ wrong_length_argument (a, b, dest);
- nr_words = bool_vector_words (nr_bits);
+ switch (op)
+ {
+ case bool_vector_exclusive_or:
+ for (; i < nr_words; i++)
+ if (destdata[i] != (adata[i] ^ bdata[i]))
+ goto set_dest;
+ break;
+
+ case bool_vector_subsetp:
+ for (; i < nr_words; i++)
+ if (adata[i] &~ bdata[i])
+ return Qnil;
+ return Qt;
+
+ case bool_vector_union:
+ for (; i < nr_words; i++)
+ if (destdata[i] != (adata[i] | bdata[i]))
+ goto set_dest;
+ break;
+
+ case bool_vector_intersection:
+ for (; i < nr_words; i++)
+ if (destdata[i] != (adata[i] & bdata[i]))
+ goto set_dest;
+ break;
- adata = bool_vector_data (dest);
- bdata = bool_vector_data (op1);
- cdata = bool_vector_data (op2);
+ case bool_vector_set_difference:
+ for (; i < nr_words; i++)
+ if (destdata[i] != (adata[i] &~ bdata[i]))
+ goto set_dest;
+ break;
+ }
+
+ return Qnil;
+ }
- for (i = 0; i < nr_words; i++)
+ set_dest:
+ switch (op)
{
- if (op == bool_vector_exclusive_or)
- mword = bdata[i] ^ cdata[i];
- else if (op == bool_vector_union || op == bool_vector_subsetp)
- mword = bdata[i] | cdata[i];
- else if (op == bool_vector_intersection)
- mword = bdata[i] & cdata[i];
- else if (op == bool_vector_set_difference)
- mword = bdata[i] &~ cdata[i];
- else
- abort ();
+ case bool_vector_exclusive_or:
+ for (; i < nr_words; i++)
+ destdata[i] = adata[i] ^ bdata[i];
+ break;
- if (! changed)
- changed = adata[i] != mword;
+ case bool_vector_union:
+ for (; i < nr_words; i++)
+ destdata[i] = adata[i] | bdata[i];
+ break;
- if (op != bool_vector_subsetp)
- adata[i] = mword;
+ case bool_vector_intersection:
+ for (; i < nr_words; i++)
+ destdata[i] = adata[i] & bdata[i];
+ break;
+
+ case bool_vector_set_difference:
+ for (; i < nr_words; i++)
+ destdata[i] = adata[i] &~ bdata[i];
+ break;
+
+ default:
+ eassume (0);
}
- return changed ? dest : Qnil;
+ return dest;
}
/* PRECONDITION must be true. Return VALUE. This odd construction
@@ -3199,11 +3242,11 @@ Return the destination vector if it changed or nil otherwise. */)
DEFUN ("bool-vector-subsetp", Fbool_vector_subsetp,
Sbool_vector_subsetp, 2, 2, 0,
- doc: )
+ doc: /* Return t if every t value in A is also t in B, nil otherwise.
+A and B must be bool vectors of the same length. */)
(Lisp_Object a, Lisp_Object b)
{
- /* Like bool_vector_union, but doesn't modify b. */
- return bool_vector_binop_driver (b, a, b, bool_vector_subsetp);
+ return bool_vector_binop_driver (a, b, b, bool_vector_subsetp);
}
DEFUN ("bool-vector-not", Fbool_vector_not,
@@ -3247,11 +3290,12 @@ Return the destination vector. */)
return b;
}
-DEFUN ("bool-vector-count-matches", Fbool_vector_count_matches,
- Sbool_vector_count_matches, 2, 2, 0,
- doc: /* Count how many elements in A equal B.
-A must be a bool vector. B is a generalized bool. */)
- (Lisp_Object a, Lisp_Object b)
+DEFUN ("bool-vector-count-population", Fbool_vector_count_population,
+ Sbool_vector_count_population, 1, 1, 0,
+ doc: /* Count how many elements in A are t.
+A is a bool vector. To count A's nil elements, subtract the return
+value from A's length. */)
+ (Lisp_Object a)
{
EMACS_INT count;
EMACS_INT nr_bits;
@@ -3268,17 +3312,13 @@ A must be a bool vector. B is a generalized bool. */)
for (i = 0; i < nwords; i++)
count += count_one_bits_word (adata[i]);
- if (NILP (b))
- count = nr_bits - count;
return make_number (count);
}
-DEFUN ("bool-vector-count-matches-at",
- Fbool_vector_count_matches_at,
- Sbool_vector_count_matches_at, 3, 3, 0,
- doc: /* Count how many consecutive elements in A equal B at i.
-A must be a bool vector. B is a generalized boolean. i is an
-index into the vector. */)
+DEFUN ("bool-vector-count-consecutive", Fbool_vector_count_consecutive,
+ Sbool_vector_count_consecutive, 3, 3, 0,
+ doc: /* Count how many consecutive elements in A equal B starting at I.
+A is a bool vector, B is t or nil, and I is an index into A. */)
(Lisp_Object a, Lisp_Object b, Lisp_Object i)
{
EMACS_INT count;
@@ -3314,7 +3354,10 @@ index into the vector. */)
mword = bits_word_to_host_endian (adata[pos]);
mword ^= twiddle;
mword >>= offset;
+
+ /* Do not count the pad bits. */
mword |= (bits_word) 1 << (BITS_PER_BITS_WORD - offset);
+
count = count_trailing_zero_bits (mword);
pos++;
if (count + offset < BITS_PER_BITS_WORD)
@@ -3622,8 +3665,8 @@ syms_of_data (void)
defsubr (&Sbool_vector_set_difference);
defsubr (&Sbool_vector_not);
defsubr (&Sbool_vector_subsetp);
- defsubr (&Sbool_vector_count_matches);
- defsubr (&Sbool_vector_count_matches_at);
+ defsubr (&Sbool_vector_count_consecutive);
+ defsubr (&Sbool_vector_count_population);
set_symbol_function (Qwholenump, XSYMBOL (Qnatnump)->function);
diff --git a/src/dispextern.h b/src/dispextern.h
index d40febd207a..7de4edf2196 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -118,7 +118,9 @@ enum window_part
ON_RIGHT_FRINGE,
ON_LEFT_MARGIN,
ON_RIGHT_MARGIN,
- ON_SCROLL_BAR
+ ON_SCROLL_BAR,
+ ON_RIGHT_DIVIDER,
+ ON_BOTTOM_DIVIDER
};
/* Number of bits allocated to store fringe bitmap numbers. */
@@ -667,7 +669,7 @@ struct glyph_pool
glyph memory, which is allocated in the form of a glyph_pool structure.
Glyph rows in such a window matrix are slices of frame matrix rows.
- 2. Free-standing window glyph matrices managing their own glyph
+ 3. Free-standing window glyph matrices managing their own glyph
storage. This form is used in window-based redisplay which
includes variable width and height fonts etc.
@@ -704,12 +706,12 @@ struct glyph_matrix
int matrix_w, matrix_h;
/* If this structure describes a window matrix of window W,
- window_left_col is the value of W->left_col, window_top_line the
- value of W->top_line, window_height and window_width are width and
- height of W, as returned by window_box, and window_vscroll is the
- value of W->vscroll at the time the matrix was last adjusted.
+ window_pixel_left is the value of W->pixel_left, window_pixel_top
+ the value of W->pixel_top, window_height and window_width are width
+ and height of W, as returned by window_box, and window_vscroll is
+ the value of W->vscroll at the time the matrix was last adjusted.
Only set for window-based redisplay. */
- int window_left_col, window_top_line;
+ int window_pixel_left, window_pixel_top;
int window_height, window_width;
int window_vscroll;
@@ -722,7 +724,7 @@ struct glyph_matrix
which do their own scrolling. */
unsigned no_scrolling_p : 1;
- /* Non-zero means window displayed in this matrix has a top mode
+ /* Non-zero means window displayed in this matrix has a header
line. */
unsigned header_line_p : 1;
@@ -1460,28 +1462,40 @@ struct glyph_string
#define DESIRED_HEADER_LINE_HEIGHT(W) \
MATRIX_HEADER_LINE_HEIGHT ((W)->desired_matrix)
-/* Value is non-zero if window W wants a mode line. */
+/* PXW: The height checks below serve to show at least one text line
+ instead of a mode- and/or header line when a window gets very small.
+ But (1) the check fails when the mode- or header-line is taller than
+ the associated frame's line height and (2) we don't care much about
+ text visibility anyway when shrinking a frame containing a toolbar.
-#define WINDOW_WANTS_MODELINE_P(W) \
- (!MINI_WINDOW_P ((W)) \
- && !(W)->pseudo_window_p \
- && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
- && BUFFERP ((W)->contents) \
- && !NILP (BVAR (XBUFFER ((W)->contents), mode_line_format)) \
- && WINDOW_TOTAL_LINES (W) > 1)
+ So maybe these checks should be removed and any clipping left to the
+ window manager. */
-/* Value is true if window W wants a header line. */
-
-#define WINDOW_WANTS_HEADER_LINE_P(W) \
+/* Value is true if window W wants a mode line and is large enough
+ to accommodate it. */
+#define WINDOW_WANTS_MODELINE_P(W) \
(BUFFERP ((W)->contents) \
- ? (!MINI_WINDOW_P ((W)) \
+ ? (!MINI_WINDOW_P (W) \
&& !(W)->pseudo_window_p \
- && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
- && !NILP (BVAR (XBUFFER ((W)->contents), header_line_format)) \
- && WINDOW_TOTAL_LINES (W) > \
- (1 + !NILP (BVAR (XBUFFER ((W)->contents), mode_line_format)))) \
+ && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME (W))) \
+ && !NILP (BVAR (XBUFFER ((W)->contents), mode_line_format)) \
+ && WINDOW_PIXEL_HEIGHT (W) > WINDOW_FRAME_LINE_HEIGHT (W)) \
: 0)
+/* Value is true if window W wants a header line and is large enough
+ to accommodate it. */
+#define WINDOW_WANTS_HEADER_LINE_P(W) \
+ (BUFFERP ((W)->contents) \
+ ? (!MINI_WINDOW_P (W) \
+ && !(W)->pseudo_window_p \
+ && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME (W))) \
+ && !NILP (BVAR (XBUFFER ((W)->contents), header_line_format)) \
+ && (WINDOW_PIXEL_HEIGHT (W) \
+ > (WINDOW_WANTS_MODELINE_P (W) \
+ ? (2 * WINDOW_FRAME_LINE_HEIGHT (W)) \
+ : WINDOW_FRAME_LINE_HEIGHT (W)))) \
+ : 0)
+
/* Return proper value to be used as baseline offset of font that has
ASCENT and DESCENT to draw characters by the font at the vertical
center of the line of frame F.
@@ -1751,6 +1765,7 @@ enum face_id
MOUSE_FACE_ID,
MENU_FACE_ID,
VERTICAL_BORDER_FACE_ID,
+ WINDOW_DIVIDER_FACE_ID,
BASIC_FACE_ID_SENTINEL
};
@@ -1880,6 +1895,10 @@ typedef enum {
RLE, /* right-to-left embedding */
RLO, /* right-to-left override */
PDF, /* pop directional format */
+ LRI, /* left-to-right isolate */
+ RLI, /* right-to-left isolate */
+ FSI, /* first strong isolate */
+ PDI, /* pop directional isolate */
WEAK_ES, /* european number separator */
WEAK_ET, /* european number terminator */
WEAK_CS, /* common separator */
@@ -2850,6 +2869,10 @@ struct redisplay_interface
void (*draw_vertical_window_border) (struct window *w,
int x, int y_0, int y_1);
+/* Draw window divider for window W from (X_0, Y_0) to (X_1, ,Y_1). */
+ void (*draw_window_divider) (struct window *w,
+ int x_0, int x_1, int y_0, int y_1);
+
/* Shift display of frame F to make room for inserted glyphs.
The area at pixel (X,Y) of width WIDTH and height HEIGHT is
shifted right by SHIFT_BY pixels. */
@@ -3167,6 +3190,7 @@ int window_box_left_offset (struct window *, enum glyph_row_area);
int window_box_right (struct window *, enum glyph_row_area);
int window_box_right_offset (struct window *, enum glyph_row_area);
int estimate_mode_line_height (struct frame *, enum face_id);
+int move_it_to (struct it *, ptrdiff_t, int, int, int, int);
void pixel_to_glyph_coords (struct frame *, int, int, int *, int *,
NativeRectangle *, int);
void remember_mouse_glyph (struct frame *, int, int, NativeRectangle *);
@@ -3178,7 +3202,6 @@ void init_iterator (struct it *, struct window *, ptrdiff_t,
void init_iterator_to_row_start (struct it *, struct window *,
struct glyph_row *);
void start_display (struct it *, struct window *, struct text_pos);
-void move_it_to (struct it *, ptrdiff_t, int, int, int, int);
void move_it_vertically (struct it *, int);
void move_it_vertically_backward (struct it *, int);
void move_it_by_lines (struct it *, ptrdiff_t);
@@ -3235,6 +3258,7 @@ extern void display_and_set_cursor (struct window *, bool, int, int, int, int);
extern void x_update_cursor (struct frame *, bool);
extern void x_clear_cursor (struct window *);
extern void x_draw_vertical_border (struct window *w);
+extern void x_draw_right_divider (struct window *w);
extern int get_glyph_string_clip_rects (struct glyph_string *,
NativeRectangle *, int);
@@ -3462,10 +3486,9 @@ void blank_row (struct window *, struct glyph_row *, int);
void clear_glyph_matrix_rows (struct glyph_matrix *, int, int);
void clear_glyph_row (struct glyph_row *);
void prepare_desired_row (struct glyph_row *);
-void set_window_update_flags (struct window *, struct buffer *, bool);
void update_single_window (struct window *, bool);
void do_pending_window_change (bool);
-void change_frame_size (struct frame *, int, int, bool, bool, bool);
+void change_frame_size (struct frame *, int, int, bool, bool, bool, bool);
void init_display (void);
void syms_of_display (void);
extern Lisp_Object Qredisplay_dont_pause;
diff --git a/src/dispnew.c b/src/dispnew.c
index 3207f4a0018..94929600286 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -72,7 +72,7 @@ struct dim
static void update_frame_line (struct frame *, int);
static int required_matrix_height (struct window *);
static int required_matrix_width (struct window *);
-static void change_frame_size_1 (struct frame *, int, int, bool, bool, bool);
+static void change_frame_size_1 (struct frame *, int, int, bool, bool, bool, bool);
static void increment_row_positions (struct glyph_row *, ptrdiff_t, ptrdiff_t);
static void build_frame_matrix_from_window_tree (struct glyph_matrix *,
struct window *);
@@ -97,6 +97,7 @@ static bool scrolling (struct frame *);
static void set_window_cursor_after_update (struct window *);
static void adjust_frame_glyphs_for_window_redisplay (struct frame *);
static void adjust_frame_glyphs_for_frame_redisplay (struct frame *);
+static void set_window_update_flags (struct window *w, bool on_p);
/* True means last display completed. False means it was preempted. */
@@ -400,8 +401,8 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
if (!marginal_areas_changed_p
&& !XFRAME (w->frame)->fonts_changed
&& !header_line_changed_p
- && matrix->window_left_col == WINDOW_LEFT_EDGE_COL (w)
- && matrix->window_top_line == WINDOW_TOP_EDGE_LINE (w)
+ && matrix->window_pixel_left == WINDOW_LEFT_PIXEL_EDGE (w)
+ && matrix->window_pixel_top == WINDOW_TOP_PIXEL_EDGE (w)
&& matrix->window_height == window_height
&& matrix->window_vscroll == w->vscroll
&& matrix->window_width == window_width)
@@ -542,8 +543,8 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
&& !header_line_changed_p
&& new_rows == 0
&& dim.width == matrix->matrix_w
- && matrix->window_left_col == WINDOW_LEFT_EDGE_COL (w)
- && matrix->window_top_line == WINDOW_TOP_EDGE_LINE (w)
+ && matrix->window_pixel_left == WINDOW_LEFT_PIXEL_EDGE (w)
+ && matrix->window_pixel_top == WINDOW_TOP_PIXEL_EDGE (w)
&& matrix->window_width == window_width)
{
/* Find the last row in the window. */
@@ -590,8 +591,8 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
was last adjusted. This is used to optimize redisplay above. */
if (w)
{
- matrix->window_left_col = WINDOW_LEFT_EDGE_COL (w);
- matrix->window_top_line = WINDOW_TOP_EDGE_LINE (w);
+ matrix->window_pixel_left = WINDOW_LEFT_PIXEL_EDGE (w);
+ matrix->window_pixel_top = WINDOW_TOP_PIXEL_EDGE (w);
matrix->window_height = window_height;
matrix->window_width = window_width;
matrix->window_vscroll = w->vscroll;
@@ -1660,6 +1661,7 @@ required_matrix_height (struct window *w)
{
int ch_height = FRAME_SMALLEST_FONT_HEIGHT (f);
int window_pixel_height = window_box_height (w) + eabs (w->vscroll);
+
return (((window_pixel_height + ch_height - 1)
/ ch_height) * w->nrows_scale_factor
/* One partially visible line at the top and
@@ -1684,10 +1686,9 @@ required_matrix_width (struct window *w)
if (FRAME_WINDOW_P (f))
{
int ch_width = FRAME_SMALLEST_CHAR_WIDTH (f);
- int window_pixel_width = WINDOW_TOTAL_WIDTH (w);
/* Compute number of glyphs needed in a glyph row. */
- return (((window_pixel_width + ch_width - 1)
+ return (((WINDOW_PIXEL_WIDTH (w) + ch_width - 1)
/ ch_width) * w->ncols_scale_factor
/* 2 partially visible columns in the text area. */
+ 2
@@ -1977,6 +1978,10 @@ adjust_frame_glyphs_for_frame_redisplay (struct frame *f)
/* Size of frame matrices must equal size of frame. Note
that we are called for X frames with window widths NOT equal
to the frame width (from CHANGE_FRAME_SIZE_1). */
+ if (matrix_dim.width != FRAME_COLS (f)
+ || matrix_dim.height != FRAME_LINES (f))
+ return;
+
eassert (matrix_dim.width == FRAME_COLS (f)
&& matrix_dim.height == FRAME_LINES (f));
@@ -2046,10 +2051,14 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
/* Set window dimensions to frame dimensions and allocate or
adjust glyph matrices of W. */
- w->top_line = 0;
+ w->pixel_left = 0;
w->left_col = 0;
- w->total_lines = FRAME_MENU_BAR_LINES (f);
+ w->pixel_top = 0;
+ w->top_line = 0;
+ w->pixel_width = FRAME_PIXEL_WIDTH (f);
w->total_cols = FRAME_TOTAL_COLS (f);
+ w->pixel_height = FRAME_MENU_BAR_HEIGHT (f);
+ w->total_lines = FRAME_MENU_BAR_LINES (f);
allocate_matrices_for_window_redisplay (w);
}
#endif
@@ -2071,10 +2080,15 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
else
w = XWINDOW (f->tool_bar_window);
- w->top_line = FRAME_MENU_BAR_LINES (f);
+ w->pixel_left = 0;
w->left_col = 0;
- w->total_lines = FRAME_TOOL_BAR_LINES (f);
+ w->pixel_top = FRAME_MENU_BAR_HEIGHT (f);
+ w->top_line = FRAME_MENU_BAR_LINES (f);
+ w->pixel_width = (FRAME_PIXEL_WIDTH (f)
+ - 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
w->total_cols = FRAME_TOTAL_COLS (f);
+ w->pixel_height = FRAME_TOOL_BAR_HEIGHT (f);
+ w->total_lines = FRAME_TOOL_BAR_LINES (f);
allocate_matrices_for_window_redisplay (w);
}
#endif
@@ -2944,8 +2958,8 @@ redraw_frame (struct frame *f)
/* Mark all windows as inaccurate, so that every window will have
its redisplay done. */
mark_window_display_accurate (FRAME_ROOT_WINDOW (f), 0);
- set_window_update_flags (XWINDOW (FRAME_ROOT_WINDOW (f)), NULL, 1);
- f->garbaged = 0;
+ set_window_update_flags (XWINDOW (FRAME_ROOT_WINDOW (f)), true);
+ f->garbaged = false;
}
DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 0, 1, 0,
@@ -3029,7 +3043,7 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p)
Lisp_Object tem;
update_window (w, 1);
- w->must_be_updated_p = 0;
+ w->must_be_updated_p = false;
/* Swap tool-bar strings. We swap because we want to
reuse strings. */
@@ -3075,7 +3089,7 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p)
do_pause:
/* Reset flags indicating that a window should be updated. */
- set_window_update_flags (root_window, NULL, 0);
+ set_window_update_flags (root_window, false);
display_completed = !paused_p;
return paused_p;
@@ -3098,7 +3112,7 @@ update_frame_with_menu (struct frame *f)
frame matrix we operate. */
set_frame_matrix_frame (f);
- /* Update the display */
+ /* Update the display. */
update_begin (f);
/* Force update_frame_1 not to stop due to pending input, and not
try scrolling. */
@@ -3122,7 +3136,7 @@ update_frame_with_menu (struct frame *f)
#endif
/* Reset flags indicating that a window should be updated. */
- set_window_update_flags (root_window, NULL, 0);
+ set_window_update_flags (root_window, false);
}
@@ -3174,7 +3188,7 @@ update_single_window (struct window *w, bool force_p)
update_end (f);
/* Reset flag in W. */
- w->must_be_updated_p = 0;
+ w->must_be_updated_p = false;
}
}
@@ -3897,18 +3911,17 @@ set_window_cursor_after_update (struct window *w)
}
-/* If B is NULL, set WINDOW->must_be_updated_p to ON_P for all windows in
- the window tree rooted at W. Otherwise set WINDOW->must_be_updated_p
- to ON_P only for windows that displays B. */
+/* Set WINDOW->must_be_updated_p to ON_P for all windows in
+ the window tree rooted at W. */
-void
-set_window_update_flags (struct window *w, struct buffer *b, bool on_p)
+static void
+set_window_update_flags (struct window *w, bool on_p)
{
while (w)
{
if (WINDOWP (w->contents))
- set_window_update_flags (XWINDOW (w->contents), b, on_p);
- else if (!(b && b != XBUFFER (w->contents)))
+ set_window_update_flags (XWINDOW (w->contents), on_p);
+ else
w->must_be_updated_p = on_p;
w = NILP (w->next) ? 0 : XWINDOW (w->next);
@@ -5275,7 +5288,7 @@ marginal_area_string (struct window *w, enum window_part part,
if (area == RIGHT_MARGIN_AREA)
x0 = ((WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
? WINDOW_LEFT_FRINGE_WIDTH (w)
- : WINDOW_TOTAL_FRINGE_WIDTH (w))
+ : WINDOW_FRINGES_WIDTH (w))
+ window_box_width (w, LEFT_MARGIN_AREA)
+ window_box_width (w, TEXT_AREA));
else
@@ -5367,7 +5380,7 @@ handle_window_change_signal (int sig)
/* Record the new sizes, but don't reallocate the data
structures now. Let that be done later outside of the
signal handler. */
- change_frame_size (XFRAME (frame), height, width, 0, 1, 0);
+ change_frame_size (XFRAME (frame), width, height, 0, 1, 0, 0);
}
}
}
@@ -5401,17 +5414,21 @@ do_pending_window_change (bool safe)
{
struct frame *f = XFRAME (frame);
- if (f->new_text_lines != 0 || f->new_text_cols != 0)
- change_frame_size (f, f->new_text_lines, f->new_text_cols,
- 0, 0, safe);
+ if (f->new_height != 0 || f->new_width != 0)
+ change_frame_size (f, f->new_width, f->new_height,
+ 0, 0, safe, f->new_pixelwise);
}
}
}
-
/* Change the frame height and/or width. Values may be given as zero to
indicate no change is to take place.
+ new_height and new_width refer to the text portion of the frame. It
+ doesn't matter for new_height, since text and total portion are the
+ same in that case. But new_width must be enlarged to get the total
+ width of the frame.
+
If DELAY, assume we're being called from a signal handler, and
queue the change for later - perhaps the next redisplay.
Since this tries to resize windows, we can't call it
@@ -5421,8 +5438,8 @@ do_pending_window_change (bool safe)
safe to change frame sizes while a redisplay is in progress. */
void
-change_frame_size (struct frame *f, int newheight, int newwidth,
- bool pretend, bool delay, bool safe)
+change_frame_size (struct frame *f, int new_width, int new_height,
+ bool pretend, bool delay, bool safe, bool pixelwise)
{
Lisp_Object tail, frame;
@@ -5433,55 +5450,72 @@ change_frame_size (struct frame *f, int newheight, int newwidth,
ttys. */
FOR_EACH_FRAME (tail, frame)
if (! FRAME_WINDOW_P (XFRAME (frame)))
- change_frame_size_1 (XFRAME (frame), newheight, newwidth,
- pretend, delay, safe);
+ change_frame_size_1 (XFRAME (frame), new_width, new_height,
+ pretend, delay, safe, pixelwise);
}
else
- change_frame_size_1 (f, newheight, newwidth, pretend, delay, safe);
+ change_frame_size_1 (f, new_width, new_height, pretend, delay, safe,
+ pixelwise);
}
static void
-change_frame_size_1 (struct frame *f, int newheight, int newwidth,
- bool pretend, bool delay, bool safe)
+change_frame_size_1 (struct frame *f, int new_width, int new_height,
+ bool pretend, bool delay, bool safe, bool pixelwise)
{
- int new_frame_total_cols;
+ int new_text_width, new_text_height, new_root_width;
+ int old_root_width = (FRAME_PIXEL_WIDTH (f)
+ - 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
+ int new_cols, new_lines;
ptrdiff_t count = SPECPDL_INDEX ();
/* If we can't deal with the change now, queue it for later. */
if (delay || (redisplaying_p && !safe))
{
- f->new_text_lines = newheight;
- f->new_text_cols = newwidth;
+ f->new_width = new_width;
+ f->new_height = new_height;
+ f->new_pixelwise = pixelwise;
delayed_size_change = 1;
return;
}
/* This size-change overrides any pending one for this frame. */
- f->new_text_lines = 0;
- f->new_text_cols = 0;
+ f->new_height = 0;
+ f->new_width = 0;
+ f->new_pixelwise = 0;
/* If an argument is zero, set it to the current value. */
- if (newheight == 0)
- newheight = FRAME_LINES (f);
- if (newwidth == 0)
- newwidth = FRAME_COLS (f);
+ if (pixelwise)
+ {
+ new_text_width = (new_width == 0) ? FRAME_TEXT_WIDTH (f) : new_width;
+ new_text_height = (new_height == 0) ? FRAME_TEXT_HEIGHT (f) : new_height;
+ new_cols = new_text_width / FRAME_COLUMN_WIDTH (f);
+ new_lines = new_text_height / FRAME_LINE_HEIGHT (f);
+ }
+ else
+ {
+ new_cols = (new_width == 0) ? FRAME_COLS (f) : new_width;
+ new_lines = (new_height == 0) ? FRAME_LINES (f) : new_height;
+ new_text_width = new_cols * FRAME_COLUMN_WIDTH (f);
+ new_text_height = new_lines * FRAME_LINE_HEIGHT (f);
+ }
/* Compute width of windows in F. */
/* Round up to the smallest acceptable size. */
- check_frame_size (f, &newheight, &newwidth);
-
- /* This is the width of the frame with vertical scroll bars and fringe
- columns. Do this after rounding - see discussion of bug#9723. */
- new_frame_total_cols = FRAME_TOTAL_COLS_ARG (f, newwidth);
-
+ check_frame_size (f, &new_text_width, &new_text_height, 1);
+
+ /* This is the width of the frame without vertical scroll bars and
+ fringe columns. Do this after rounding - see discussion of
+ bug#9723. */
+ new_root_width = (new_text_width
+ /* PXM: Use the configured scrollbar width !?? */
+ + FRAME_SCROLL_BAR_AREA_WIDTH (f)
+ + FRAME_TOTAL_FRINGE_WIDTH (f));
/* If we're not changing the frame size, quit now. */
/* Frame width may be unchanged but the text portion may change, for
example, fullscreen and remove/add scroll bar. */
- if (newheight == FRAME_LINES (f)
- /* Text portion unchanged? */
- && newwidth == FRAME_COLS (f)
- /* Frame width unchanged? */
- && new_frame_total_cols == FRAME_TOTAL_COLS (f))
+ if (new_text_height == FRAME_TEXT_HEIGHT (f)
+ && new_text_width == FRAME_TEXT_WIDTH (f)
+ && new_root_width == old_root_width)
return;
block_input ();
@@ -5490,36 +5524,44 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth,
/* We only can set screen dimensions to certain values supported
by our video hardware. Try to find the smallest size greater
or equal to the requested dimensions. */
- dos_set_window_size (&newheight, &newwidth);
+ dos_set_window_size (&new_lines, &new_cols);
#endif
- if (newheight != FRAME_LINES (f))
+ if (new_text_height != FRAME_TEXT_HEIGHT (f))
{
- resize_frame_windows (f, newheight, 0);
+ resize_frame_windows (f, new_text_height, 0, 1);
/* MSDOS frames cannot PRETEND, as they change frame size by
manipulating video hardware. */
if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f))
- FrameRows (FRAME_TTY (f)) = newheight;
+ FrameRows (FRAME_TTY (f)) = new_height;
}
- if (new_frame_total_cols != FRAME_TOTAL_COLS (f))
+ if (new_text_width != FRAME_TEXT_WIDTH (f)
+ || new_root_width != old_root_width)
{
- resize_frame_windows (f, new_frame_total_cols, 1);
+ resize_frame_windows (f, new_root_width, 1, 1);
/* MSDOS frames cannot PRETEND, as they change frame size by
manipulating video hardware. */
if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f))
- FrameCols (FRAME_TTY (f)) = newwidth;
+ FrameCols (FRAME_TTY (f)) = new_cols;
#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
if (WINDOWP (f->tool_bar_window))
- XWINDOW (f->tool_bar_window)->total_cols = newwidth;
+ {
+ XWINDOW (f->tool_bar_window)->total_cols = new_cols;
+ XWINDOW (f->tool_bar_window)->pixel_width = new_root_width;
+ }
#endif
}
- FRAME_LINES (f) = newheight;
- SET_FRAME_COLS (f, newwidth);
+ SET_FRAME_COLS (f, new_cols);
+ FRAME_LINES (f) = new_lines;
+ FRAME_TEXT_WIDTH (f) = new_text_width;
+ FRAME_TEXT_HEIGHT (f) = new_text_height;
+ FRAME_PIXEL_WIDTH (f) = FRAME_TEXT_TO_PIXEL_WIDTH (f, new_text_width);
+ FRAME_PIXEL_HEIGHT (f) = FRAME_TEXT_TO_PIXEL_HEIGHT (f, new_text_height);
{
struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f));
@@ -5546,8 +5588,6 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth,
unbind_to (count, Qnil);
}
-
-
/***********************************************************************
Terminal Related Lisp Functions
@@ -6076,8 +6116,8 @@ init_display (void)
#endif
t->display_info.tty->top_frame = selected_frame;
change_frame_size (XFRAME (selected_frame),
- FrameRows (t->display_info.tty),
- FrameCols (t->display_info.tty), 0, 0, 1);
+ FrameCols (t->display_info.tty),
+ FrameRows (t->display_info.tty), 0, 0, 1, 0);
/* Delete the initial terminal. */
if (--initial_terminal->reference_count == 0
diff --git a/src/editfns.c b/src/editfns.c
index 277e5b60704..8e47d1f82e4 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -343,16 +343,15 @@ overlays_around (EMACS_INT pos, Lisp_Object *vec, ptrdiff_t len)
return idx;
}
-/* Return the value of property PROP, in OBJECT at POSITION.
- It's the value of PROP that a char inserted at POSITION would get.
- OBJECT is optional and defaults to the current buffer.
- If OBJECT is a buffer, then overlay properties are considered as well as
- text properties.
- If OBJECT is a window, then that window's buffer is used, but
- window-specific overlays are considered only if they are associated
- with OBJECT. */
-Lisp_Object
-get_pos_property (Lisp_Object position, register Lisp_Object prop, Lisp_Object object)
+DEFUN ("get-pos-property", Fget_pos_property, Sget_pos_property, 2, 3, 0,
+ doc: /* Return the value of POSITION's property PROP, in OBJECT.
+Almost identical to `get-char-property' except for the following difference:
+Whereas `get-char-property' returns the property of the char at (i.e. right
+after) POSITION, this pays attention to properties's stickiness and overlays's
+advancement settings, in order to find the property of POSITION itself,
+i.e. the property that a char would inherit if it were inserted
+at POSITION. */)
+ (Lisp_Object position, register Lisp_Object prop, Lisp_Object object)
{
CHECK_NUMBER_COERCE_MARKER (position);
@@ -484,7 +483,7 @@ find_field (Lisp_Object pos, Lisp_Object merge_at_boundary,
specially. */
if (NILP (merge_at_boundary))
{
- Lisp_Object field = get_pos_property (pos, Qfield, Qnil);
+ Lisp_Object field = Fget_pos_property (pos, Qfield, Qnil);
if (!EQ (field, after_field))
at_field_end = 1;
if (!EQ (field, before_field))
@@ -683,7 +682,7 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */)
&& (!NILP (Fget_char_property (new_pos, Qfield, Qnil))
|| !NILP (Fget_char_property (old_pos, Qfield, Qnil))
/* To recognize field boundaries, we must also look at the
- previous positions; we could use `get_pos_property'
+ previous positions; we could use `Fget_pos_property'
instead, but in itself that would fail inside non-sticky
fields (like comint prompts). */
|| (XFASTINT (new_pos) > BEGV
@@ -694,10 +693,12 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */)
/* Field boundaries are again a problem; but now we must
decide the case exactly, so we need to call
`get_pos_property' as well. */
- || (NILP (get_pos_property (old_pos, inhibit_capture_property, Qnil))
+ || (NILP (Fget_pos_property (old_pos, inhibit_capture_property, Qnil))
&& (XFASTINT (old_pos) <= BEGV
- || NILP (Fget_char_property (old_pos, inhibit_capture_property, Qnil))
- || NILP (Fget_char_property (prev_old, inhibit_capture_property, Qnil))))))
+ || NILP (Fget_char_property
+ (old_pos, inhibit_capture_property, Qnil))
+ || NILP (Fget_char_property
+ (prev_old, inhibit_capture_property, Qnil))))))
/* It is possible that NEW_POS is not within the same field as
OLD_POS; try to move NEW_POS so that it is. */
{
@@ -717,7 +718,7 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */)
/* NEW_POS should be constrained, but only if either
ONLY_IN_LINE is nil (in which case any constraint is OK),
or NEW_POS and FIELD_BOUND are on the same line (in which
- case the constraint is OK even if ONLY_IN_LINE is non-nil). */
+ case the constraint is OK even if ONLY_IN_LINE is non-nil). */
&& (NILP (only_in_line)
/* This is the ONLY_IN_LINE case, check that NEW_POS and
FIELD_BOUND are on the same line by seeing whether
@@ -3472,7 +3473,6 @@ usage: (message-box FORMAT-STRING &rest ARGS) */)
else
{
Lisp_Object val = Fformat (nargs, args);
-#ifdef HAVE_MENUS
Lisp_Object pane, menu;
struct gcpro gcpro1;
@@ -3481,9 +3481,6 @@ usage: (message-box FORMAT-STRING &rest ARGS) */)
menu = Fcons (val, pane);
Fx_popup_dialog (Qt, menu, Qt);
UNGCPRO;
-#else /* !HAVE_MENUS */
- message3 (val);
-#endif
return val;
}
}
@@ -3502,11 +3499,9 @@ message; let the minibuffer contents show.
usage: (message-or-box FORMAT-STRING &rest ARGS) */)
(ptrdiff_t nargs, Lisp_Object *args)
{
-#ifdef HAVE_MENUS
if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
&& use_dialog_box)
return Fmessage_box (nargs, args);
-#endif
return Fmessage (nargs, args);
}
@@ -4836,6 +4831,7 @@ functions if all the text being accessed has this property. */);
defsubr (&Sbuffer_substring);
defsubr (&Sbuffer_substring_no_properties);
defsubr (&Sbuffer_string);
+ defsubr (&Sget_pos_property);
defsubr (&Spoint_marker);
defsubr (&Smark_marker);
diff --git a/src/emacs.c b/src/emacs.c
index 22be1d82949..af69e2c4efe 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1539,6 +1539,10 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
init_keyboard (); /* This too must precede init_sys_modes. */
if (!noninteractive)
init_display (); /* Determine terminal type. Calls init_sys_modes. */
+#if HAVE_W32NOTIFY
+ else
+ init_crit (); /* w32notify.c needs this in batch mode. */
+#endif /* HAVE_W32NOTIFY */
init_xdisp ();
#ifdef HAVE_WINDOW_SYSTEM
init_fringe ();
@@ -2198,10 +2202,13 @@ synchronize_system_messages_locale (void)
Lisp_Object
-decode_env_path (const char *evarname, const char *defalt)
+decode_env_path (const char *evarname, const char *defalt, bool empty)
{
const char *path, *p;
Lisp_Object lpath, element, tem;
+ /* Default is to use "." for empty path elements.
+ But if argument EMPTY is true, use nil instead. */
+ Lisp_Object empty_element = empty ? Qnil : build_string (".");
#ifdef WINDOWSNT
bool defaulted = 0;
static const char *emacs_dir_env = "%emacs_dir%/";
@@ -2281,34 +2288,38 @@ decode_env_path (const char *evarname, const char *defalt)
if (!p)
p = path + strlen (path);
element = (p - path ? make_unibyte_string (path, p - path)
- : build_string ("."));
+ : empty_element);
+ if (! NILP (element))
+ {
#ifdef WINDOWSNT
- /* Relative file names in the default path are interpreted as
- being relative to $emacs_dir. */
- if (emacs_dir && defaulted
- && strncmp (path, emacs_dir_env, emacs_dir_len) == 0)
- element = Fexpand_file_name (Fsubstring (element,
- make_number (emacs_dir_len),
- Qnil),
- build_unibyte_string (emacs_dir));
-#endif
-
- /* Add /: to the front of the name
- if it would otherwise be treated as magic. */
- tem = Ffind_file_name_handler (element, Qt);
-
- /* However, if the handler says "I'm safe",
- don't bother adding /:. */
- if (SYMBOLP (tem))
- {
- Lisp_Object prop;
- prop = Fget (tem, intern ("safe-magic"));
- if (! NILP (prop))
- tem = Qnil;
- }
+ /* Relative file names in the default path are interpreted as
+ being relative to $emacs_dir. */
+ if (emacs_dir && defaulted
+ && strncmp (path, emacs_dir_env, emacs_dir_len) == 0)
+ element = Fexpand_file_name (Fsubstring
+ (element,
+ make_number (emacs_dir_len),
+ Qnil),
+ build_unibyte_string (emacs_dir));
+#endif
+
+ /* Add /: to the front of the name
+ if it would otherwise be treated as magic. */
+ tem = Ffind_file_name_handler (element, Qt);
+
+ /* However, if the handler says "I'm safe",
+ don't bother adding /:. */
+ if (SYMBOLP (tem))
+ {
+ Lisp_Object prop;
+ prop = Fget (tem, intern ("safe-magic"));
+ if (! NILP (prop))
+ tem = Qnil;
+ }
- if (! NILP (tem))
- element = concat2 (build_string ("/:"), element);
+ if (! NILP (tem))
+ element = concat2 (build_string ("/:"), element);
+ } /* !NILP (element) */
lpath = Fcons (element, lpath);
if (*p)
diff --git a/src/epaths.in b/src/epaths.in
index 1f5701e5337..5bfc7158316 100644
--- a/src/epaths.in
+++ b/src/epaths.in
@@ -1,7 +1,6 @@
/* Hey Emacs, this is -*- C -*- code! */
/*
-Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software
-Foundation, Inc.
+Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -23,8 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
load-path, which is the search path for the Lisp function "load".
Configure (using "make epaths-force") sets this to
${standardlisppath}, which typically has a value like:
- <datadir>/emacs/VERSION/lisp:<datadir>/emacs/VERSION/leim
- where datadir is eg /usr/local/share.
+ <datadir>/emacs/VERSION/lisp where datadir is eg /usr/local/share.
*/
#define PATH_LOADSEARCH "/usr/local/share/emacs/lisp"
diff --git a/src/eval.c b/src/eval.c
index d3fcec5aef4..81666830f4e 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -3576,6 +3576,73 @@ NFRAMES and BASE specify the activation frame to use, as in `backtrace-frame'.
from the debugger. */
return unbind_to (count, eval_sub (exp));
}
+
+DEFUN ("backtrace--locals", Fbacktrace__locals, Sbacktrace__locals, 1, 2, NULL,
+ doc: /* Return names and values of local variables of a stack frame.
+NFRAMES and BASE specify the activation frame to use, as in `backtrace-frame'. */)
+ (Lisp_Object nframes, Lisp_Object base)
+{
+ union specbinding *frame = get_backtrace_frame (nframes, base);
+ union specbinding *prevframe
+ = get_backtrace_frame (make_number (XFASTINT (nframes) - 1), base);
+ ptrdiff_t distance = specpdl_ptr - frame;
+ Lisp_Object result = Qnil;
+ eassert (distance >= 0);
+
+ if (!backtrace_p (prevframe))
+ error ("Activation frame not found!");
+ if (!backtrace_p (frame))
+ error ("Activation frame not found!");
+
+ /* The specpdl entries normally contain the symbol being bound along with its
+ `old_value', so it can be restored. The new value to which it is bound is
+ available in one of two places: either in the current value of the
+ variable (if it hasn't been rebount yet) or in the `old_value' slot of the
+ next specpdl entry for it.
+ `backtrace_eval_unrewind' happens to swap the role of `old_value'
+ and "new value", so we abuse it here, to fetch the new value.
+ It's ugly (we'd rather not modify global data) and a bit inefficient,
+ but it does the job for now. */
+ backtrace_eval_unrewind (distance);
+
+ /* Grab values. */
+ {
+ union specbinding *tmp = prevframe;
+ for (; tmp > frame; tmp--)
+ {
+ switch (tmp->kind)
+ {
+ case SPECPDL_LET:
+ case SPECPDL_LET_DEFAULT:
+ case SPECPDL_LET_LOCAL:
+ {
+ Lisp_Object sym = specpdl_symbol (tmp);
+ Lisp_Object val = specpdl_old_value (tmp);
+ if (EQ (sym, Qinternal_interpreter_environment))
+ {
+ Lisp_Object env = val;
+ for (; CONSP (env); env = XCDR (env))
+ {
+ Lisp_Object binding = XCAR (env);
+ if (CONSP (binding))
+ result = Fcons (Fcons (XCAR (binding),
+ XCDR (binding)),
+ result);
+ }
+ }
+ else
+ result = Fcons (Fcons (sym, val), result);
+ }
+ }
+ }
+ }
+
+ /* Restore values from specpdl to original place. */
+ backtrace_eval_unrewind (-distance);
+
+ return result;
+}
+
void
mark_specpdl (void)
@@ -3824,6 +3891,7 @@ alist of active lexical bindings. */);
defsubr (&Sbacktrace);
defsubr (&Sbacktrace_frame);
defsubr (&Sbacktrace_eval);
+ defsubr (&Sbacktrace__locals);
defsubr (&Sspecial_variable_p);
defsubr (&Sfunctionp);
}
diff --git a/src/fileio.c b/src/fileio.c
index 7b4bd7f196d..2ef3f1fe0f9 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3878,6 +3878,9 @@ by calling `format-decode', which see. */)
beg_offset += same_at_start - BEGV_BYTE;
end_offset -= ZV_BYTE - same_at_end;
+ invalidate_buffer_caches (current_buffer,
+ BYTE_TO_CHAR (same_at_start),
+ BYTE_TO_CHAR (same_at_end));
del_range_byte (same_at_start, same_at_end, 0);
/* Insert from the file at the proper position. */
temp = BYTE_TO_CHAR (same_at_start);
@@ -3988,7 +3991,12 @@ by calling `format-decode', which see. */)
{
/* Truncate the buffer to the size of the file. */
if (same_at_start != same_at_end)
- del_range_byte (same_at_start, same_at_end, 0);
+ {
+ invalidate_buffer_caches (current_buffer,
+ BYTE_TO_CHAR (same_at_start),
+ BYTE_TO_CHAR (same_at_end));
+ del_range_byte (same_at_start, same_at_end, 0);
+ }
inserted = 0;
unbind_to (this_count, Qnil);
@@ -4036,6 +4044,9 @@ by calling `format-decode', which see. */)
if (same_at_end != same_at_start)
{
+ invalidate_buffer_caches (current_buffer,
+ BYTE_TO_CHAR (same_at_start),
+ BYTE_TO_CHAR (same_at_end));
del_range_byte (same_at_start, same_at_end, 0);
temp = GPT;
eassert (same_at_start == GPT_BYTE);
@@ -5793,6 +5804,24 @@ void
init_fileio (void)
{
valid_timestamp_file_system = 0;
+
+ /* fsync can be a significant performance hit. Often it doesn't
+ suffice to make the file-save operation survive a crash. For
+ batch scripts, which are typically part of larger shell commands
+ that don't fsync other files, its effect on performance can be
+ significant so its utility is particularly questionable.
+ Hence, for now by default fsync is used only when interactive.
+
+ For more on why fsync often fails to work on today's hardware, see:
+ Zheng M et al. Understanding the robustness of SSDs under power fault.
+ 11th USENIX Conf. on File and Storage Technologies, 2013 (FAST '13), 271-84
+ http://www.usenix.org/system/files/conference/fast13/fast13-final80.pdf
+
+ For more on why fsync does not suffice even if it works properly, see:
+ Roche X. Necessary step(s) to synchronize filename operations on disk.
+ Austin Group Defect 672, 2013-03-19
+ http://austingroupbugs.net/view.php?id=672 */
+ write_region_inhibit_fsync = noninteractive;
}
void
@@ -6013,28 +6042,12 @@ in the buffer; this is the default behavior, because the auto-save
file is usually more useful if it contains the deleted text. */);
Vauto_save_include_big_deletions = Qnil;
- /* fsync can be a significant performance hit. Often it doesn't
- suffice to make the file-save operation survive a crash. For
- batch scripts, which are typically part of larger shell commands
- that don't fsync other files, its effect on performance can be
- significant so its utility is particularly questionable.
- Hence, for now by default fsync is used only when interactive.
-
- For more on why fsync often fails to work on today's hardware, see:
- Zheng M et al. Understanding the robustness of SSDs under power fault.
- 11th USENIX Conf. on File and Storage Technologies, 2013 (FAST '13), 271-84
- http://www.usenix.org/system/files/conference/fast13/fast13-final80.pdf
-
- For more on why fsync does not suffice even if it works properly, see:
- Roche X. Necessary step(s) to synchronize filename operations on disk.
- Austin Group Defect 672, 2013-03-19
- http://austingroupbugs.net/view.php?id=672 */
DEFVAR_BOOL ("write-region-inhibit-fsync", write_region_inhibit_fsync,
doc: /* Non-nil means don't call fsync in `write-region'.
This variable affects calls to `write-region' as well as save commands.
Setting this to nil may avoid data loss if the system loses power or
the operating system crashes. */);
- write_region_inhibit_fsync = noninteractive;
+ write_region_inhibit_fsync = 0; /* See also `init_fileio' above. */
DEFVAR_BOOL ("delete-by-moving-to-trash", delete_by_moving_to_trash,
doc: /* Specifies whether to use the system's trash can.
diff --git a/src/fns.c b/src/fns.c
index 93829fb1d62..b13bb8d80dc 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -35,11 +35,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "frame.h"
#include "window.h"
#include "blockinput.h"
-#ifdef HAVE_MENUS
#if defined (HAVE_X_WINDOWS)
#include "xterm.h"
#endif
-#endif /* HAVE_MENUS */
Lisp_Object Qstring_lessp;
static Lisp_Object Qprovide, Qrequire;
@@ -50,7 +48,7 @@ static Lisp_Object Qcodeset, Qdays, Qmonths, Qpaper;
static Lisp_Object Qmd5, Qsha1, Qsha224, Qsha256, Qsha384, Qsha512;
-static bool internal_equal (Lisp_Object, Lisp_Object, int, bool);
+static bool internal_equal (Lisp_Object, Lisp_Object, int, bool, Lisp_Object);
DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0,
doc: /* Return the argument unchanged. */)
@@ -1357,7 +1355,7 @@ The value is actually the tail of LIST whose car is ELT. */)
register Lisp_Object tem;
CHECK_LIST_CONS (tail, list);
tem = XCAR (tail);
- if (FLOATP (tem) && internal_equal (elt, tem, 0, 0))
+ if (FLOATP (tem) && internal_equal (elt, tem, 0, 0, Qnil))
return tail;
QUIT;
}
@@ -1539,15 +1537,12 @@ Write `(setq foo (delq element foo))' to be sure of correctly changing
the value of a list `foo'. */)
(register Lisp_Object elt, Lisp_Object list)
{
- register Lisp_Object tail, prev;
- register Lisp_Object tem;
+ Lisp_Object tail, tortoise, prev = Qnil;
+ bool skip;
- tail = list;
- prev = Qnil;
- while (CONSP (tail))
+ FOR_EACH_TAIL (tail, list, tortoise, skip)
{
- CHECK_LIST_CONS (tail, list);
- tem = XCAR (tail);
+ Lisp_Object tem = XCAR (tail);
if (EQ (elt, tem))
{
if (NILP (prev))
@@ -1557,8 +1552,6 @@ the value of a list `foo'. */)
}
else
prev = tail;
- tail = XCDR (tail);
- QUIT;
}
return list;
}
@@ -1961,7 +1954,7 @@ Floating-point numbers of equal value are `eql', but they may not be `eq'. */)
(Lisp_Object obj1, Lisp_Object obj2)
{
if (FLOATP (obj1))
- return internal_equal (obj1, obj2, 0, 0) ? Qt : Qnil;
+ return internal_equal (obj1, obj2, 0, 0, Qnil) ? Qt : Qnil;
else
return EQ (obj1, obj2) ? Qt : Qnil;
}
@@ -1976,7 +1969,7 @@ Numbers are compared by value, but integers cannot equal floats.
Symbols must match exactly. */)
(register Lisp_Object o1, Lisp_Object o2)
{
- return internal_equal (o1, o2, 0, 0) ? Qt : Qnil;
+ return internal_equal (o1, o2, 0, 0, Qnil) ? Qt : Qnil;
}
DEFUN ("equal-including-properties", Fequal_including_properties, Sequal_including_properties, 2, 2, 0,
@@ -1985,7 +1978,7 @@ This is like `equal' except that it compares the text properties
of strings. (`equal' ignores text properties.) */)
(register Lisp_Object o1, Lisp_Object o2)
{
- return internal_equal (o1, o2, 0, 1) ? Qt : Qnil;
+ return internal_equal (o1, o2, 0, 1, Qnil) ? Qt : Qnil;
}
/* DEPTH is current depth of recursion. Signal an error if it
@@ -1993,10 +1986,39 @@ of strings. (`equal' ignores text properties.) */)
PROPS means compare string text properties too. */
static bool
-internal_equal (Lisp_Object o1, Lisp_Object o2, int depth, bool props)
+internal_equal (Lisp_Object o1, Lisp_Object o2, int depth, bool props,
+ Lisp_Object ht)
{
- if (depth > 200)
- error ("Stack overflow in equal");
+ if (depth > 10)
+ {
+ if (depth > 200)
+ error ("Stack overflow in equal");
+ if (NILP (ht))
+ {
+ Lisp_Object args[2] = { QCtest, Qeq };
+ ht = Fmake_hash_table (2, args);
+ }
+ switch (XTYPE (o1))
+ {
+ case Lisp_Cons: case Lisp_Misc: case Lisp_Vectorlike:
+ {
+ struct Lisp_Hash_Table *h = XHASH_TABLE (ht);
+ EMACS_UINT hash;
+ ptrdiff_t i = hash_lookup (h, o1, &hash);
+ if (i >= 0)
+ { /* `o1' was seen already. */
+ Lisp_Object o2s = HASH_VALUE (h, i);
+ if (!NILP (Fmemq (o2, o2s)))
+ return 1;
+ else
+ set_hash_value_slot (h, i, Fcons (o2, o2s));
+ }
+ else
+ hash_put (h, o1, Fcons (o2, Qnil), hash);
+ }
+ default: ;
+ }
+ }
tail_recurse:
QUIT;
@@ -2019,10 +2041,11 @@ internal_equal (Lisp_Object o1, Lisp_Object o2, int depth, bool props)
}
case Lisp_Cons:
- if (!internal_equal (XCAR (o1), XCAR (o2), depth + 1, props))
+ if (!internal_equal (XCAR (o1), XCAR (o2), depth + 1, props, ht))
return 0;
o1 = XCDR (o1);
o2 = XCDR (o2);
+ /* FIXME: This inf-loops in a circular list! */
goto tail_recurse;
case Lisp_Misc:
@@ -2031,9 +2054,9 @@ internal_equal (Lisp_Object o1, Lisp_Object o2, int depth, bool props)
if (OVERLAYP (o1))
{
if (!internal_equal (OVERLAY_START (o1), OVERLAY_START (o2),
- depth + 1, props)
+ depth + 1, props, ht)
|| !internal_equal (OVERLAY_END (o1), OVERLAY_END (o2),
- depth + 1, props))
+ depth + 1, props, ht))
return 0;
o1 = XOVERLAY (o1)->plist;
o2 = XOVERLAY (o2)->plist;
@@ -2085,7 +2108,7 @@ internal_equal (Lisp_Object o1, Lisp_Object o2, int depth, bool props)
Lisp_Object v1, v2;
v1 = AREF (o1, i);
v2 = AREF (o2, i);
- if (!internal_equal (v1, v2, depth + 1, props))
+ if (!internal_equal (v1, v2, depth + 1, props, ht))
return 0;
}
return 1;
@@ -2416,7 +2439,6 @@ if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil. */)
CHECK_STRING (prompt);
-#ifdef HAVE_MENUS
if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
&& use_dialog_box)
{
@@ -2430,7 +2452,6 @@ if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil. */)
UNGCPRO;
return obj;
}
-#endif /* HAVE_MENUS */
args[0] = prompt;
args[1] = build_string ("(yes or no) ");
diff --git a/src/font.c b/src/font.c
index 1e1670b21af..ad604ebe744 100644
--- a/src/font.c
+++ b/src/font.c
@@ -2718,7 +2718,7 @@ font_list_entities (struct frame *f, Lisp_Object spec)
ASET (scratch_font_spec, FONT_SPACING_INDEX, AREF (spec, FONT_SPACING_INDEX));
ASET (scratch_font_spec, FONT_EXTRA_INDEX, AREF (spec, FONT_EXTRA_INDEX));
- for (i = 0; driver_list; driver_list = driver_list->next)
+ for (; driver_list; driver_list = driver_list->next)
if (driver_list->on
&& (NILP (ftype) || EQ (driver_list->driver->type, ftype)))
{
diff --git a/src/font.h b/src/font.h
index 2db8d35af48..539ebeba52a 100644
--- a/src/font.h
+++ b/src/font.h
@@ -234,6 +234,11 @@ enum font_property_index
#define FONT_SET_STYLE(font, prop, val) \
ASET ((font), prop, make_number (font_style_to_value (prop, val, 1)))
+#define FONT_WIDTH(f) ((f)->max_width)
+#define FONT_HEIGHT(f) ((f)->height)
+#define FONT_BASE(f) ((f)->ascent)
+#define FONT_DESCENT(f) ((f)->descent)
+
extern Lisp_Object QCspacing, QCdpi, QCscalable, QCotf, QClang, QCscript;
extern Lisp_Object QCavgwidth, QCantialias, QCfont_entity;
extern Lisp_Object Qp;
@@ -307,6 +312,10 @@ struct font
/* Ascent and descent of the font (in pixels). */
int ascent, descent;
+ /* The following members makes sense on graphic displays only. */
+
+#if defined (HAVE_WINDOW_SYSTEM)
+
/* Vertical pixel width of the underline. If is zero if that
information is not in the font. */
int underline_thickness;
@@ -369,12 +378,6 @@ struct font
registered in char-table `use-default-ascent'. */
int default_ascent;
- /* CCL program to calculate code points of the font. */
- struct ccl_program *font_encoder;
-
- /* Font-driver for the font. */
- struct font_driver *driver;
-
/* Charset to encode a character code into a glyph code of the font.
-1 means that the font doesn't require this information to encode
a character. */
@@ -385,6 +388,11 @@ struct font
determine it. */
int repertory_charset;
+#endif /* HAVE_WINDOW_SYSTEM */
+
+ /* Font-driver for the font. */
+ struct font_driver *driver;
+
/* There are more members in this structure, but they are private
to the font-driver. */
};
@@ -412,7 +420,6 @@ struct font_bitmap
int left;
int top;
int advance;
- void *extra;
};
/* Predicates to check various font-related objects. */
diff --git a/src/frame.c b/src/frame.c
index 4494edda5d7..03bdf696c47 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -78,6 +78,7 @@ Lisp_Object Qleft, Qright;
Lisp_Object Qicon_left, Qicon_top, Qicon_type, Qicon_name;
Lisp_Object Qtooltip;
Lisp_Object Qinternal_border_width;
+Lisp_Object Qright_divider_width, Qbottom_divider_width;
Lisp_Object Qmouse_color;
Lisp_Object Qminibuffer;
Lisp_Object Qscroll_bar_width, Qvertical_scroll_bars;
@@ -109,6 +110,8 @@ Lisp_Object Qalpha;
Lisp_Object Qface_set_after_frame_default;
+static Lisp_Object Qfocus_in_hook;
+static Lisp_Object Qfocus_out_hook;
static Lisp_Object Qdelete_frame_functions;
static Lisp_Object Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource;
@@ -195,9 +198,12 @@ static void
set_menu_bar_lines_1 (Lisp_Object window, int n)
{
struct window *w = XWINDOW (window);
+ struct frame *f = XFRAME (WINDOW_FRAME (w));
w->top_line += n;
+ w->pixel_top += n * FRAME_LINE_HEIGHT (f);
w->total_lines -= n;
+ w->pixel_height -= n * FRAME_LINE_HEIGHT (f);
/* Handle just the top child in a vertical split. */
if (WINDOW_VERTICAL_COMBINATION_P (w))
@@ -234,6 +240,7 @@ set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
windows_or_buffers_changed = 14;
FRAME_WINDOW_SIZES_CHANGED (f) = 1;
FRAME_MENU_BAR_LINES (f) = nlines;
+ FRAME_MENU_BAR_HEIGHT (f) = nlines * FRAME_LINE_HEIGHT (f);
set_menu_bar_lines_1 (f->root_window, nlines - olines);
adjust_frame_glyphs (f);
}
@@ -323,6 +330,7 @@ make_frame (bool mini_p)
{
Lisp_Object frame;
register struct frame *f;
+ register struct window *rw, *mw;
register Lisp_Object root_window;
register Lisp_Object mini_window;
@@ -337,33 +345,36 @@ make_frame (bool mini_p)
non-Lisp data, so do it only for slots which should not be zero.
To avoid subtle bugs and for the sake of readability, it's better to
initialize enum members explicitly even if their values are zero. */
- f->wants_modeline = 1;
- f->garbaged = 1;
+ f->wants_modeline = true;
+ f->redisplay = true;
+ f->garbaged = true;
f->vertical_scroll_bar_type = vertical_scroll_bar_none;
- f->column_width = 1; /* !FRAME_WINDOW_P value */
- f->line_height = 1; /* !FRAME_WINDOW_P value */
+ f->column_width = 1; /* !FRAME_WINDOW_P value. */
+ f->line_height = 1; /* !FRAME_WINDOW_P value. */
#ifdef HAVE_WINDOW_SYSTEM
f->want_fullscreen = FULLSCREEN_NONE;
#endif
root_window = make_window ();
+ rw = XWINDOW (root_window);
if (mini_p)
{
mini_window = make_window ();
- wset_next (XWINDOW (root_window), mini_window);
- wset_prev (XWINDOW (mini_window), root_window);
- XWINDOW (mini_window)->mini = 1;
- wset_frame (XWINDOW (mini_window), frame);
+ mw = XWINDOW (mini_window);
+ wset_next (rw, mini_window);
+ wset_prev (mw, root_window);
+ mw->mini = 1;
+ wset_frame (mw, frame);
fset_minibuffer_window (f, mini_window);
}
else
{
mini_window = Qnil;
- wset_next (XWINDOW (root_window), Qnil);
+ wset_next (rw, Qnil);
fset_minibuffer_window (f, Qnil);
}
- wset_frame (XWINDOW (root_window), frame);
+ wset_frame (rw, frame);
/* 10 is arbitrary,
just so that there is "something there."
@@ -371,15 +382,22 @@ make_frame (bool mini_p)
SET_FRAME_COLS (f, 10);
FRAME_LINES (f) = 10;
+ SET_FRAME_WIDTH (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f));
+ SET_FRAME_HEIGHT (f, FRAME_LINES (f) * FRAME_LINE_HEIGHT (f));
- XWINDOW (root_window)->total_cols = 10;
- XWINDOW (root_window)->total_lines = mini_p ? 9 : 10;
+ rw->total_cols = 10;
+ rw->pixel_width = rw->total_cols * FRAME_COLUMN_WIDTH (f);
+ rw->total_lines = mini_p ? 9 : 10;
+ rw->pixel_height = rw->total_lines * FRAME_LINE_HEIGHT (f);
if (mini_p)
{
- XWINDOW (mini_window)->total_cols = 10;
- XWINDOW (mini_window)->top_line = 9;
- XWINDOW (mini_window)->total_lines = 1;
+ mw->top_line = rw->total_lines;
+ mw->pixel_top = rw->pixel_height;
+ mw->total_cols = rw->total_cols;
+ mw->pixel_width = rw->pixel_width;
+ mw->total_lines = 1;
+ mw->pixel_height = FRAME_LINE_HEIGHT (f);
}
/* Choose a buffer for the frame's root window. */
@@ -600,7 +618,8 @@ make_terminal_frame (struct terminal *terminal)
#endif /* not MSDOS */
FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
- FRAME_MENU_BAR_LINES(f) = NILP (Vmenu_bar_mode) ? 0 : 1;
+ FRAME_MENU_BAR_LINES (f) = NILP (Vmenu_bar_mode) ? 0 : 1;
+ FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f);
/* Set the top frame to the newly created frame. */
if (FRAMEP (FRAME_TTY (f)->top_frame)
@@ -720,7 +739,7 @@ affects all frames on the same terminal device. */)
{
int width, height;
get_tty_size (fileno (FRAME_TTY (f)->input), &width, &height);
- change_frame_size (f, height, width, 0, 0, 0);
+ change_frame_size (f, width, height, 0, 0, 0, 0);
}
adjust_frame_glyphs (f);
@@ -783,9 +802,6 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor
if (sf == XFRAME (frame))
return frame;
- /* This is too greedy; it causes inappropriate focus redirection
- that's hard to get rid of. */
-#if 0
/* If a frame's focus has been redirected toward the currently
selected frame, we should change the redirection to point to the
newly selected frame. This means that if the focus is redirected
@@ -793,6 +809,9 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor
can use `other-window' to switch between all the frames using
that minibuffer frame, and the focus redirection will follow us
around. */
+#if 0
+ /* This is too greedy; it causes inappropriate focus redirection
+ that's hard to get rid of. */
if (track)
{
Lisp_Object tail;
@@ -885,27 +904,6 @@ This function returns FRAME, or nil if FRAME has been deleted. */)
return do_switch_frame (frame, 1, 0, norecord);
}
-DEFUN ("handle-focus-in", Fhandle_focus_in, Shandle_focus_in, 1, 1, "e",
- doc: /* Handle a focus-in event.
-Focus in events are usually bound to this function.
-Focus in events occur when a frame has focus, but a switch-frame event
-is not generated.
-This function checks if blink-cursor timers should be turned on again. */)
- (Lisp_Object event)
-{
- return call0 (intern ("blink-cursor-check"));
-}
-
-DEFUN ("handle-focus-out", Fhandle_focus_out, Shandle_focus_out, 1, 1, "e",
- doc: /* Handle a focus-out event.
-Focus out events are usually bound to this function.
-Focus out events occur when no frame has focus.
-This function checks if blink-cursor timers should be turned off. */)
- (Lisp_Object event)
-{
- return call0 (intern ("blink-cursor-suspend"));
-}
-
DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 1, "e",
doc: /* Handle a switch-frame event EVENT.
Switch-frame events are usually bound to this function.
@@ -920,7 +918,8 @@ to that frame. */)
/* Preserve prefix arg that the command loop just cleared. */
kset_prefix_arg (current_kboard, Vcurrent_prefix_arg);
Frun_hooks (1, &Qmouse_leave_buffer_hook);
- Fhandle_focus_in (event); // switch-frame implies a focus in.
+ /* `switch-frame' implies a focus in. */
+ call1 (intern ("handle-focus-in"), event);
return do_switch_frame (event, 0, 0, Qnil);
}
@@ -1699,7 +1698,7 @@ If omitted, FRAME defaults to the currently selected frame. */)
make_frame_visible_1 (f->root_window);
/* Make menu bar update for the Buffers and Frames menus. */
- windows_or_buffers_changed = 15;
+ /* windows_or_buffers_changed = 15; FIXME: Why? */
XSETFRAME (frame, f);
return frame;
@@ -2028,6 +2027,20 @@ set_term_frame_name (struct frame *f, Lisp_Object name)
update_mode_lines = 16;
}
+#ifdef HAVE_NTGUI
+void
+set_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
+{
+ register Lisp_Object old_alist_elt;
+
+ old_alist_elt = Fassq (prop, f->param_alist);
+ if (EQ (old_alist_elt, Qnil))
+ fset_param_alist (f, Fcons (Fcons (prop, val), f->param_alist));
+ else
+ Fsetcdr (old_alist_elt, val);
+}
+#endif
+
void
store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
{
@@ -2181,9 +2194,17 @@ If FRAME is omitted or nil, return information on the currently selected frame.
:"tty"));
}
store_in_alist (&alist, Qname, f->name);
- height = (f->new_text_lines ? f->new_text_lines : FRAME_LINES (f));
+ height = (f->new_height
+ ? (f->new_pixelwise
+ ? (f->new_height / FRAME_LINE_HEIGHT (f))
+ : f->new_height)
+ : FRAME_LINES (f));
store_in_alist (&alist, Qheight, make_number (height));
- width = (f->new_text_cols ? f->new_text_cols : FRAME_COLS (f));
+ width = (f->new_width
+ ? (f->new_pixelwise
+ ? (f->new_width / FRAME_COLUMN_WIDTH (f))
+ : f->new_width)
+ : FRAME_COLS (f));
store_in_alist (&alist, Qwidth, make_number (width));
store_in_alist (&alist, Qmodeline, (FRAME_WANTS_MODELINE_P (f) ? Qt : Qnil));
store_in_alist (&alist, Qminibuffer,
@@ -2454,80 +2475,180 @@ is used. */)
#endif
return make_number (0);
}
+
+DEFUN ("frame-text-cols", Fframe_text_cols, Sframe_text_cols, 0, 1, 0,
+ doc: /* Return width in columns of FRAME's text area. */)
+ (Lisp_Object frame)
+{
+ return make_number (FRAME_COLS (decode_any_frame (frame)));
+}
+
+DEFUN ("frame-text-lines", Fframe_text_lines, Sframe_text_lines, 0, 1, 0,
+ doc: /* Return height in lines of FRAME's text area. */)
+ (Lisp_Object frame)
+{
+ return make_number (FRAME_LINES (decode_any_frame (frame)));
+}
+
+DEFUN ("frame-total-cols", Fframe_total_cols, Sframe_total_cols, 0, 1, 0,
+ doc: /* Return total columns of FRAME. */)
+ (Lisp_Object frame)
+{
+ return make_number (FRAME_TOTAL_COLS (decode_any_frame (frame)));
+}
+
+DEFUN ("frame-text-width", Fframe_text_width, Sframe_text_width, 0, 1, 0,
+ doc: /* Return text area width of FRAME in pixels. */)
+ (Lisp_Object frame)
+{
+ return make_number (FRAME_TEXT_WIDTH (decode_any_frame (frame)));
+}
+
+DEFUN ("frame-text-height", Fframe_text_height, Sframe_text_height, 0, 1, 0,
+ doc: /* Return text area height of FRAME in pixels. */)
+ (Lisp_Object frame)
+{
+ return make_number (FRAME_TEXT_HEIGHT (decode_any_frame (frame)));
+}
+
+DEFUN ("frame-scroll-bar-width", Fscroll_bar_width, Sscroll_bar_width, 0, 1, 0,
+ doc: /* Return scroll bar width of FRAME in pixels. */)
+ (Lisp_Object frame)
+{
+ return make_number (decode_any_frame (frame)->scroll_bar_actual_width);
+}
+
+DEFUN ("frame-fringe-width", Ffringe_width, Sfringe_width, 0, 1, 0,
+ doc: /* Return fringe width of FRAME in pixels. */)
+ (Lisp_Object frame)
+{
+ return make_number (FRAME_TOTAL_FRINGE_WIDTH (decode_any_frame (frame)));
+}
+
+DEFUN ("frame-border-width", Fborder_width, Sborder_width, 0, 1, 0,
+ doc: /* Return border width of FRAME in pixels. */)
+ (Lisp_Object frame)
+{
+ return make_number (FRAME_INTERNAL_BORDER_WIDTH (decode_any_frame (frame)));
+}
+
+DEFUN ("frame-right-divider-width", Fright_divider_width, Sright_divider_width, 0, 1, 0,
+ doc: /* Return width (in pixels) of vertical window dividers on FRAME. */)
+ (Lisp_Object frame)
+{
+ return make_number (FRAME_RIGHT_DIVIDER_WIDTH (decode_any_frame (frame)));
+}
+
+DEFUN ("frame-bottom-divider-width", Fbottom_divider_width, Sbottom_divider_width, 0, 1, 0,
+ doc: /* Return width (in pixels) of horizontal window dividers on FRAME. */)
+ (Lisp_Object frame)
+{
+ return make_number (FRAME_BOTTOM_DIVIDER_WIDTH (decode_any_frame (frame)));
+}
-DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0,
- doc: /* Specify that the frame FRAME has LINES lines.
-If FRAME is nil, the selected frame is used. Optional third arg
-non-nil means that redisplay should use LINES lines but that the
-idea of the actual height of the frame should not be changed. */)
- (Lisp_Object frame, Lisp_Object lines, Lisp_Object pretend)
+DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 4, 0,
+ doc: /* Specify that the frame FRAME has HEIGHT text lines.
+Optional third arg PRETEND non-nil means that redisplay should use
+HEIGHT lines but that the idea of the actual height of the frame should
+not be changed. Optional fourth argument PIXELWISE non-nil means that
+FRAME should be HEIGHT pixels high. */)
+ (Lisp_Object frame, Lisp_Object height, Lisp_Object pretend, Lisp_Object pixelwise)
{
register struct frame *f = decode_live_frame (frame);
- CHECK_TYPE_RANGED_INTEGER (int, lines);
+ CHECK_TYPE_RANGED_INTEGER (int, height);
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
{
- if (XINT (lines) != FRAME_LINES (f))
- x_set_window_size (f, 1, FRAME_COLS (f), XINT (lines));
- do_pending_window_change (0);
+ if (NILP (pixelwise))
+ {
+ if (XINT (height) != FRAME_LINES (f))
+ x_set_window_size (f, 1, FRAME_COLS (f), XINT (height), 0);
+
+ do_pending_window_change (0);
+ }
+ else if (XINT (height) != FRAME_TEXT_HEIGHT (f))
+ {
+ x_set_window_size (f, 1, FRAME_TEXT_WIDTH (f), XINT (height), 1);
+ do_pending_window_change (0);
+ }
}
else
#endif
- change_frame_size (f, XINT (lines), 0, !NILP (pretend), 0, 0);
+ change_frame_size (f, 0, XINT (height), !NILP (pretend), 0, 0,
+ NILP (pixelwise) ? 0 : 1);
return Qnil;
}
-DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0,
- doc: /* Specify that the frame FRAME has COLS columns.
-If FRAME is nil, the selected frame is used. Optional third arg
-non-nil means that redisplay should use COLS columns but that the
-idea of the actual width of the frame should not be changed. */)
- (Lisp_Object frame, Lisp_Object cols, Lisp_Object pretend)
+DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 4, 0,
+ doc: /* Specify that the frame FRAME has WIDTH columns.
+Optional third arg PRETEND non-nil means that redisplay should use WIDTH
+columns but that the idea of the actual width of the frame should not
+be changed. Optional fourth argument PIXELWISE non-nil means that FRAME
+should be WIDTH pixels wide. */)
+ (Lisp_Object frame, Lisp_Object width, Lisp_Object pretend, Lisp_Object pixelwise)
{
register struct frame *f = decode_live_frame (frame);
- CHECK_TYPE_RANGED_INTEGER (int, cols);
+ CHECK_TYPE_RANGED_INTEGER (int, width);
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
{
- if (XINT (cols) != FRAME_COLS (f))
- x_set_window_size (f, 1, XINT (cols), FRAME_LINES (f));
- do_pending_window_change (0);
+ if (NILP (pixelwise))
+ {
+ if (XINT (width) != FRAME_COLS (f))
+ x_set_window_size (f, 1, XINT (width), FRAME_LINES (f), 0);
+
+ do_pending_window_change (0);
+ }
+ else if (XINT (width) != FRAME_TEXT_WIDTH (f))
+ {
+ x_set_window_size (f, 1, XINT (width), FRAME_TEXT_HEIGHT (f), 1);
+ do_pending_window_change (0);
+ }
}
else
#endif
- change_frame_size (f, 0, XINT (cols), !NILP (pretend), 0, 0);
+ change_frame_size (f, XINT (width), 0, !NILP (pretend), 0, 0,
+ NILP (pixelwise) ? 0 : 1);
return Qnil;
}
-DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0,
- doc: /* Sets size of FRAME to COLS by ROWS, measured in characters.
-If FRAME is nil, the selected frame is used. */)
- (Lisp_Object frame, Lisp_Object cols, Lisp_Object rows)
+DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 4, 0,
+ doc: /* Sets size of FRAME to WIDTH by HEIGHT, measured in characters.
+Optional argument PIXELWISE non-nil means to measure in pixels. */)
+ (Lisp_Object frame, Lisp_Object width, Lisp_Object height, Lisp_Object pixelwise)
{
register struct frame *f = decode_live_frame (frame);
- CHECK_TYPE_RANGED_INTEGER (int, cols);
- CHECK_TYPE_RANGED_INTEGER (int, rows);
+ CHECK_TYPE_RANGED_INTEGER (int, width);
+ CHECK_TYPE_RANGED_INTEGER (int, height);
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
{
- if (XINT (rows) != FRAME_LINES (f)
- || XINT (cols) != FRAME_COLS (f)
- || f->new_text_lines || f->new_text_cols)
- x_set_window_size (f, 1, XINT (cols), XINT (rows));
- do_pending_window_change (0);
+ if (!NILP (pixelwise)
+ ? (XINT (width) != FRAME_TEXT_WIDTH (f)
+ || XINT (height) != FRAME_TEXT_HEIGHT (f)
+ || f->new_height || f->new_width)
+ : (XINT (width) != FRAME_COLS (f)
+ || XINT (height) != FRAME_LINES (f)
+ || f->new_height || f->new_width))
+ {
+ x_set_window_size (f, 1, XINT (width), XINT (height),
+ NILP (pixelwise) ? 0 : 1);
+ do_pending_window_change (0);
+ }
}
else
#endif
- change_frame_size (f, XINT (rows), XINT (cols), 0, 0, 0);
+ change_frame_size (f, XINT (width), XINT (height), 0, 0, 0,
+ NILP (pixelwise) ? 0 : 1);
return Qnil;
}
@@ -2586,6 +2707,8 @@ static const struct frame_parm_table frame_parms[] =
{"icon-name", &Qicon_name},
{"icon-type", &Qicon_type},
{"internal-border-width", &Qinternal_border_width},
+ {"right-divider-width", &Qright_divider_width},
+ {"bottom-divider-width", &Qbottom_divider_width},
{"menu-bar-lines", &Qmenu_bar_lines},
{"mouse-color", &Qmouse_color},
{"name", &Qname},
@@ -2720,8 +2843,16 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist)
icon_left = icon_top = Qunbound;
/* Provide default values for HEIGHT and WIDTH. */
- width = (f->new_text_cols ? f->new_text_cols : FRAME_COLS (f));
- height = (f->new_text_lines ? f->new_text_lines : FRAME_LINES (f));
+ width = (f->new_width
+ ? (f->new_pixelwise
+ ? (f->new_width / FRAME_COLUMN_WIDTH (f))
+ : f->new_width)
+ : FRAME_COLS (f));
+ height = (f->new_height
+ ? (f->new_pixelwise
+ ? (f->new_height / FRAME_LINE_HEIGHT (f))
+ : f->new_height)
+ : FRAME_LINES (f));
/* Process foreground_color and background_color before anything else.
They are independent of other properties, but other properties (e.g.,
@@ -2847,15 +2978,16 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist)
{
Lisp_Object frame;
- check_frame_size (f, &height, &width);
+ /* Make this 1, eventually. */
+ check_frame_size (f, &width, &height, 0);
XSETFRAME (frame, f);
if (size_changed
&& (width != FRAME_COLS (f)
|| height != FRAME_LINES (f)
- || f->new_text_lines || f->new_text_cols))
- Fset_frame_size (frame, make_number (width), make_number (height));
+ || f->new_height || f->new_width))
+ Fset_frame_size (frame, make_number (width), make_number (height), Qnil);
if ((!NILP (left) || !NILP (top))
&& ! (left_no_change && top_no_change)
@@ -2963,6 +3095,10 @@ x_report_frame_params (struct frame *f, Lisp_Object *alistptr)
make_number (f->border_width));
store_in_alist (alistptr, Qinternal_border_width,
make_number (FRAME_INTERNAL_BORDER_WIDTH (f)));
+ store_in_alist (alistptr, Qright_divider_width,
+ make_number (FRAME_RIGHT_DIVIDER_WIDTH (f)));
+ store_in_alist (alistptr, Qbottom_divider_width,
+ make_number (FRAME_BOTTOM_DIVIDER_WIDTH (f)));
store_in_alist (alistptr, Qleft_fringe,
make_number (FRAME_LEFT_FRINGE_WIDTH (f)));
store_in_alist (alistptr, Qright_fringe,
@@ -3295,7 +3431,53 @@ x_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldva
if (FRAME_X_WINDOW (f) != 0)
{
- x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
+ x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 1);
+ SET_FRAME_GARBAGED (f);
+ do_pending_window_change (0);
+ }
+ else
+ SET_FRAME_GARBAGED (f);
+}
+
+void
+x_set_right_divider_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+{
+ int old = FRAME_RIGHT_DIVIDER_WIDTH (f);
+
+ CHECK_TYPE_RANGED_INTEGER (int, arg);
+ FRAME_RIGHT_DIVIDER_WIDTH (f) = XINT (arg);
+ if (FRAME_RIGHT_DIVIDER_WIDTH (f) < 0)
+ FRAME_RIGHT_DIVIDER_WIDTH (f) = 0;
+
+ if (FRAME_RIGHT_DIVIDER_WIDTH (f) == old)
+ return;
+
+ if (FRAME_X_WINDOW (f) != 0)
+ {
+ x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 1);
+ SET_FRAME_GARBAGED (f);
+ do_pending_window_change (0);
+ }
+ else
+ SET_FRAME_GARBAGED (f);
+}
+
+void
+x_set_bottom_divider_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+{
+ int old = FRAME_BOTTOM_DIVIDER_WIDTH (f);
+
+ CHECK_TYPE_RANGED_INTEGER (int, arg);
+ FRAME_BOTTOM_DIVIDER_WIDTH (f) = XINT (arg);
+ if (FRAME_BOTTOM_DIVIDER_WIDTH (f) < 0)
+ FRAME_BOTTOM_DIVIDER_WIDTH (f) = 0;
+
+ if (FRAME_BOTTOM_DIVIDER_WIDTH (f) == old)
+ return;
+
+ if (FRAME_X_WINDOW (f) != 0)
+ {
+ x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 1);
SET_FRAME_GARBAGED (f);
do_pending_window_change (0);
}
@@ -3361,7 +3543,8 @@ x_set_vertical_scroll_bars (struct frame *f, Lisp_Object arg, Lisp_Object oldval
However, if the window hasn't been created yet, we shouldn't
call x_set_window_size. */
if (FRAME_X_WINDOW (f))
- x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
+ x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f),
+ FRAME_TEXT_HEIGHT (f), 1);
do_pending_window_change (0);
}
}
@@ -3369,27 +3552,29 @@ x_set_vertical_scroll_bars (struct frame *f, Lisp_Object arg, Lisp_Object oldval
void
x_set_scroll_bar_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
- int wid = FRAME_COLUMN_WIDTH (f);
+ int unit = FRAME_COLUMN_WIDTH (f);
if (NILP (arg))
{
x_set_scroll_bar_default_width (f);
if (FRAME_X_WINDOW (f))
- x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
+ x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f),
+ FRAME_TEXT_HEIGHT (f), 1);
do_pending_window_change (0);
}
else if (RANGED_INTEGERP (1, arg, INT_MAX)
&& XFASTINT (arg) != FRAME_CONFIG_SCROLL_BAR_WIDTH (f))
{
FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = XFASTINT (arg);
- FRAME_CONFIG_SCROLL_BAR_COLS (f) = (XFASTINT (arg) + wid-1) / wid;
+ FRAME_CONFIG_SCROLL_BAR_COLS (f) = (XFASTINT (arg) + unit - 1) / unit;
if (FRAME_X_WINDOW (f))
- x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
+ x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f),
+ FRAME_TEXT_HEIGHT (f), 1);
do_pending_window_change (0);
}
- change_frame_size (f, 0, FRAME_COLS (f), 0, 0, 0);
+ change_frame_size (f, 0, 0, 0, 0, 0, 1);
XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.hpos = 0;
XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.x = 0;
}
@@ -4002,17 +4187,20 @@ x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p)
/* Default values if we fall through.
Actually, if that happens we should get
window manager prompting. */
+ SET_FRAME_WIDTH (f, DEFAULT_COLS * FRAME_COLUMN_WIDTH (f));
SET_FRAME_COLS (f, DEFAULT_COLS);
+ SET_FRAME_HEIGHT (f, DEFAULT_ROWS * FRAME_LINE_HEIGHT (f));
FRAME_LINES (f) = DEFAULT_ROWS;
+
/* Window managers expect that if program-specified
positions are not (0,0), they're intentional, not defaults. */
f->top_pos = 0;
f->left_pos = 0;
- /* Ensure that old new_text_cols and new_text_lines will not override the
+ /* Ensure that old new_width and new_height will not override the
values set here. */
/* ++KFS: This was specific to W32, but seems ok for all platforms */
- f->new_text_cols = f->new_text_lines = 0;
+ f->new_width = f->new_height = f->new_pixelwise = 0;
tem0 = x_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER);
tem1 = x_get_arg (dpyinfo, parms, Qwidth, 0, 0, RES_TYPE_NUMBER);
@@ -4053,7 +4241,7 @@ x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p)
change the frame size. This is done so that users can create
tall Emacs frames without having to guess how tall the tool-bar
will get. */
- if (toolbar_p && FRAME_TOOL_BAR_LINES (f))
+ if (toolbar_p && FRAME_TOOL_BAR_HEIGHT (f))
{
int margin, relief, bar_height;
@@ -4069,14 +4257,15 @@ x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p)
else
margin = 0;
+ /* PXW: We should be able to not round here. */
bar_height = DEFAULT_TOOL_BAR_IMAGE_HEIGHT + 2 * margin + 2 * relief;
FRAME_LINES (f) += (bar_height + FRAME_LINE_HEIGHT (f) - 1) / FRAME_LINE_HEIGHT (f);
}
compute_fringe_widths (f, 0);
- FRAME_PIXEL_WIDTH (f) = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, FRAME_COLS (f));
- FRAME_PIXEL_HEIGHT (f) = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, FRAME_LINES (f));
+ SET_FRAME_WIDTH (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f));
+ SET_FRAME_HEIGHT(f, FRAME_LINES (f) * FRAME_LINE_HEIGHT (f));
tem0 = x_get_arg (dpyinfo, parms, Qtop, 0, 0, RES_TYPE_NUMBER);
tem1 = x_get_arg (dpyinfo, parms, Qleft, 0, 0, RES_TYPE_NUMBER);
@@ -4465,6 +4654,16 @@ when the mouse is over clickable text. */);
The pointer becomes visible again when the mouse is moved. */);
Vmake_pointer_invisible = Qt;
+ DEFVAR_LISP ("focus-in-hook", Vfocus_in_hook,
+ doc: /* Normal hook run when a frame gains input focus. */);
+ Vfocus_in_hook = Qnil;
+ DEFSYM (Qfocus_in_hook, "focus-in-hook");
+
+ DEFVAR_LISP ("focus-out-hook", Vfocus_out_hook,
+ doc: /* Normal hook run when a frame loses input focus. */);
+ Vfocus_out_hook = Qnil;
+ DEFSYM (Qfocus_out_hook, "focus-out-hook");
+
DEFVAR_LISP ("delete-frame-functions", Vdelete_frame_functions,
doc: /* Functions run before deleting a frame.
The functions are run with one arg, the frame to be deleted.
@@ -4519,6 +4718,12 @@ handles focus, since there is no way in general for Emacs to find out
automatically. See also `mouse-autoselect-window'. */);
focus_follows_mouse = 0;
+ DEFVAR_BOOL ("frame-resize-pixelwise", frame_resize_pixelwise,
+ doc: /* Non-nil means frames are resized pixelwise.
+If this is nil, resizing a frame will round sizes to the frame's
+current values of `frame-char-height' and `frame-char-width'. */);
+ frame_resize_pixelwise = 0;
+
staticpro (&Vframe_list);
defsubr (&Sframep);
@@ -4526,8 +4731,6 @@ automatically. See also `mouse-autoselect-window'. */);
defsubr (&Swindow_system);
defsubr (&Smake_terminal_frame);
defsubr (&Shandle_switch_frame);
- defsubr (&Shandle_focus_in);
- defsubr (&Shandle_focus_out);
defsubr (&Sselect_frame);
defsubr (&Sselected_frame);
defsubr (&Sframe_list);
@@ -4560,6 +4763,16 @@ automatically. See also `mouse-autoselect-window'. */);
defsubr (&Sframe_char_width);
defsubr (&Sframe_pixel_height);
defsubr (&Sframe_pixel_width);
+ defsubr (&Sframe_text_cols);
+ defsubr (&Sframe_text_lines);
+ defsubr (&Sframe_total_cols);
+ defsubr (&Sframe_text_width);
+ defsubr (&Sframe_text_height);
+ defsubr (&Sscroll_bar_width);
+ defsubr (&Sfringe_width);
+ defsubr (&Sborder_width);
+ defsubr (&Sright_divider_width);
+ defsubr (&Sbottom_divider_width);
defsubr (&Stool_bar_pixel_width);
defsubr (&Sset_frame_height);
defsubr (&Sset_frame_width);
diff --git a/src/frame.h b/src/frame.h
index 8dfcaae114b..8369cf6b17e 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -214,45 +214,64 @@ struct frame
/* Nonzero means that cursor type has been changed. */
unsigned cursor_type_changed : 1;
+ /* True if it needs to be redisplayed. */
+ unsigned redisplay : 1;
+
/* Margin at the top of the frame. Used to display the tool-bar. */
int tool_bar_lines;
+ /* Pixel height of tool bar. */
+ int tool_bar_height;
+
int n_tool_bar_rows;
int n_tool_bar_items;
- /* A buffer for decode_mode_line. */
+ /* A buffer for decode_mode_line. */
char *decode_mode_spec_buffer;
- /* See do_line_insertion_deletion_costs for info on these arrays. */
- /* Cost of inserting 1 line on this frame */
+ /* See do_line_insertion_deletion_costs for info on these arrays. */
+ /* Cost of inserting 1 line on this frame. */
int *insert_line_cost;
- /* Cost of deleting 1 line on this frame */
+ /* Cost of deleting 1 line on this frame. */
int *delete_line_cost;
- /* Cost of inserting n lines on this frame */
+ /* Cost of inserting n lines on this frame. */
int *insert_n_lines_cost;
- /* Cost of deleting n lines on this frame */
+ /* Cost of deleting n lines on this frame. */
int *delete_n_lines_cost;
- /* Size of this frame, excluding fringes, scroll bars etc.,
- in units of canonical characters. */
- int text_lines, text_cols;
+ /* Text width of this frame (excluding fringes, scroll bars and
+ internal border width) and text height (excluding internal border
+ width) in units of canonical characters. */
+ int text_cols, text_lines;
+
+ /* Total width of this frame (including fringes and scroll bars) in
+ units of canonical characters. */
+ int total_cols;
+
+ /* Text width of this frame (excluding fringes, scroll bars and
+ internal border width) and text height (excluding internal border
+ width) in pixels. */
+ int text_width, text_height;
- /* Total size of this frame (i.e. its native window), in units of
- canonical characters. */
- int total_lines, total_cols;
+ /* New text height and width for pending size change. 0 if no change
+ pending. These values represent pixels or canonical character units
+ according to the value of new_pixelwise and correlate to the the
+ text width/height of the frame. */
+ int new_width, new_height;
- /* New text height and width for pending size change.
- 0 if no change pending. */
- int new_text_lines, new_text_cols;
+ /* Whether new_height and new_width shall be interpreted
+ in pixels. */
+ bool new_pixelwise;
/* Pixel position of the frame window (x and y offsets in root window). */
int left_pos, top_pos;
- /* Size of the frame window in pixels. */
- int pixel_height, pixel_width;
+ /* Size of the frame window (including internal border widths) in
+ pixels. */
+ int pixel_width, pixel_height;
/* These many pixels are the difference between the outer window (i.e. the
- left and top of the window manager decoration) and FRAME_X_WINDOW. */
+ left and top of the window manager decoration) and FRAME_X_WINDOW. */
int x_pixels_diff, y_pixels_diff;
/* This is the gravity value for the specified window position. */
@@ -269,6 +288,10 @@ struct frame
a highlighting is displayed inside the internal border. */
int internal_border_width;
+ /* Width of borders between this frame's windows. */
+ int right_divider_width;
+ int bottom_divider_width;
+
/* Canonical X unit. Width of default font, in pixels. */
int column_width;
@@ -281,23 +304,23 @@ struct frame
enum output_method output_method;
/* The terminal device that this frame uses. If this is NULL, then
- the frame has been deleted. */
+ the frame has been deleted. */
struct terminal *terminal;
/* Device-dependent, frame-local auxiliary data used for displaying
the contents. When the frame is deleted, this data is deleted as
- well. */
+ well. */
union output_data
{
- struct tty_output *tty; /* termchar.h */
- struct x_output *x; /* xterm.h */
- struct w32_output *w32; /* w32term.h */
- struct ns_output *ns; /* nsterm.h */
+ struct tty_output *tty; /* From termchar.h. */
+ struct x_output *x; /* From xterm.h. */
+ struct w32_output *w32; /* From w32term.h. */
+ struct ns_output *ns; /* From nsterm.h. */
intptr_t nothing;
}
output_data;
- /* List of font-drivers available on the frame. */
+ /* List of font-drivers available on the frame. */
struct font_driver_list *font_driver_list;
/* List of data specific to font-driver and frame, but common to
faces. */
@@ -313,39 +336,38 @@ struct frame
/* The extra width (in pixels) currently allotted for fringes. */
int left_fringe_width, right_fringe_width;
- /* See FULLSCREEN_ enum below */
+ /* See FULLSCREEN_ enum below. */
enum fullscreen_type want_fullscreen;
/* Number of lines of menu bar. */
int menu_bar_lines;
-#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \
- || defined (HAVE_NS) || defined (USE_GTK)
- /* Nonzero means using a menu bar that comes from the X toolkit. */
- unsigned int external_menu_bar : 1;
-#endif
+ /* Pixel height of menubar. */
+ int menu_bar_height;
#if defined (HAVE_X_WINDOWS)
/* Used by x_wait_for_event when watching for an X event on this frame. */
int wait_event_type;
#endif
+#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \
+ || defined (HAVE_NS) || defined (USE_GTK)
+ /* Nonzero means using a menu bar that comes from the X toolkit. */
+ unsigned external_menu_bar : 1;
+#endif
+
/* Next two bitfields are mutually exclusive. They might both be
zero if the frame has been made invisible without an icon. */
/* Nonzero if the frame is currently displayed; we check
it to see if we should bother updating the frame's contents.
- Note that, since invisible frames aren't updated, whenever a
- frame becomes visible again, it must be marked as garbaged.
-
On ttys and on Windows NT/9X, to avoid wasting effort updating
visible frames that are actually completely obscured by other
windows on the display, we bend the meaning of visible slightly:
if equal to 2, then the frame is obscured - we still consider
it to be "visible" as seen from lisp, but we don't bother
- updating it. We must take care to garbage the frame when it
- ceases to be obscured though. See SET_FRAME_VISIBLE below. */
+ updating it. */
unsigned visible : 2;
/* Nonzero if the frame is currently iconified. Do not
@@ -379,10 +401,10 @@ struct frame
/* Nonzero if the mouse has moved on this display device
since the last time we checked. */
- unsigned mouse_moved :1;
+ unsigned mouse_moved : 1;
- /* Nonzero means that the pointer is invisible. */
- unsigned pointer_invisible :1;
+ /* Nonzero means that the pointer is invisible. */
+ unsigned pointer_invisible : 1;
/* Nonzero means that all windows except mini-window and
selected window on this frame have frozen window starts. */
@@ -659,20 +681,28 @@ default_pixels_per_inch_y (void)
(WINDOWP (f->minibuffer_window) \
&& XFRAME (XWINDOW (f->minibuffer_window)->frame) == f)
+/* Pixel width of frame F. */
+#define FRAME_PIXEL_WIDTH(f) ((f)->pixel_width)
+
/* Pixel height of frame F, including non-toolkit menu bar and
non-toolkit tool bar lines. */
#define FRAME_PIXEL_HEIGHT(f) ((f)->pixel_height)
-/* Pixel width of frame F. */
-#define FRAME_PIXEL_WIDTH(f) ((f)->pixel_width)
+/* Width of frame F, measured in canonical character columns,
+ not including scroll bars if any. */
+#define FRAME_COLS(f) (f)->text_cols
/* Height of frame F, measured in canonical lines, including
non-toolkit menu bar and non-toolkit tool bar lines. */
#define FRAME_LINES(f) (f)->text_lines
-/* Width of frame F, measured in canonical character columns,
- not including scroll bars if any. */
-#define FRAME_COLS(f) (f)->text_cols
+/* Width of frame F, measured in pixels not including the width for
+ fringes, scroll bar, and internal borders. */
+#define FRAME_TEXT_WIDTH(f) (f)->text_width
+
+/* Height of frame F, measured in pixels not including the height
+ for internal borders. */
+#define FRAME_TEXT_HEIGHT(f) (f)->text_height
/* Number of lines of frame F used for menu bar.
This is relevant on terminal frames and on
@@ -680,6 +710,9 @@ default_pixels_per_inch_y (void)
These lines are counted in FRAME_LINES. */
#define FRAME_MENU_BAR_LINES(f) (f)->menu_bar_lines
+/* Pixel height of frame F's menu bar. */
+#define FRAME_MENU_BAR_HEIGHT(f) (f)->menu_bar_height
+
/* Nonzero if this frame should display a tool bar
in a way that does not use any text lines. */
#if defined (USE_GTK) || defined (HAVE_NS)
@@ -689,19 +722,18 @@ default_pixels_per_inch_y (void)
#endif
/* Number of lines of frame F used for the tool-bar. */
-
#define FRAME_TOOL_BAR_LINES(f) (f)->tool_bar_lines
+/* Pixel height of frame F's tool-bar. */
+#define FRAME_TOOL_BAR_HEIGHT(f) (f)->tool_bar_height
/* Lines above the top-most window in frame F. */
-
#define FRAME_TOP_MARGIN(F) \
(FRAME_MENU_BAR_LINES (F) + FRAME_TOOL_BAR_LINES (F))
-/* Pixel height of the top margin above. */
-
-#define FRAME_TOP_MARGIN_HEIGHT(f) \
- (FRAME_TOP_MARGIN (f) * FRAME_LINE_HEIGHT (f))
+/* Pixel height of frame F's top margin. */
+#define FRAME_TOP_MARGIN_HEIGHT(F) \
+ (FRAME_MENU_BAR_HEIGHT (F) + FRAME_TOOL_BAR_HEIGHT (F))
/* Nonzero if this frame should display a menu bar
in a way that does not use any text lines. */
@@ -720,7 +752,8 @@ default_pixels_per_inch_y (void)
#define FRAME_ICONIFIED_P(f) (f)->iconified
/* Mark frame F as currently garbaged. */
-#define SET_FRAME_GARBAGED(f) (frame_garbaged = 1, f->garbaged = 1)
+#define SET_FRAME_GARBAGED(f) \
+ (frame_garbaged = true, fset_redisplay (f), f->garbaged = true)
/* Nonzero if frame F is currently garbaged. */
#define FRAME_GARBAGED_P(f) (f)->garbaged
@@ -788,7 +821,7 @@ default_pixels_per_inch_y (void)
#define FRAME_LEFT_SCROLL_BAR_AREA_WIDTH(f) \
(FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \
- ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \
+ ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f) \
: 0)
/* Width of a scroll bar in frame F, measured in columns (characters),
@@ -804,7 +837,7 @@ default_pixels_per_inch_y (void)
#define FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH(f) \
(FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \
- ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \
+ ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f) \
: 0)
/* Actual width of a scroll bar in frame F, measured in columns. */
@@ -818,29 +851,36 @@ default_pixels_per_inch_y (void)
#define FRAME_SCROLL_BAR_AREA_WIDTH(f) \
(FRAME_HAS_VERTICAL_SCROLL_BARS (f) \
- ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \
+ ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f) \
: 0)
/* Total width of frame F, in columns (characters),
including the width used by scroll bars if any. */
-
#define FRAME_TOTAL_COLS(f) ((f)->total_cols)
-/* Set the width of frame F to VAL.
- VAL is the width of a full-frame window,
- not including scroll bars and fringes. */
-
-#define SET_FRAME_COLS(f, val) \
- (FRAME_COLS (f) = (val), \
- (f)->total_cols = FRAME_TOTAL_COLS_ARG (f, FRAME_COLS (f)))
-
-/* Given a value WIDTH for frame F's nominal width,
- return the value that FRAME_TOTAL_COLS should have. */
-
-#define FRAME_TOTAL_COLS_ARG(f, width) \
- ((width) \
- + FRAME_SCROLL_BAR_COLS (f) \
- + FRAME_FRINGE_COLS (f))
+/* Set the character widths of frame F. WIDTH specifies a nominal
+ character text width. */
+#define SET_FRAME_COLS(f, width) \
+ ((f)->text_cols = (width), \
+ (f)->total_cols = ((width) \
+ + FRAME_SCROLL_BAR_COLS (f) \
+ + FRAME_FRINGE_COLS (f)))
+
+/* Set the pixel widths of frame F. WIDTH specifies a nominal pixel
+ text width. */
+#define SET_FRAME_WIDTH(f, width) \
+ ((f)->text_width = (width), \
+ (f)->pixel_width = ((width) \
+ + FRAME_SCROLL_BAR_AREA_WIDTH (f) \
+ + FRAME_TOTAL_FRINGE_WIDTH (f) \
+ + 2 * FRAME_INTERNAL_BORDER_WIDTH (f)))
+
+/* Set the pixel heights of frame F. HEIGHT specifies a nominal pixel
+ text width. */
+#define SET_FRAME_HEIGHT(f, height) \
+ ((f)->text_height = (height), \
+ (f)->pixel_height = ((height) \
+ + 2 * FRAME_INTERNAL_BORDER_WIDTH (f)))
/* Maximum + 1 legitimate value for FRAME_CURSOR_X. */
@@ -911,11 +951,14 @@ default_pixels_per_inch_y (void)
} \
} while (0)
-/* Set visibility of frame F, marking F as garbaged if needed. */
+/* Set visibility of frame F.
+ We call redisplay_other_windows to make sure the frame gets redisplayed
+ if some changes were applied to it while it wasn't visible (and hence
+ wasn't redisplayed). */
-#define SET_FRAME_VISIBLE(f, v) \
- (((f)->visible == 0 || ((f)->visible == 2)) \
- && ((v) == 1) ? SET_FRAME_GARBAGED (f) : 0, \
+#define SET_FRAME_VISIBLE(f, v) \
+ (((f)->visible == 0 || ((f)->visible == 2)) && ((v) == 1) \
+ ? redisplay_other_windows () : 0, \
(f)->visible = (eassert (0 <= (v) && (v) <= 2), (v)))
/* Set iconify of frame F. */
@@ -1001,11 +1044,13 @@ extern Lisp_Object Vframe_list;
#define FRAME_TOTAL_FRINGE_WIDTH(F) \
(FRAME_LEFT_FRINGE_WIDTH (F) + FRAME_RIGHT_FRINGE_WIDTH (F))
-
/* Pixel-width of internal border lines */
-
#define FRAME_INTERNAL_BORDER_WIDTH(F) ((F)->internal_border_width)
+/* Pixel-size of window border lines */
+#define FRAME_RIGHT_DIVIDER_WIDTH(F) ((F)->right_divider_width)
+#define FRAME_BOTTOM_DIVIDER_WIDTH(F) ((F)->bottom_divider_width)
+
#else /* not HAVE_WINDOW_SYSTEM */
#define FRAME_FRINGE_COLS(F) 0
@@ -1013,11 +1058,10 @@ extern Lisp_Object Vframe_list;
#define FRAME_LEFT_FRINGE_WIDTH(F) 0
#define FRAME_RIGHT_FRINGE_WIDTH(F) 0
#define FRAME_INTERNAL_BORDER_WIDTH(F) 0
+#define FRAME_RIGHT_DIVIDER_WIDTH(F) 0
+#define FRAME_BOTTOM_DIVIDER_WIDTH(F) 0
#endif /* not HAVE_WINDOW_SYSTEM */
-
-
-
/***********************************************************************
Conversion between canonical units and pixels
@@ -1074,58 +1118,81 @@ extern Lisp_Object Vframe_list;
Return the upper/left pixel position of the character cell on frame F
at ROW/COL. */
-#define FRAME_LINE_TO_PIXEL_Y(f, row) \
+#define FRAME_LINE_TO_PIXEL_Y(f, row) \
(((row) < FRAME_TOP_MARGIN (f) ? 0 : FRAME_INTERNAL_BORDER_WIDTH (f)) \
+ (row) * FRAME_LINE_HEIGHT (f))
-#define FRAME_COL_TO_PIXEL_X(f, col) \
- (FRAME_INTERNAL_BORDER_WIDTH (f) \
+#define FRAME_COL_TO_PIXEL_X(f, col) \
+ (FRAME_INTERNAL_BORDER_WIDTH (f) \
+ (col) * FRAME_COLUMN_WIDTH (f))
/* Return the pixel width/height of frame F if it has
COLS columns/LINES rows. */
#define FRAME_TEXT_COLS_TO_PIXEL_WIDTH(f, cols) \
- (FRAME_COL_TO_PIXEL_X (f, cols) \
- + (f)->scroll_bar_actual_width \
- + FRAME_TOTAL_FRINGE_WIDTH (f) \
+ (FRAME_COL_TO_PIXEL_X (f, cols) \
+ + FRAME_SCROLL_BAR_AREA_WIDTH (f) \
+ + FRAME_TOTAL_FRINGE_WIDTH (f) \
+ FRAME_INTERNAL_BORDER_WIDTH (f))
#define FRAME_TEXT_LINES_TO_PIXEL_HEIGHT(f, lines) \
- ((lines) * FRAME_LINE_HEIGHT (f) \
+ ((lines) * FRAME_LINE_HEIGHT (f) \
+ 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
-
/* Return the row/column (zero-based) of the character cell containing
the pixel on FRAME at Y/X. */
-#define FRAME_PIXEL_Y_TO_LINE(f, y) \
- (((y) < FRAME_TOP_MARGIN_HEIGHT (f) \
- ? (y) \
+#define FRAME_PIXEL_Y_TO_LINE(f, y) \
+ (((y) < FRAME_TOP_MARGIN_HEIGHT (f) \
+ ? (y) \
: ((y) < FRAME_TOP_MARGIN_HEIGHT (f) + FRAME_INTERNAL_BORDER_WIDTH (f) \
? (y) - (FRAME_TOP_MARGIN_HEIGHT (f) + FRAME_INTERNAL_BORDER_WIDTH (f) \
- /* Arrange for the division to round down. */ \
- + FRAME_LINE_HEIGHT (f) - 1) \
- : (y) - FRAME_INTERNAL_BORDER_WIDTH (f))) \
+ /* Arrange for the division to round down. */ \
+ + FRAME_LINE_HEIGHT (f) - 1) \
+ : (y) - FRAME_INTERNAL_BORDER_WIDTH (f))) \
/ FRAME_LINE_HEIGHT (f))
-#define FRAME_PIXEL_X_TO_COL(f, x) \
+#define FRAME_PIXEL_X_TO_COL(f, x) \
(((x) - FRAME_INTERNAL_BORDER_WIDTH (f)) \
/ FRAME_COLUMN_WIDTH (f))
/* How many columns/rows of text can we fit in WIDTH/HEIGHT pixels on
frame F? */
-#define FRAME_PIXEL_WIDTH_TO_TEXT_COLS(f, width) \
- (FRAME_PIXEL_X_TO_COL (f, ((width) \
- - FRAME_INTERNAL_BORDER_WIDTH (f) \
- - FRAME_TOTAL_FRINGE_WIDTH (f) \
- - (f)->scroll_bar_actual_width)))
+#define FRAME_PIXEL_WIDTH_TO_TEXT_COLS(f, width) \
+ (FRAME_PIXEL_X_TO_COL (f, ((width) \
+ - FRAME_INTERNAL_BORDER_WIDTH (f) \
+ - FRAME_TOTAL_FRINGE_WIDTH (f) \
+ - FRAME_SCROLL_BAR_AREA_WIDTH (f)))) \
-#define FRAME_PIXEL_HEIGHT_TO_TEXT_LINES(f, height) \
- (FRAME_PIXEL_Y_TO_LINE (f, ((height) \
+#define FRAME_PIXEL_HEIGHT_TO_TEXT_LINES(f, height) \
+ (FRAME_PIXEL_Y_TO_LINE (f, ((height) \
- FRAME_INTERNAL_BORDER_WIDTH (f))))
+/* Return the pixel width/height of frame F with a text size of
+ width/height. */
+
+#define FRAME_TEXT_TO_PIXEL_WIDTH(f, width) \
+ ((width) \
+ + FRAME_SCROLL_BAR_AREA_WIDTH (f) \
+ + FRAME_TOTAL_FRINGE_WIDTH (f) \
+ + 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
+
+#define FRAME_TEXT_TO_PIXEL_HEIGHT(f, height) \
+ ((height) + 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
+
+/* Return the text width/height of frame F with a pixel size of
+ width/height. */
+
+#define FRAME_PIXEL_TO_TEXT_WIDTH(f, width) \
+ ((width) \
+ - FRAME_SCROLL_BAR_AREA_WIDTH (f) \
+ - FRAME_TOTAL_FRINGE_WIDTH (f) \
+ - 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
+
+#define FRAME_PIXEL_TO_TEXT_HEIGHT(f, height) \
+ ((height) - 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
+
/* Value is the smallest width of any character in any font on frame F. */
#define FRAME_SMALLEST_CHAR_WIDTH(f) \
@@ -1148,6 +1215,7 @@ extern Lisp_Object Qfont;
extern Lisp_Object Qbackground_color, Qforeground_color;
extern Lisp_Object Qicon, Qicon_name, Qicon_type, Qicon_left, Qicon_top;
extern Lisp_Object Qinternal_border_width;
+extern Lisp_Object Qright_divider_width, Qbottom_divider_width;
extern Lisp_Object Qtooltip;
extern Lisp_Object Qmenu_bar_lines, Qtool_bar_lines, Qtool_bar_position;
extern Lisp_Object Qmouse_color;
@@ -1211,6 +1279,10 @@ extern void x_set_fringe_width (struct frame *, Lisp_Object, Lisp_Object);
extern void x_set_border_width (struct frame *, Lisp_Object, Lisp_Object);
extern void x_set_internal_border_width (struct frame *, Lisp_Object,
Lisp_Object);
+extern void x_set_right_divider_width (struct frame *, Lisp_Object,
+ Lisp_Object);
+extern void x_set_bottom_divider_width (struct frame *, Lisp_Object,
+ Lisp_Object);
extern void x_set_visibility (struct frame *, Lisp_Object, Lisp_Object);
extern void x_set_autoraise (struct frame *, Lisp_Object, Lisp_Object);
extern void x_set_autolower (struct frame *, Lisp_Object, Lisp_Object);
@@ -1234,7 +1306,7 @@ extern Lisp_Object display_x_get_resource (Display_Info *,
extern void set_frame_menubar (struct frame *f, bool first_time, bool deep_p);
extern void x_set_window_size (struct frame *f, int change_grav,
- int cols, int rows);
+ int width, int height, bool pixelwise);
extern Lisp_Object x_get_focus_frame (struct frame *);
extern void x_set_mouse_position (struct frame *f, int h, int v);
extern void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
@@ -1243,9 +1315,7 @@ extern void x_make_frame_invisible (struct frame *f);
extern void x_iconify_frame (struct frame *f);
extern void x_set_frame_alpha (struct frame *f);
extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_tool_bar_lines (struct frame *f,
- Lisp_Object value,
- Lisp_Object oldval);
+extern void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
extern void x_activate_menubar (struct frame *);
extern void x_real_positions (struct frame *, int *, int *);
extern void free_frame_menubar (struct frame *);
diff --git a/src/fringe.c b/src/fringe.c
index 9c77e6557f4..db4f92d6ce4 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -659,6 +659,10 @@ draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int o
{
/* If W has a vertical border to its left, don't draw over it. */
wd -= ((!WINDOW_LEFTMOST_P (w)
+ /* This could be wrong when we allow window local
+ right dividers - but the window on the left is hard
+ to get. */
+ && !FRAME_RIGHT_DIVIDER_WIDTH (f)
&& !WINDOW_HAS_VERTICAL_SCROLL_BAR (w)
/* But don't reduce the fringe width if the window
has a left margin, because that means we are not
diff --git a/src/ftfont.c b/src/ftfont.c
index 224b8e82500..6a2303ab4a7 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -1478,7 +1478,6 @@ ftfont_get_bitmap (struct font *font, unsigned int code, struct font_bitmap *bit
bitmap->left = ft_face->glyph->bitmap_left;
bitmap->top = ft_face->glyph->bitmap_top;
bitmap->advance = ft_face->glyph->metrics.horiAdvance >> 6;
- bitmap->extra = NULL;
return 0;
}
diff --git a/src/gnutls.c b/src/gnutls.c
index 19617cea4b2..9ea3f59100d 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -56,8 +56,10 @@ static Lisp_Object QCgnutls_bootprop_verify_hostname_error;
static Lisp_Object QCgnutls_bootprop_callbacks_verify;
static void gnutls_log_function (int, const char *);
-static void gnutls_audit_log_function (gnutls_session_t, const char *);
static void gnutls_log_function2 (int, const char*, const char*);
+#ifdef HAVE_GNUTLS3
+static void gnutls_audit_log_function (gnutls_session_t, const char *);
+#endif
#ifdef WINDOWSNT
@@ -262,6 +264,7 @@ init_gnutls_functions (void)
#endif /* !WINDOWSNT */
+#ifdef HAVE_GNUTLS3
/* Function to log a simple audit message. */
static void
gnutls_audit_log_function (gnutls_session_t session, const char* string)
@@ -271,6 +274,7 @@ gnutls_audit_log_function (gnutls_session_t session, const char* string)
message ("gnutls.c: [audit] %s", string);
}
}
+#endif
/* Function to log a simple message. */
static void
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 192b64a7e62..ef422989c61 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -904,7 +904,7 @@ xg_clear_under_internal_border (struct frame *f)
void
xg_frame_resized (struct frame *f, int pixelwidth, int pixelheight)
{
- int rows, columns;
+ int width, height;
if (pixelwidth == -1 && pixelheight == -1)
{
@@ -916,11 +916,11 @@ xg_frame_resized (struct frame *f, int pixelwidth, int pixelheight)
}
- rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelheight);
- columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth);
+ width = FRAME_PIXEL_TO_TEXT_WIDTH (f, pixelwidth);
+ height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, pixelheight);
- if (columns != FRAME_COLS (f)
- || rows != FRAME_LINES (f)
+ if (width != FRAME_TEXT_WIDTH (f)
+ || height != FRAME_TEXT_HEIGHT (f)
|| pixelwidth != FRAME_PIXEL_WIDTH (f)
|| pixelheight != FRAME_PIXEL_HEIGHT (f))
{
@@ -928,7 +928,7 @@ xg_frame_resized (struct frame *f, int pixelwidth, int pixelheight)
FRAME_PIXEL_HEIGHT (f) = pixelheight;
xg_clear_under_internal_border (f);
- change_frame_size (f, rows, columns, 0, 1, 0);
+ change_frame_size (f, width, height, 0, 1, 0, 1);
SET_FRAME_GARBAGED (f);
cancel_mouse_face (f);
}
@@ -938,38 +938,23 @@ xg_frame_resized (struct frame *f, int pixelwidth, int pixelheight)
COLUMNS/ROWS is the size the edit area shall have after the resize. */
void
-xg_frame_set_char_size (struct frame *f, int cols, int rows)
+xg_frame_set_char_size (struct frame *f, int width, int height)
{
- int pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows)
- + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
- int pixelwidth;
+ int pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width);
+ int pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height);
if (FRAME_PIXEL_HEIGHT (f) == 0)
return;
- /* Take into account the size of the scroll bar. Always use the
- number of columns occupied by the scroll bar here otherwise we
- might end up with a frame width that is not a multiple of the
- frame's character width which is bad for vertically split
- windows. */
- f->scroll_bar_actual_width
- = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
-
- compute_fringe_widths (f, 0);
-
- /* FRAME_TEXT_COLS_TO_PIXEL_WIDTH uses scroll_bar_actual_width, so call it
- after calculating that value. */
- pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols)
- + FRAME_TOOLBAR_WIDTH (f);
-
-
/* Do this before resize, as we don't know yet if we will be resized. */
xg_clear_under_internal_border (f);
/* Must resize our top level widget. Font size may have changed,
but not rows/cols. */
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
- pixelwidth, pixelheight);
+ pixelwidth + FRAME_TOOLBAR_WIDTH (f),
+ pixelheight + FRAME_TOOLBAR_HEIGHT (f)
+ + FRAME_MENUBAR_HEIGHT (f));
x_wm_set_size_hint (f, 0, 0);
SET_FRAME_GARBAGED (f);
@@ -990,11 +975,7 @@ xg_frame_set_char_size (struct frame *f, int cols, int rows)
x_wait_for_event (f, ConfigureNotify);
}
else
- {
- change_frame_size (f, rows, cols, 0, 1, 0);
- FRAME_PIXEL_WIDTH (f) = pixelwidth;
- FRAME_PIXEL_HEIGHT (f) = pixelheight;
- }
+ change_frame_size (f, width, height, 0, 1, 0, 1);
}
/* Handle height/width changes (i.e. add/remove/move menu/toolbar).
@@ -1098,7 +1079,7 @@ style_changed_cb (GObject *go,
&& FRAME_X_DISPLAY (f) == dpy)
{
x_set_scroll_bar_default_width (f);
- xg_frame_set_char_size (f, FRAME_COLS (f), FRAME_LINES (f));
+ xg_frame_set_char_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f));
}
}
}
@@ -1381,7 +1362,7 @@ x_wm_set_size_hint (struct frame *f, long int flags, bool user_position)
base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 1)
+ FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
- check_frame_size (f, &min_rows, &min_cols);
+ check_frame_size (f, &min_cols, &min_rows, 0);
if (min_cols > 0) --min_cols; /* We used one col in base_width = ... 1); */
if (min_rows > 0) --min_rows; /* We used one row in base_height = ... 1); */
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 1c26d2aa44b..a2c5bb3ee76 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -139,7 +139,7 @@ extern void xg_change_toolbar_position (struct frame *f, Lisp_Object pos);
extern void xg_frame_resized (struct frame *f,
int pixelwidth,
int pixelheight);
-extern void xg_frame_set_char_size (struct frame *f, int cols, int rows);
+extern void xg_frame_set_char_size (struct frame *f, int width, int height);
extern GtkWidget * xg_win_to_widget (Display *dpy, Window wdesc);
extern void xg_display_open (char *display_name, Display **dpy);
diff --git a/src/image.c b/src/image.c
index 89e4f863d53..38a92277299 100644
--- a/src/image.c
+++ b/src/image.c
@@ -8105,7 +8105,7 @@ imagemagick_compute_animated_image (MagickWand *super_wand, int ino)
{
/* Sanity check. This shouldn't happen, but apparently
also does in some pictures. */
- if (x + source_left > dest_width)
+ if (x + source_left > dest_width - 1)
break;
/* Normally we only copy over non-transparent pixels,
but if the disposal method is "Background", then we
@@ -9517,7 +9517,7 @@ A cross is always drawn on black & white displays. */);
DEFVAR_LISP ("x-bitmap-file-path", Vx_bitmap_file_path,
doc: /* List of directories to search for window system bitmap files. */);
- Vx_bitmap_file_path = decode_env_path (0, PATH_BITMAPS);
+ Vx_bitmap_file_path = decode_env_path (0, PATH_BITMAPS, 0);
DEFVAR_LISP ("image-cache-eviction-delay", Vimage_cache_eviction_delay,
doc: /* Maximum time after which images are removed from the cache.
diff --git a/src/indent.c b/src/indent.c
index 891b42788ed..502611b534a 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1146,7 +1146,7 @@ compute_motion (ptrdiff_t from, ptrdiff_t frombyte, EMACS_INT fromvpos,
/* Negative width means use all available text columns. */
if (width < 0)
{
- width = window_body_cols (win);
+ width = window_body_width (win, 0);
/* We must make room for continuation marks if we don't have fringes. */
#ifdef HAVE_WINDOW_SYSTEM
if (!FRAME_WINDOW_P (XFRAME (win->frame)))
@@ -1756,7 +1756,7 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */)
? window_internal_height (w)
: XINT (XCDR (topos))),
(NILP (topos)
- ? (window_body_cols (w)
+ ? (window_body_width (w, 0)
- (
#ifdef HAVE_WINDOW_SYSTEM
FRAME_WINDOW_P (XFRAME (w->frame)) ? 0 :
diff --git a/src/insdel.c b/src/insdel.c
index 8de4f095396..db7ac0e3ad5 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1804,11 +1804,7 @@ prepare_to_modify_buffer_1 (ptrdiff_t start, ptrdiff_t end,
if (!NILP (BVAR (current_buffer, read_only)))
Fbarf_if_buffer_read_only ();
- /* If we're modifying the buffer other than shown in a selected window,
- let redisplay consider other windows if this buffer is visible. */
- if (XBUFFER (XWINDOW (selected_window)->contents) != current_buffer
- && buffer_window_count (current_buffer))
- windows_or_buffers_changed = 20;
+ bset_redisplay (current_buffer);
if (buffer_intervals (current_buffer))
{
diff --git a/src/intervals.c b/src/intervals.c
index 5aa68a359d6..0e3b684f570 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -2232,7 +2232,7 @@ get_local_map (ptrdiff_t position, struct buffer *buffer, Lisp_Object type)
editing a field with a `local-map' property, we want insertion at the end
to obey the `local-map' property. */
if (NILP (prop))
- prop = get_pos_property (lispy_position, type, lispy_buffer);
+ prop = Fget_pos_property (lispy_position, type, lispy_buffer);
SET_BUF_BEGV_BOTH (buffer, old_begv, old_begv_byte);
SET_BUF_ZV_BOTH (buffer, old_zv, old_zv_byte);
diff --git a/src/intervals.h b/src/intervals.h
index 51dfa09c5c4..40f32645ba0 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -296,8 +296,6 @@ Lisp_Object get_char_property_and_overlay (Lisp_Object, Lisp_Object,
Lisp_Object, Lisp_Object*);
extern int text_property_stickiness (Lisp_Object prop, Lisp_Object pos,
Lisp_Object buffer);
-extern Lisp_Object get_pos_property (Lisp_Object pos, Lisp_Object prop,
- Lisp_Object object);
extern void syms_of_textprop (void);
diff --git a/src/keyboard.c b/src/keyboard.c
index 450592a07b6..b50c06b4154 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -347,6 +347,7 @@ static Lisp_Object Qmodifier_cache;
/* Symbols to use for parts of windows. */
Lisp_Object Qmode_line;
Lisp_Object Qvertical_line;
+Lisp_Object Qright_divider, Qbottom_divider;
static Lisp_Object Qvertical_scroll_bar;
Lisp_Object Qmenu_bar;
@@ -1771,8 +1772,8 @@ adjust_point_for_property (ptrdiff_t last_pt, bool modified)
than skip both boundaries. However, this code
also stops anywhere in a non-sticky text-property,
which breaks (e.g.) Org mode. */
- && (val = get_pos_property (make_number (end),
- Qinvisible, Qnil),
+ && (val = Fget_pos_property (make_number (end),
+ Qinvisible, Qnil),
TEXT_PROP_MEANS_INVISIBLE (val))
#endif
&& !NILP (val = get_char_property_and_overlay
@@ -1789,8 +1790,8 @@ adjust_point_for_property (ptrdiff_t last_pt, bool modified)
}
while (beg > BEGV
#if 0
- && (val = get_pos_property (make_number (beg),
- Qinvisible, Qnil),
+ && (val = Fget_pos_property (make_number (beg),
+ Qinvisible, Qnil),
TEXT_PROP_MEANS_INVISIBLE (val))
#endif
&& !NILP (val = get_char_property_and_overlay
@@ -1843,12 +1844,12 @@ adjust_point_for_property (ptrdiff_t last_pt, bool modified)
to the other end would mean moving backwards and thus
could lead to an infinite loop. */
;
- else if (val = get_pos_property (make_number (PT),
- Qinvisible, Qnil),
+ else if (val = Fget_pos_property (make_number (PT),
+ Qinvisible, Qnil),
TEXT_PROP_MEANS_INVISIBLE (val)
- && (val = get_pos_property
- (make_number (PT == beg ? end : beg),
- Qinvisible, Qnil),
+ && (val = (Fget_pos_property
+ (make_number (PT == beg ? end : beg),
+ Qinvisible, Qnil)),
!TEXT_PROP_MEANS_INVISIBLE (val)))
(check_composition = check_display = 1,
SET_PT (PT == beg ? end : beg));
@@ -3222,8 +3223,6 @@ read_char (int commandflag, Lisp_Object map,
RETURN_UNGCPRO (c);
}
-#ifdef HAVE_MENUS
-
/* Record a key that came from a mouse menu.
Record it for echoing, for this-command-keys, and so on. */
@@ -3254,13 +3253,11 @@ record_menu_key (Lisp_Object c)
/* Record this character as part of the current key. */
add_command_key (c);
- /* Re-reading in the middle of a command */
+ /* Re-reading in the middle of a command. */
last_input_event = c;
num_input_events++;
}
-#endif /* HAVE_MENUS */
-
/* Return true if should recognize C as "the help character". */
static bool
@@ -5306,6 +5303,20 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
dy = yret = wy;
}
/* Nothing special for part == ON_SCROLL_BAR. */
+ else if (part == ON_RIGHT_DIVIDER)
+ {
+ posn = Qright_divider;
+ width = WINDOW_RIGHT_DIVIDER_WIDTH (w);
+ dx = xret = wx;
+ dy = yret = wy;
+ }
+ else if (part == ON_BOTTOM_DIVIDER)
+ {
+ posn = Qbottom_divider;
+ width = WINDOW_BOTTOM_DIVIDER_WIDTH (w);
+ dx = xret = wx;
+ dy = yret = wy;
+ }
/* For clicks in the text area, fringes, or margins, call
buffer_posn_from_coords to extract TEXTPOS, the buffer
@@ -8359,7 +8370,6 @@ read_char_x_menu_prompt (Lisp_Object map,
if (! menu_prompting)
return Qnil;
-#ifdef HAVE_MENUS
/* If we got to this point via a mouse click,
use a real menu for mouse selection. */
if (EVENT_HAS_PARAMETERS (prev_event)
@@ -8405,7 +8415,6 @@ read_char_x_menu_prompt (Lisp_Object map,
*used_mouse_menu = 1;
return value;
}
-#endif /* HAVE_MENUS */
return Qnil ;
}
@@ -10148,7 +10157,7 @@ On such systems, Emacs starts a subshell instead of suspending. */)
with a window system; but suspend should be disabled in that case. */
get_tty_size (fileno (CURTTY ()->input), &width, &height);
if (width != old_width || height != old_height)
- change_frame_size (SELECTED_FRAME (), height, width, 0, 0, 0);
+ change_frame_size (SELECTED_FRAME (), width, height, 0, 0, 0, 0);
/* Run suspend-resume-hook. */
hook = intern ("suspend-resume-hook");
@@ -10984,6 +10993,8 @@ syms_of_keyboard (void)
DEFSYM (Qvertical_line, "vertical-line");
DEFSYM (Qvertical_scroll_bar, "vertical-scroll-bar");
DEFSYM (Qmenu_bar, "menu-bar");
+ DEFSYM (Qright_divider, "right-divider");
+ DEFSYM (Qbottom_divider, "bottom-divider");
DEFSYM (Qmouse_fixup_help_message, "mouse-fixup-help-message");
diff --git a/src/keyboard.h b/src/keyboard.h
index b8aad959dd9..a1aa59fe988 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -457,6 +457,7 @@ extern Lisp_Object Qhelp_echo;
/* Symbols to use for non-text mouse positions. */
extern Lisp_Object Qmode_line, Qvertical_line, Qheader_line;
+extern Lisp_Object Qright_divider, Qbottom_divider;
/* True while doing kbd input. */
extern bool waiting_for_input;
diff --git a/src/lisp.h b/src/lisp.h
index a5aec41be38..d8cf6b6960e 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1,7 +1,6 @@
/* Fundamental definitions for GNU Emacs Lisp interpreter.
-Copyright (C) 1985-1987, 1993-1995, 1997-2013 Free Software Foundation,
-Inc.
+Copyright (C) 1985-1987, 1993-1995, 1997-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -1213,6 +1212,7 @@ struct Lisp_Bool_Vector
/* This is the size in bits. */
EMACS_INT size;
/* The actual bits, packed into bytes.
+ Zeros fill out the last word if needed.
The bits are in little-endian order in the bytes, and
the bytes are in little-endian order in the words. */
bits_word data[FLEXIBLE_ARRAY_MEMBER];
@@ -3523,7 +3523,7 @@ extern void pop_message_unwind (void);
extern Lisp_Object restore_message_unwind (Lisp_Object);
extern void restore_message (void);
extern Lisp_Object current_message (void);
-extern void clear_message (int, int);
+extern void clear_message (bool, bool);
extern void message (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2);
extern void message1 (const char *);
extern void message1_nolog (const char *);
@@ -4042,6 +4042,7 @@ extern void syms_of_indent (void);
/* Defined in frame.c. */
extern Lisp_Object Qonly, Qnone;
extern Lisp_Object Qvisible;
+extern void set_frame_param (struct frame *, Lisp_Object, Lisp_Object);
extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object);
extern void store_in_alist (Lisp_Object *, Lisp_Object, Lisp_Object);
extern Lisp_Object do_switch_frame (Lisp_Object, int, int, Lisp_Object);
@@ -4057,7 +4058,7 @@ extern int initial_argc;
#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS)
extern bool display_arg;
#endif
-extern Lisp_Object decode_env_path (const char *, const char *);
+extern Lisp_Object decode_env_path (const char *, const char *, bool);
extern Lisp_Object empty_unibyte_string, empty_multibyte_string;
extern Lisp_Object Qfile_name_handler_alist;
extern _Noreturn void terminate_due_to_signal (int, int);
@@ -4442,6 +4443,20 @@ extern void *record_xmalloc (size_t);
memory_full (SIZE_MAX); \
} while (0)
+/* Loop over all tails of a list, checking for cycles.
+ FIXME: Make tortoise and n internal declarations.
+ FIXME: Unroll the loop body so we don't need `n'. */
+#define FOR_EACH_TAIL(hare, list, tortoise, n) \
+ for (tortoise = hare = (list), n = true; \
+ CONSP (hare); \
+ (hare = XCDR (hare), n = !n, \
+ (n \
+ ? ((EQ (hare, tortoise) \
+ && (xsignal1 (Qcircular_list, (list)), 0))) \
+ /* Move tortoise before the next iteration, in case */ \
+ /* the next iteration does an Fsetcdr. */ \
+ : (tortoise = XCDR (tortoise), 0))))
+
/* Do a `for' loop over alist values. */
#define FOR_EACH_ALIST_VALUE(head_var, list_var, value_var) \
diff --git a/src/lisp.mk b/src/lisp.mk
index c12deebd893..d61f7f71c2f 100644
--- a/src/lisp.mk
+++ b/src/lisp.mk
@@ -164,6 +164,8 @@ lisp = \
$(lispsource)/emacs-lisp/float-sup.elc \
$(lispsource)/vc/vc-hooks.elc \
$(lispsource)/vc/ediff-hook.elc \
+ $(lispsource)/electric.elc \
+ $(lispsource)/uniquify.elc \
$(lispsource)/tooltip.elc
diff --git a/src/lread.c b/src/lread.c
index 6c1b17f62b7..a64f083a5ac 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1,7 +1,6 @@
/* Lisp parsing and input streams.
-Copyright (C) 1985-1989, 1993-1995, 1997-2013 Free Software Foundation,
-Inc.
+Copyright (C) 1985-1989, 1993-1995, 1997-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -3538,7 +3537,7 @@ read_vector (Lisp_Object readcharfun, bool bytecodeflag)
return vector;
}
-/* FLAG means check for ] to terminate rather than ) and . */
+/* FLAG means check for ']' to terminate rather than ')' and '.'. */
static Lisp_Object
read_list (bool flag, Lisp_Object readcharfun)
@@ -4106,17 +4105,17 @@ defvar_kboard (struct Lisp_Kboard_Objfwd *ko_fwd,
SET_SYMBOL_FWD (XSYMBOL (sym), (union Lisp_Fwd *)ko_fwd);
}
-/* Check that the elements of Vload_path exist. */
+/* Check that the elements of lpath exist. */
static void
-load_path_check (void)
+load_path_check (Lisp_Object lpath)
{
Lisp_Object path_tail;
/* The only elements that might not exist are those from
PATH_LOADSEARCH, EMACSLOADPATH. Anything else is only added if
it exists. */
- for (path_tail = Vload_path; !NILP (path_tail); path_tail = XCDR (path_tail))
+ for (path_tail = lpath; !NILP (path_tail); path_tail = XCDR (path_tail))
{
Lisp_Object dirfile;
dirfile = Fcar (path_tail);
@@ -4133,19 +4132,23 @@ load_path_check (void)
so we can see if the site changed it later during dumping. */
static Lisp_Object dump_path;
-/* Compute the default Vload_path, with the following logic:
- If CANNOT_DUMP:
- use EMACSLOADPATH env-var if set; otherwise use PATH_LOADSEARCH,
- prepending PATH_SITELOADSEARCH unless --no-site-lisp.
+/* Return the default load-path, to be used if EMACSLOADPATH is unset.
+ This does not include the standard site-lisp directories
+ under the installation prefix (i.e., PATH_SITELOADSEARCH),
+ but it does (unless no_site_lisp is set) include site-lisp
+ directories in the source/build directories if those exist and we
+ are running uninstalled.
+
+ Uses the following logic:
+ If CANNOT_DUMP: Use PATH_LOADSEARCH.
The remainder is what happens when dumping works:
If purify-flag (ie dumping) just use PATH_DUMPLOADSEARCH.
- Otherwise use EMACSLOADPATH if set, else PATH_LOADSEARCH.
+ Otherwise use PATH_LOADSEARCH.
- If !initialized, then just set both Vload_path and dump_path.
- If initialized, then if Vload_path != dump_path, do nothing.
+ If !initialized, then just set dump_path and return PATH_DUMPLOADSEARCH.
+ If initialized, then if Vload_path != dump_path, return just Vload_path.
(Presumably the load-path has already been changed by something.
- This can only be from a site-load file during dumping,
- or because EMACSLOADPATH is set.)
+ This can only be from a site-load file during dumping.)
If Vinstallation_directory is not nil (ie, running uninstalled):
If installation-dir/lisp exists and not already a member,
we must be running uninstalled. Reset the load-path
@@ -4154,20 +4157,17 @@ static Lisp_Object dump_path;
are not yet installed, we should not use them, even if they exist.)
If installation-dir/lisp does not exist, just add dump_path at the
end instead.
- Add installation-dir/leim (if exists and not already a member) at the front.
Add installation-dir/site-lisp (if !no_site_lisp, and exists
and not already a member) at the front.
If installation-dir != source-dir (ie running an uninstalled,
out-of-tree build) AND install-dir/src/Makefile exists BUT
install-dir/src/Makefile.in does NOT exist (this is a sanity
- check), then repeat the above steps for source-dir/lisp,
- leim and site-lisp.
- Finally, add the site-lisp directories at the front (if !no_site_lisp).
-*/
+ check), then repeat the above steps for source-dir/lisp, site-lisp. */
-void
-init_lread (void)
+static Lisp_Object
+load_path_default (bool changed)
{
+ Lisp_Object lpath = Qnil;
const char *normal;
#ifdef CANNOT_DUMP
@@ -4177,63 +4177,48 @@ init_lread (void)
normal = PATH_LOADSEARCH;
#ifdef HAVE_NS
- Vload_path = decode_env_path ("EMACSLOADPATH", loadpath ? loadpath : normal);
+ lpath = decode_env_path (0, loadpath ? loadpath : normal, 0);
#else
- Vload_path = decode_env_path ("EMACSLOADPATH", normal);
+ lpath = decode_env_path (0, normal, 0);
#endif
- load_path_check ();
-
- /* FIXME CANNOT_DUMP platforms should get source-dir/lisp etc added
- to their load-path too, AFAICS. I don't think we can tell the
- difference between initialized and !initialized in this case,
- so we'll have to do it unconditionally when Vinstallation_directory
- is non-nil. */
- if (!no_site_lisp && !egetenv ("EMACSLOADPATH"))
- {
- Lisp_Object sitelisp;
- sitelisp = decode_env_path (0, PATH_SITELOADSEARCH);
- if (! NILP (sitelisp)) Vload_path = nconc2 (sitelisp, Vload_path);
- }
#else /* !CANNOT_DUMP */
- if (NILP (Vpurify_flag))
- {
- normal = PATH_LOADSEARCH;
- /* If the EMACSLOADPATH environment variable is set, use its value.
- This doesn't apply if we're dumping. */
- if (egetenv ("EMACSLOADPATH"))
- Vload_path = decode_env_path ("EMACSLOADPATH", normal);
- }
- else
- normal = PATH_DUMPLOADSEARCH;
+
+ normal = NILP (Vpurify_flag) ? PATH_LOADSEARCH : PATH_DUMPLOADSEARCH;
/* In a dumped Emacs, we normally reset the value of Vload_path using
PATH_LOADSEARCH, since the value that was dumped uses lisp/ in
the source directory, instead of the path of the installed elisp
libraries. However, if it appears that Vload_path has already been
changed from the default that was saved before dumping, don't
- change it further. Changes can only be due to EMACSLOADPATH, or
- site-lisp files that were processed during dumping. */
+ change it further. Changes can only be due to site-lisp
+ files that were processed during dumping. */
+ /* FIXME? AFAICS, it does not make sense to change load-path in a
+ dumped site-lisp file, so maybe we should just drop this check.
+ E.g., if you add an element to load-path, you are going to be
+ adding it to PATH_DUMPLOADSEARCH, which refers to the source directory.
+ This will make no sense (and may not still exist) in an installed Emacs.
+ And the only change it is sensible to make to load-path is to add
+ something to the front, which you should do with configure's
+ --enable-locallisppath option if you really want to have it dumped. */
if (initialized)
{
- if (NILP (Fequal (dump_path, Vload_path)))
+ if (changed || NILP (Fequal (dump_path, Vload_path)))
{
- /* Do not make any changes, just check the elements exist. */
- /* Note: --no-site-lisp is ignored.
- I don't know what to do about this. */
- load_path_check ();
+ /* Do not make any changes. */
+ return Vload_path;
}
else
- {
+ {
#ifdef HAVE_NS
- const char *loadpath = ns_load_path ();
- Vload_path = decode_env_path (0, loadpath ? loadpath : normal);
+ const char *loadpath = ns_load_path ();
+ lpath = decode_env_path (0, loadpath ? loadpath : normal, 0);
#else
- Vload_path = decode_env_path (0, normal);
+ lpath = decode_env_path (0, normal, 0);
#endif
- if (!NILP (Vinstallation_directory))
- {
- Lisp_Object tem, tem1;
+ if (!NILP (Vinstallation_directory))
+ {
+ Lisp_Object tem, tem1;
/* Add to the path the lisp subdir of the installation
dir, if it is accessible. Note: in out-of-tree builds,
@@ -4243,29 +4228,19 @@ init_lread (void)
tem1 = Ffile_accessible_directory_p (tem);
if (!NILP (tem1))
{
- if (NILP (Fmember (tem, Vload_path)))
+ if (NILP (Fmember (tem, lpath)))
{
/* We are running uninstalled. The default load-path
- points to the eventual installed lisp, leim
- directories. We should not use those now, even
- if they exist, so start over from a clean slate. */
- Vload_path = list1 (tem);
+ points to the eventual installed lisp directories.
+ We should not use those now, even if they exist,
+ so start over from a clean slate. */
+ lpath = list1 (tem);
}
}
else
/* That dir doesn't exist, so add the build-time
Lisp dirs instead. */
- Vload_path = nconc2 (Vload_path, dump_path);
-
- /* Add leim under the installation dir, if it is accessible. */
- tem = Fexpand_file_name (build_string ("leim"),
- Vinstallation_directory);
- tem1 = Ffile_accessible_directory_p (tem);
- if (!NILP (tem1))
- {
- if (NILP (Fmember (tem, Vload_path)))
- Vload_path = Fcons (tem, Vload_path);
- }
+ lpath = nconc2 (lpath, dump_path);
/* Add site-lisp under the installation dir, if it exists. */
if (!no_site_lisp)
@@ -4275,14 +4250,14 @@ init_lread (void)
tem1 = Ffile_accessible_directory_p (tem);
if (!NILP (tem1))
{
- if (NILP (Fmember (tem, Vload_path)))
- Vload_path = Fcons (tem, Vload_path);
+ if (NILP (Fmember (tem, lpath)))
+ lpath = Fcons (tem, lpath);
}
}
/* If Emacs was not built in the source directory,
and it is run from where it was built, add to load-path
- the lisp, leim and site-lisp dirs under that directory. */
+ the lisp and site-lisp dirs under that directory. */
if (NILP (Fequal (Vinstallation_directory, Vsource_directory)))
{
@@ -4304,14 +4279,8 @@ init_lread (void)
tem = Fexpand_file_name (build_string ("lisp"),
Vsource_directory);
- if (NILP (Fmember (tem, Vload_path)))
- Vload_path = Fcons (tem, Vload_path);
-
- tem = Fexpand_file_name (build_string ("leim"),
- Vsource_directory);
-
- if (NILP (Fmember (tem, Vload_path)))
- Vload_path = Fcons (tem, Vload_path);
+ if (NILP (Fmember (tem, lpath)))
+ lpath = Fcons (tem, lpath);
if (!no_site_lisp)
{
@@ -4320,47 +4289,113 @@ init_lread (void)
tem1 = Ffile_accessible_directory_p (tem);
if (!NILP (tem1))
{
- if (NILP (Fmember (tem, Vload_path)))
- Vload_path = Fcons (tem, Vload_path);
+ if (NILP (Fmember (tem, lpath)))
+ lpath = Fcons (tem, lpath);
}
}
}
} /* Vinstallation_directory != Vsource_directory */
- } /* if Vinstallation_directory */
+ } /* if Vinstallation_directory */
- /* Check before adding the site-lisp directories.
- The install should have created them, but they are not
- required, so no need to warn if they are absent.
- Or we might be running before installation. */
- load_path_check ();
-
- /* Add the site-lisp directories at the front. */
- if (!no_site_lisp)
- {
- Lisp_Object sitelisp;
- sitelisp = decode_env_path (0, PATH_SITELOADSEARCH);
- if (! NILP (sitelisp)) Vload_path = nconc2 (sitelisp, Vload_path);
- }
- } /* if dump_path == Vload_path */
+ } /* if dump_path == Vload_path */
}
else /* !initialized */
{
/* NORMAL refers to PATH_DUMPLOADSEARCH, ie the lisp dir in the
source directory. We used to add ../lisp (ie the lisp dir in
the build directory) at the front here, but that caused trouble
- because it was copied from dump_path into Vload_path, above,
- when Vinstallation_directory was non-nil. It should not be
+ because it was copied from dump_path into Vload_path, above,
+ when Vinstallation_directory was non-nil. It should not be
necessary, since in out of tree builds lisp/ is empty, save
for Makefile. */
- Vload_path = decode_env_path (0, normal);
- dump_path = Vload_path;
- /* No point calling load_path_check; load-path only contains essential
- elements from the source directory at this point. They cannot
- be missing unless something went extremely (and improbably)
- wrong, in which case the build will fail in obvious ways. */
+ lpath = decode_env_path (0, normal, 0);
+ dump_path = lpath;
}
-#endif /* !CANNOT_DUMP */
+#endif /* !CANNOT_DUMP */
+
+ return lpath;
+}
+
+void
+init_lread (void)
+{
+ /* First, set Vload_path. */
+
+ /* NB: Do not change Vload_path before calling load_path_default,
+ since it may check it against dump_path.
+ (This behavior could be changed.) */
+
+ /* We explicitly ignore EMACSLOADPATH when dumping. */
+ if (NILP (Vpurify_flag) && egetenv ("EMACSLOADPATH"))
+ {
+ Lisp_Object elpath = decode_env_path ("EMACSLOADPATH", 0, 1);
+
+ /* Check (non-nil) user-supplied elements. */
+ load_path_check (elpath);
+
+ /* If no nils in the environment variable, use as-is.
+ Otherwise, replace any nils with the default. */
+ if (NILP (Fmemq (Qnil, elpath)))
+ {
+ Vload_path = elpath;
+ }
+ else
+ {
+ Lisp_Object elem, default_lpath = load_path_default (0);
+
+ /* Check defaults, before adding site-lisp. */
+ load_path_check (default_lpath);
+
+ /* Add the site-lisp directories to the front of the default. */
+ if (!no_site_lisp)
+ {
+ Lisp_Object sitelisp;
+ sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 0);
+ if (! NILP (sitelisp))
+ default_lpath = nconc2 (sitelisp, default_lpath);
+ }
+
+ Vload_path = Qnil;
+
+ /* Replace nils from EMACSLOADPATH by default. */
+ while (CONSP (elpath))
+ {
+ Lisp_Object arg[2];
+ elem = XCAR (elpath);
+ elpath = XCDR (elpath);
+ arg[0] = Vload_path;
+ arg[1] = NILP (elem) ? default_lpath : Fcons (elem, Qnil);
+ Vload_path = Fappend (2, arg);
+ }
+ } /* Fmemq (Qnil, Vload_path) */
+ }
+ else /* Vpurify_flag || !EMACSLOADPATH */
+ {
+#ifdef CANNOT_DUMP
+ bool changed = 0;
+#else
+ bool changed = initialized && NILP (Fequal (dump_path, Vload_path));
+#endif
+
+ Vload_path = load_path_default (changed);
+
+ /* Check before adding site-lisp directories.
+ The install should have created them, but they are not
+ required, so no need to warn if they are absent.
+ Or we might be running before installation. */
+ load_path_check (Vload_path);
+
+ /* Add the site-lisp directories at the front, unless the
+ load-path has already been changed.
+ FIXME? Should we ignore changed here? */
+ if (initialized && !no_site_lisp && !changed)
+ {
+ Lisp_Object sitelisp;
+ sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 0);
+ if (! NILP (sitelisp)) Vload_path = nconc2 (sitelisp, Vload_path);
+ }
+ } /* !Vpurify_flag && EMACSLOADPATH */
Vvalues = Qnil;
@@ -4467,9 +4502,8 @@ were read in. */);
DEFVAR_LISP ("load-path", Vload_path,
doc: /* List of directories to search for files to load.
-Each element is a string (directory name) or nil (try default directory).
-Initialized based on EMACSLOADPATH environment variable, if any,
-otherwise to default specified by file `epaths.h' when Emacs was built. */);
+Each element is a string (directory name) or nil (meaning `default-directory').
+Initialized during startup as described in Info node `(elisp)Library Search'. */);
DEFVAR_LISP ("load-suffixes", Vload_suffixes,
doc: /* List of suffixes for (compiled or source) Emacs Lisp files.
@@ -4585,7 +4619,7 @@ and is not meant for users to change. */);
You cannot count on them to still be there! */);
Vsource_directory
= Fexpand_file_name (build_string ("../"),
- Fcar (decode_env_path (0, PATH_DUMPLOADSEARCH)));
+ Fcar (decode_env_path (0, PATH_DUMPLOADSEARCH, 0)));
DEFVAR_LISP ("preloaded-file-list", Vpreloaded_file_list,
doc: /* List of files that were preloaded (when dumping Emacs). */);
diff --git a/src/menu.c b/src/menu.c
index 96b8f73824a..e33c647d020 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1178,7 +1178,6 @@ no quit occurs and `x-popup-menu' returns nil. */)
keybinding equivalents, but we don't do that any more anyway. */
return Qnil;
-#ifdef HAVE_MENUS
{
bool get_current_pos_p = 0;
@@ -1315,7 +1314,6 @@ no quit occurs and `x-popup-menu' returns nil. */)
XSETFRAME (Vmenu_updating_frame, f);
}
-#endif /* HAVE_MENUS */
/* Now parse the lisp menus. */
record_unwind_protect_void (unuse_menu_items);
@@ -1398,7 +1396,6 @@ no quit occurs and `x-popup-menu' returns nil. */)
unbind_to (specpdl_count, Qnil);
-#ifdef HAVE_MENUS
#ifdef HAVE_WINDOW_SYSTEM
/* Hide a previous tip, if any. */
if (!FRAME_TERMCAP_P (f))
@@ -1460,16 +1457,12 @@ no quit occurs and `x-popup-menu' returns nil. */)
FRAME_DISPLAY_INFO (f)->grabbed = 0;
#endif
-#endif /* HAVE_MENUS */
-
UNGCPRO;
if (error_name) error ("%s", error_name);
return selection;
}
-#ifdef HAVE_MENUS
-
DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 3, 0,
doc: /* Pop up a dialog box and return user's selection.
POSITION specifies which frame to use.
@@ -1605,8 +1598,6 @@ for instance using the window manager, then this produces a quit and
}
}
-#endif /* HAVE_MENUS */
-
void
syms_of_menu (void)
{
@@ -1615,9 +1606,6 @@ syms_of_menu (void)
menu_items_inuse = Qnil;
defsubr (&Sx_popup_menu);
-
-#ifdef HAVE_MENUS
defsubr (&Sx_popup_dialog);
-#endif
defsubr (&Smenu_bar_menu_at_x_y);
}
diff --git a/src/minibuf.c b/src/minibuf.c
index 8eb1a2890e0..c8ae8eae2a4 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -865,9 +865,6 @@ read_minibuf_unwind (void)
if (minibuf_level == 0)
resize_mini_window (XWINDOW (window), 0);
- /* Enforce full redisplay. FIXME: make it more selective. */
- windows_or_buffers_changed = 22;
-
/* In case the previous minibuffer displayed in this miniwindow is
dead, we may keep displaying this buffer (tho it's inactive), so reset it,
to make sure we don't leave around bindings and stuff which only
diff --git a/src/nsfns.m b/src/nsfns.m
index ee6020f2b43..8f14915ea65 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -703,7 +703,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
}
}
- x_set_window_size (f, 0, f->text_cols, f->text_lines);
+ x_set_window_size (f, 0, f->text_cols, f->text_lines, 0);
}
@@ -946,6 +946,8 @@ frame_parm_handler ns_frame_parm_handlers[] =
x_set_icon_name,
x_set_icon_type,
x_set_internal_border_width, /* generic OK */
+ 0, /* x_set_right_divider_width */
+ 0, /* x_set_bottom_divider_width */
x_set_menu_bar_lines,
x_set_mouse_color,
x_explicitly_set_name,
@@ -1235,6 +1237,13 @@ This function is an internal primitive--use `make-frame' instead. */)
init_frame_faces (f);
+ /* Read comment about this code in corresponding place in xfns.c. */
+ width = FRAME_TEXT_WIDTH (f);
+ height = FRAME_TEXT_HEIGHT (f);
+ FRAME_TEXT_HEIGHT (f) = 0;
+ SET_FRAME_WIDTH (f, 0);
+ change_frame_size (f, width, height, 1, 0, 0, 1);
+
/* The resources controlling the menu-bar and tool-bar are
processed specially at startup, and reflected in the mode
variables; ignore them here. */
@@ -1266,6 +1275,7 @@ This function is an internal primitive--use `make-frame' instead. */)
f->output_data.ns->hand_cursor = [NSCursor pointingHandCursor];
f->output_data.ns->hourglass_cursor = [NSCursor disappearingItemCursor];
f->output_data.ns->horizontal_drag_cursor = [NSCursor resizeLeftRightCursor];
+ f->output_data.ns->vertical_drag_cursor = [NSCursor resizeUpDownCursor];
FRAME_DISPLAY_INFO (f)->vertical_scroll_bar_cursor
= [NSCursor arrowCursor];
f->output_data.ns->current_pointer = f->output_data.ns->text_cursor;
@@ -1298,12 +1308,11 @@ This function is an internal primitive--use `make-frame' instead. */)
x_default_parameter (f, parms, Qfullscreen, Qnil,
"fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
- width = FRAME_COLS (f);
- height = FRAME_LINES (f);
-
- SET_FRAME_COLS (f, 0);
- FRAME_LINES (f) = 0;
- change_frame_size (f, height, width, 1, 0, 0);
+ width = FRAME_TEXT_WIDTH (f);
+ height = FRAME_TEXT_HEIGHT (f);
+ FRAME_TEXT_HEIGHT (f) = 0;
+ SET_FRAME_WIDTH (f, 0);
+ change_frame_size (f, width, height, 1, 0, 0, 1);
if (! f->output_data.ns->explicit_parent)
{
diff --git a/src/nsfont.m b/src/nsfont.m
index 58663804a2f..0f546408316 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -829,7 +829,6 @@ nsfont_open (struct frame *f, Lisp_Object font_entity, int pixel_size)
font->vertical_centering = 0;
font->baseline_offset = 0;
font->relative_compose = 0;
- font->font_encoder = NULL;
font->props[FONT_FORMAT_INDEX] = Qns;
font->props[FONT_FILE_INDEX] = Qnil;
diff --git a/src/nsterm.h b/src/nsterm.h
index 22a8aec9436..976347ad3b4 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -654,6 +654,7 @@ struct ns_output
Cursor hand_cursor;
Cursor hourglass_cursor;
Cursor horizontal_drag_cursor;
+ Cursor vertical_drag_cursor;
/* NS-specific */
Cursor current_pointer;
@@ -719,11 +720,6 @@ struct x_output
#define FRAME_NS_TITLEBAR_HEIGHT(f) ((f)->output_data.ns->titlebar_height)
#define FRAME_TOOLBAR_HEIGHT(f) ((f)->output_data.ns->toolbar_height)
-#define FONT_WIDTH(f) ((f)->max_width)
-#define FONT_HEIGHT(f) ((f)->height)
-#define FONT_BASE(f) ((f)->ascent)
-#define FONT_DESCENT(f) ((f)->descent)
-
#define FRAME_DEFAULT_FACE(f) FACE_FROM_ID (f, DEFAULT_FACE_ID)
#define FRAME_NS_VIEW(f) ((f)->output_data.ns->view)
diff --git a/src/nsterm.m b/src/nsterm.m
index 0e7667b6dc6..37edfb238a9 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1,7 +1,7 @@
/* NeXT/Open/GNUstep / MacOSX communication module.
-Copyright (C) 1989, 1993-1994, 2005-2006, 2008-2013 Free Software
-Foundation, Inc.
+Copyright (C) 1989, 1993-1994, 2005-2006, 2008-2013
+ Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -445,8 +445,8 @@ ns_exec_path (void)
const char *
ns_load_path (void)
/* If running as a self-contained app bundle, return as a path string
- the filenames of the site-lisp, lisp and leim directories.
- Ie, site-lisp:lisp:leim. Otherwise, return nil. */
+ the filenames of the site-lisp and lisp directories.
+ Ie, site-lisp:lisp. Otherwise, return nil. */
{
NSBundle *bundle = [NSBundle mainBundle];
NSString *resourceDir = [bundle resourcePath];
@@ -456,7 +456,7 @@ ns_load_path (void)
BOOL isDir;
NSArray *paths = [resourceDir stringsByAppendingPaths:
[NSArray arrayWithObjects:
- @"site-lisp", @"lisp", @"leim", nil]];
+ @"site-lisp", @"lisp", nil]];
NSEnumerator *pathEnum = [paths objectEnumerator];
resourcePaths = @"";
@@ -771,7 +771,12 @@ ns_update_window_end (struct window *w, bool cursor_on_p,
w->output_cursor.x, w->output_cursor.y);
if (draw_window_fringes (w, 1))
- x_draw_vertical_border (w);
+ {
+ if (WINDOW_RIGHT_DIVIDER_WIDTH (w))
+ x_draw_right_divider (w);
+ else
+ x_draw_vertical_border (w);
+ }
unblock_input ();
}
@@ -1235,7 +1240,11 @@ x_set_offset (struct frame *f, int xoff, int yoff, int change_grav)
void
-x_set_window_size (struct frame *f, int change_grav, int cols, int rows)
+x_set_window_size (struct frame *f,
+ int change_grav,
+ int width,
+ int height,
+ bool pixelwise)
/* --------------------------------------------------------------------------
Adjust window pixel size based on given character grid size
Impl is a bit more complex than other terms, need to do some
@@ -1247,23 +1256,36 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows)
NSRect wr = [window frame];
int tb = FRAME_EXTERNAL_TOOL_BAR (f);
int pixelwidth, pixelheight;
+ int rows, cols;
NSTRACE (x_set_window_size);
if (view == nil)
return;
-/*fprintf (stderr, "\tsetWindowSize: %d x %d, font size %d x %d\n", cols, rows, FRAME_COLUMN_WIDTH (f), FRAME_LINE_HEIGHT (f)); */
+/*fprintf (stderr, "\tsetWindowSize: %d x %d, pixelwise %d, font size %d x %d\n", width, height, pixelwise, FRAME_COLUMN_WIDTH (f), FRAME_LINE_HEIGHT (f));*/
block_input ();
- check_frame_size (f, &rows, &cols);
+ check_frame_size (f, &width, &height, pixelwise);
f->scroll_bar_actual_width = NS_SCROLL_BAR_WIDTH (f);
compute_fringe_widths (f, 0);
- pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols);
- pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
+ if (pixelwise)
+ {
+ pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width);
+ pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height);
+ cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth);
+ rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelheight);
+ }
+ else
+ {
+ pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width);
+ pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height);
+ cols = width;
+ rows = height;
+ }
/* If we have a toolbar, take its height into account. */
if (tb && ! [view isFullscreen])
@@ -1298,7 +1320,7 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows)
[view setRows: rows andColumns: cols];
[window setFrame: wr display: YES];
-/*fprintf (stderr, "\tx_set_window_size %d, %d\t%d, %d\n", cols, rows, pixelwidth, pixelheight); */
+ fprintf (stderr, "\tx_set_window_size %d, %d\t%d, %d\n", cols, rows, pixelwidth, pixelheight);
/* This is a trick to compensate for Emacs' managing the scrollbar area
as a fixed number of standard character columns. Instead of leaving
@@ -1316,9 +1338,7 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows)
[view setBoundsOrigin: origin];
}
- change_frame_size (f, rows, cols, 0, 1, 0); /* pretend, delay, safe */
- FRAME_PIXEL_WIDTH (f) = pixelwidth;
- FRAME_PIXEL_HEIGHT (f) = pixelheight;
+ change_frame_size (f, width, height, 0, 1, 0, pixelwise);
/* SET_FRAME_GARBAGED (f); // this short-circuits expose call in drawRect */
mark_window_cursors_off (XWINDOW (f->root_window));
@@ -1385,7 +1405,7 @@ ns_index_color (NSColor *color, struct frame *f)
color_table->empty_indices = [[NSMutableSet alloc] init];
}
- /* do we already have this color ? */
+ /* Do we already have this color? */
for (i = 1; i < color_table->avail; i++)
if (color_table->colors[i] && [color_table->colors[i] isEqual: color])
return i;
@@ -2504,6 +2524,28 @@ ns_draw_vertical_window_border (struct window *w, int x, int y0, int y1)
}
+static void
+ns_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1)
+/* --------------------------------------------------------------------------
+ External (RIF): Draw a window divider.
+ -------------------------------------------------------------------------- */
+{
+ struct frame *f = XFRAME (WINDOW_FRAME (w));
+ struct face *face;
+ NSRect r = NSMakeRect (x0, y0, x1-x0, y1-y0);
+
+ NSTRACE (ns_draw_window_divider);
+
+ face = FACE_FROM_ID (f, WINDOW_DIVIDER_FACE_ID);
+ if (face)
+ [ns_lookup_indexed_color(face->foreground, f) set];
+
+ ns_focus (f, &r, 1);
+ NSRectFill(r);
+ ns_unfocus (f);
+}
+
+
void
show_hourglass (struct atimer *timer)
{
@@ -4017,6 +4059,7 @@ static struct redisplay_interface ns_redisplay_interface =
ns_clear_frame_area,
ns_draw_window_cursor,
ns_draw_vertical_window_border,
+ ns_draw_window_divider,
ns_shift_glyphs_for_insert
};
@@ -4385,7 +4428,7 @@ ns_term_shutdown (int sig)
shouldKeepRunning = YES;
do
- {
+ {
[pool release];
pool = [[NSAutoreleasePool alloc] init];
@@ -4404,6 +4447,9 @@ ns_term_shutdown (int sig)
- (void)stop: (id)sender
{
shouldKeepRunning = NO;
+ // Stop possible dialog also. Noop if no dialog present.
+ // The file dialog still leaks 7k - 10k on 10.9 though.
+ [super stop:sender];
}
#endif
@@ -5617,44 +5663,39 @@ not_in_argv (NSString *arg)
NSWindow *window = [self window];
NSRect wr = [window frame];
int extra = 0;
- int gsextra = 0;
-#ifdef NS_IMPL_GNUSTEP
- gsextra = 3;
-#endif
-
int oldc = cols, oldr = rows;
int oldw = FRAME_PIXEL_WIDTH (emacsframe),
oldh = FRAME_PIXEL_HEIGHT (emacsframe);
int neww, newh;
- cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (emacsframe, wr.size.width + gsextra);
-
- if (cols < MINWIDTH)
- cols = MINWIDTH;
-
if (! [self isFullscreen])
{
extra = FRAME_NS_TITLEBAR_HEIGHT (emacsframe)
- + FRAME_TOOLBAR_HEIGHT (emacsframe) - gsextra;
+ + FRAME_TOOLBAR_HEIGHT (emacsframe);
}
- rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (emacsframe, wr.size.height - extra);
+ neww = (int)wr.size.width - emacsframe->border_width;
+ newh = (int)wr.size.height - extra;
+
+ cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (emacsframe, neww);
+ rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (emacsframe, newh);
+
+ if (cols < MINWIDTH)
+ cols = MINWIDTH;
if (rows < MINHEIGHT)
rows = MINHEIGHT;
- neww = (int)wr.size.width - emacsframe->border_width;
- newh = (int)wr.size.height - extra;
-
if (oldr != rows || oldc != cols || neww != oldw || newh != oldh)
{
NSView *view = FRAME_NS_VIEW (emacsframe);
NSWindow *win = [view window];
NSSize sz = [win resizeIncrements];
- FRAME_PIXEL_WIDTH (emacsframe) = neww;
- FRAME_PIXEL_HEIGHT (emacsframe) = newh;
- change_frame_size (emacsframe, rows, cols, 0, delay, 0);
+ change_frame_size (emacsframe,
+ FRAME_PIXEL_TO_TEXT_WIDTH (emacsframe, neww),
+ FRAME_PIXEL_TO_TEXT_HEIGHT (emacsframe, newh),
+ 0, delay, 0, 1);
SET_FRAME_GARBAGED (emacsframe);
cancel_mouse_face (emacsframe);
@@ -5676,10 +5717,6 @@ not_in_argv (NSString *arg)
/* normalize frame to gridded text size */
{
int extra = 0;
- int gsextra = 0;
-#ifdef NS_IMPL_GNUSTEP
- gsextra = 3;
-#endif
NSTRACE (windowWillResize);
/*fprintf (stderr,"Window will resize: %.0f x %.0f\n",frameSize.width,frameSize.height); */
@@ -5697,8 +5734,13 @@ not_in_argv (NSString *arg)
if (fs_state == FULLSCREEN_NONE)
maximized_width = maximized_height = -1;
- cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (emacsframe,
- frameSize.width + gsextra);
+ if (! [self isFullscreen])
+ {
+ extra = FRAME_NS_TITLEBAR_HEIGHT (emacsframe)
+ + FRAME_TOOLBAR_HEIGHT (emacsframe);
+ }
+
+ cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (emacsframe, frameSize.width);
if (cols < MINWIDTH)
cols = MINWIDTH;
@@ -7294,6 +7336,7 @@ Lisp_Object
x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
{
struct font *font = XFONT_OBJECT (font_object);
+ EmacsView *view = FRAME_NS_VIEW (f);
if (fontset < 0)
fontset = fontset_from_font (font_object);
@@ -7326,8 +7369,9 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
}
/* Now make the frame display the given font. */
- if (FRAME_NS_WINDOW (f) != 0)
- x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
+ if (FRAME_NS_WINDOW (f) != 0 && ! [view isFullscreen])
+ x_set_window_size (f, 0, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
+ FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 1);
return font_object;
}
@@ -7554,5 +7598,5 @@ baseline level. The default value is nil. */);
#else
Fprovide (Qgnustep, Qnil);
#endif
-
+
}
diff --git a/src/print.c b/src/print.c
index e3c56a6de62..6e8aec37ba5 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1119,7 +1119,7 @@ print (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
string (its text properties will be traced), or a symbol that has
no obarray (this is for the print-gensym feature).
The status fields of Vprint_number_table mean whether each object appears
- more than once in OBJ: Qnil at the first time, and Qt after that . */
+ more than once in OBJ: Qnil at the first time, and Qt after that. */
static void
print_preprocess (Lisp_Object obj)
{
@@ -1766,8 +1766,9 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
}
else if (WINDOWP (obj))
{
- void *ptr = XWINDOW (obj);
- int len = sprintf (buf, "#<window %p", ptr);
+ int len;
+ strout ("#<window ", -1, -1, printcharfun);
+ len = sprintf (buf, "%d", XWINDOW (obj)->sequence_number);
strout (buf, len, len, printcharfun);
if (BUFFERP (XWINDOW (obj)->contents))
{
diff --git a/src/process.c b/src/process.c
index 307eab3ab30..7050bf9822e 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1,7 +1,7 @@
/* Asynchronous subprocess control for GNU Emacs.
-Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2013 Free Software
-Foundation, Inc.
+Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2013
+ Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -812,13 +812,14 @@ get_process (register Lisp_Object name)
else
obj = name;
- /* Now obj should be either a buffer object or a process object.
- */
+ /* Now obj should be either a buffer object or a process object. */
if (BUFFERP (obj))
{
+ if (NILP (BVAR (XBUFFER (obj), name)))
+ error ("Attempt to get process for a dead buffer");
proc = Fget_buffer_process (obj);
if (NILP (proc))
- error ("Buffer %s has no process", SDATA (BVAR (XBUFFER (obj), name)));
+ error ("Buffer %s has no process", SDATA (BVAR (XBUFFER (obj), name)));
}
else
{
diff --git a/src/regex.c b/src/regex.c
index 615fb3fdf34..b45dbcaada7 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -5907,7 +5907,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1,
EXTRACT_NUMBER_AND_INCR (mcnt, p);
/* Here, we discard `const', making re_match non-reentrant. */
p2 = (unsigned char*) p + mcnt;
- /* Signedness doesn't matter since we only copy MCNT's bits . */
+ /* Signedness doesn't matter since we only copy MCNT's bits. */
EXTRACT_NUMBER_AND_INCR (mcnt, p);
DEBUG_PRINT (" Setting %p to %d.\n", p2, mcnt);
PUSH_NUMBER (p2, mcnt);
diff --git a/src/term.c b/src/term.c
index f86d71ac2f4..4d900020ce6 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2407,7 +2407,7 @@ frame's terminal). */)
was suspended. */
get_tty_size (fileno (t->display_info.tty->input), &width, &height);
if (width != old_width || height != old_height)
- change_frame_size (f, height, width, 0, 0, 0);
+ change_frame_size (f, width, height, 0, 0, 0, 0);
SET_FRAME_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1);
}
@@ -2739,7 +2739,7 @@ DEFUN ("gpm-mouse-stop", Fgpm_mouse_stop, Sgpm_mouse_stop,
Menus
***********************************************************************/
-#if defined (HAVE_MENUS) && !defined (MSDOS)
+#if !defined (MSDOS)
/* TTY menu implementation and main ideas are borrowed from msdos.c.
@@ -3816,7 +3816,7 @@ tty_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
return entry;
}
-#endif /* HAVE_MENUS && !MSDOS */
+#endif /* !MSDOS */
#ifndef MSDOS
@@ -3825,7 +3825,7 @@ tty_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
***********************************************************************/
/* Initialize the tty-dependent part of frame F. The frame must
- already have its device initialized. */
+ already have its device initialized. */
void
create_tty_output (struct frame *f)
@@ -3839,7 +3839,7 @@ create_tty_output (struct frame *f)
f->output_data.tty = t;
}
-/* Delete frame F's face cache, and its tty-dependent part. */
+/* Delete frame F's face cache, and its tty-dependent part. */
static void
tty_free_frame_resources (struct frame *f)
@@ -3854,7 +3854,7 @@ tty_free_frame_resources (struct frame *f)
#else /* MSDOS */
-/* Delete frame F's face cache. */
+/* Delete frame F's face cache. */
static void
tty_free_frame_resources (struct frame *f)
diff --git a/src/textprop.c b/src/textprop.c
index b804f345047..5597a781a61 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -1819,32 +1819,30 @@ markers). If OBJECT is a string, START and END are 0-based indices into it. */
int
text_property_stickiness (Lisp_Object prop, Lisp_Object pos, Lisp_Object buffer)
{
- Lisp_Object prev_pos, front_sticky;
- bool is_rear_sticky = 1, is_front_sticky = 0; /* defaults */
+ bool ignore_previous_character;
+ Lisp_Object prev_pos = make_number (XINT (pos) - 1);
+ Lisp_Object front_sticky;
+ bool is_rear_sticky = true, is_front_sticky = false; /* defaults */
Lisp_Object defalt = Fassq (prop, Vtext_property_default_nonsticky);
if (NILP (buffer))
XSETBUFFER (buffer, current_buffer);
- if (CONSP (defalt) && !NILP (XCDR (defalt)))
- is_rear_sticky = 0;
+ ignore_previous_character = XINT (pos) <= BUF_BEGV (XBUFFER (buffer));
- if (XINT (pos) > BUF_BEGV (XBUFFER (buffer)))
- /* Consider previous character. */
+ if (ignore_previous_character || (CONSP (defalt) && !NILP (XCDR (defalt))))
+ is_rear_sticky = false;
+ else
{
- Lisp_Object rear_non_sticky;
-
- prev_pos = make_number (XINT (pos) - 1);
- rear_non_sticky = Fget_text_property (prev_pos, Qrear_nonsticky, buffer);
+ Lisp_Object rear_non_sticky
+ = Fget_text_property (prev_pos, Qrear_nonsticky, buffer);
if (!NILP (CONSP (rear_non_sticky)
? Fmemq (prop, rear_non_sticky)
: rear_non_sticky))
/* PROP is rear-non-sticky. */
- is_rear_sticky = 0;
+ is_rear_sticky = false;
}
- else
- return 0;
/* Consider following character. */
/* This signals an arg-out-of-range error if pos is outside the
@@ -1855,7 +1853,7 @@ text_property_stickiness (Lisp_Object prop, Lisp_Object pos, Lisp_Object buffer)
|| (CONSP (front_sticky)
&& !NILP (Fmemq (prop, front_sticky))))
/* PROP is inherited from after. */
- is_front_sticky = 1;
+ is_front_sticky = true;
/* Simple cases, where the properties are consistent. */
if (is_rear_sticky && !is_front_sticky)
@@ -1869,7 +1867,7 @@ text_property_stickiness (Lisp_Object prop, Lisp_Object pos, Lisp_Object buffer)
disambiguate. Basically, rear-sticky wins, _except_ if the
property that would be inherited has a value of nil, in which case
front-sticky wins. */
- if (XINT (pos) == BUF_BEGV (XBUFFER (buffer))
+ if (ignore_previous_character
|| NILP (Fget_text_property (prev_pos, prop, buffer)))
return 1;
else
diff --git a/src/tparam.c b/src/tparam.c
index c3ecfb9e3a3..e97544d9234 100644
--- a/src/tparam.c
+++ b/src/tparam.c
@@ -79,7 +79,7 @@ tparam1 (const char *string, char *outstring, int len,
register int tem;
int *old_argp = argp; /* can move */
int *fixed_argp = argp; /* never moves */
- int explicit_param_p = 0; /* set by %p */
+ bool explicit_param_p = 0; /* set by %p */
ptrdiff_t doleft = 0;
ptrdiff_t doup = 0;
ptrdiff_t append_len = 0;
diff --git a/src/undo.c b/src/undo.c
index 234b8510f0a..88cca102b6d 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -55,7 +55,7 @@ static Lisp_Object pending_boundary;
static void
record_point (ptrdiff_t pt)
{
- int at_boundary;
+ bool at_boundary;
/* Don't record position of pt when undo_inhibit_record_point holds. */
if (undo_inhibit_record_point)
@@ -77,7 +77,7 @@ record_point (ptrdiff_t pt)
if (CONSP (BVAR (current_buffer, undo_list)))
{
- /* Set AT_BOUNDARY to 1 only when we have nothing other than
+ /* Set AT_BOUNDARY only when we have nothing other than
marker adjustment before undo boundary. */
Lisp_Object tail = BVAR (current_buffer, undo_list), elt;
@@ -244,7 +244,7 @@ record_property_change (ptrdiff_t beg, ptrdiff_t length,
{
Lisp_Object lbeg, lend, entry;
struct buffer *obuf = current_buffer, *buf = XBUFFER (buffer);
- int boundary = 0;
+ bool boundary = 0;
if (EQ (BVAR (buf, undo_list), Qt))
return;
diff --git a/src/w32fns.c b/src/w32fns.c
index a4f9e320fc4..b3e6d29b973 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1384,6 +1384,17 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
horizontal_drag_cursor
= XCreateFontCursor (FRAME_X_DISPLAY (f), XC_sb_h_double_arrow);
+ if (!NILP (Vx_window_vertical_drag_shape))
+ {
+ CHECK_NUMBER (Vx_window_vertical_drag_shape);
+ vertical_drag_cursor
+ = XCreateFontCursor (FRAME_X_DISPLAY (f),
+ XINT (Vx_window_vertical_drag_shape));
+ }
+ else
+ vertical_drag_cursor
+ = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_sb_v_double_arrow);
+
/* Check and report errors with the above calls. */
x_check_errors (FRAME_W32_DISPLAY (f), "can't set cursor shape: %s");
x_uncatch_errors (FRAME_W32_DISPLAY (f), count);
@@ -1624,6 +1635,7 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
nlines = 0;
FRAME_MENU_BAR_LINES (f) = 0;
+ FRAME_MENU_BAR_HEIGHT (f) = 0;
if (nlines)
FRAME_EXTERNAL_MENU_BAR (f) = 1;
else
@@ -1635,7 +1647,7 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
/* Adjust the frame size so that the client (text) dimensions
remain the same. This depends on FRAME_EXTERNAL_MENU_BAR being
set correctly. */
- x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
+ x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 1);
do_pending_window_change (0);
}
adjust_frame_glyphs (f);
@@ -1643,16 +1655,17 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
/* Set the number of lines used for the tool bar of frame F to VALUE.
- VALUE not an integer, or < 0 means set the lines to zero. OLDVAL
- is the old number of tool bar lines. This function changes the
- height of all windows on frame F to match the new tool bar height.
- The frame's height doesn't change. */
+ VALUE not an integer, or < 0 means set the lines to zero. OLDVAL is
+ the old number of tool bar lines (and is unused). This function may
+ change the height of all windows on frame F to match the new tool bar
+ height. By design, the frame's height doesn't change (but maybe it
+ should if we don't get enough space otherwise). */
void
x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
int delta, nlines, root_height;
- Lisp_Object root_window;
+ int unit = FRAME_LINE_HEIGHT (f);
/* Treat tool bars like menu bars. */
if (FRAME_MINIBUF_ONLY_P (f))
@@ -1667,19 +1680,25 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
/* Make sure we redisplay all windows in this frame. */
windows_or_buffers_changed = 23;
- delta = nlines - FRAME_TOOL_BAR_LINES (f);
+ /* DELTA is in pixels now. */
+ delta = (nlines - FRAME_TOOL_BAR_LINES (f)) * unit;
- /* Don't resize the tool-bar to more than we have room for. */
- root_window = FRAME_ROOT_WINDOW (f);
- root_height = WINDOW_TOTAL_LINES (XWINDOW (root_window));
- if (root_height - delta < 1)
+ /* Don't resize the tool-bar to more than we have room for. FIXME:
+ This must use window_sizable eventually !!!!!!!!!!!! */
+ if (delta > 0)
{
- delta = root_height - 1;
- nlines = FRAME_TOOL_BAR_LINES (f) + delta;
+ root_height = WINDOW_PIXEL_HEIGHT (XWINDOW (FRAME_ROOT_WINDOW (f)));
+ if (root_height - delta < unit)
+ {
+ delta = root_height - unit;
+ nlines = (root_height / unit) + min (1, (root_height % unit));
+ }
}
FRAME_TOOL_BAR_LINES (f) = nlines;
- resize_frame_windows (f, FRAME_LINES (f), 0);
+ FRAME_TOOL_BAR_HEIGHT (f) = nlines * FRAME_LINE_HEIGHT (f);
+ ++windows_or_buffers_changed;
+ resize_frame_windows (f, FRAME_TEXT_HEIGHT (f), 0, 1);
adjust_frame_glyphs (f);
/* We also have to make sure that the internal border at the top of
@@ -1688,7 +1707,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
below the tool bar if one is displayed, but is below the menu bar
if there isn't a tool bar. The tool bar draws into the area
below the menu bar. */
- if (FRAME_W32_WINDOW (f) && FRAME_TOOL_BAR_LINES (f) == 0)
+ if (FRAME_W32_WINDOW (f) && FRAME_TOOL_BAR_HEIGHT (f) == 0)
{
clear_frame (f);
clear_current_matrices (f);
@@ -1701,7 +1720,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
int height = FRAME_INTERNAL_BORDER_WIDTH (f);
int width = FRAME_PIXEL_WIDTH (f);
- int y = nlines * FRAME_LINE_HEIGHT (f);
+ int y = nlines * unit;
block_input ();
{
@@ -1949,7 +1968,7 @@ w32_createwindow (struct frame *f)
SetWindowLong (hwnd, WND_FONTWIDTH_INDEX, FRAME_COLUMN_WIDTH (f));
SetWindowLong (hwnd, WND_LINEHEIGHT_INDEX, FRAME_LINE_HEIGHT (f));
SetWindowLong (hwnd, WND_BORDER_INDEX, FRAME_INTERNAL_BORDER_WIDTH (f));
- SetWindowLong (hwnd, WND_SCROLLBAR_INDEX, f->scroll_bar_actual_width);
+ SetWindowLong (hwnd, WND_SCROLLBAR_INDEX, FRAME_SCROLL_BAR_AREA_WIDTH (f));
SetWindowLong (hwnd, WND_BACKGROUND_INDEX, FRAME_BACKGROUND_PIXEL (f));
/* Enable drag-n-drop. */
@@ -3225,6 +3244,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
- WINDOW_RIGHT_MARGIN_WIDTH (w)
- WINDOW_RIGHT_FRINGE_WIDTH (w));
form.rcArea.bottom = (WINDOW_BOTTOM_EDGE_Y (w)
+ - WINDOW_BOTTOM_DIVIDER_WIDTH (w)
- w32_system_caret_mode_height);
/* Punt if the window was deleted behind our back. */
@@ -3774,7 +3794,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_WINDOWPOSCHANGING:
/* Don't restrict the sizing of tip frames. */
- if (hwnd == tip_window)
+ if (frame_resize_pixelwise || hwnd == tip_window)
return 0;
/* Don't restrict the sizing of fullscreened frames, allowing them to be
@@ -4453,6 +4473,10 @@ This function is an internal primitive--use `make-frame' instead. */)
/* Default internalBorderWidth to 0 on Windows to match other programs. */
x_default_parameter (f, parameters, Qinternal_border_width, make_number (0),
"internalBorderWidth", "InternalBorder", RES_TYPE_NUMBER);
+ x_default_parameter (f, parameters, Qright_divider_width, make_number (0),
+ NULL, NULL, RES_TYPE_NUMBER);
+ x_default_parameter (f, parameters, Qbottom_divider_width, make_number (0),
+ NULL, NULL, RES_TYPE_NUMBER);
x_default_parameter (f, parameters, Qvertical_scroll_bars, Qright,
"verticalScrollBars", "ScrollBars", RES_TYPE_SYMBOL);
@@ -4482,6 +4506,20 @@ This function is an internal primitive--use `make-frame' instead. */)
happen. */
init_frame_faces (f);
+ /* PXW: This is a duplicate from below. We have to do it here since
+ otherwise x_set_tool_bar_lines will work with the character sizes
+ installed by init_frame_faces while the frame's pixel size is still
+ calculated from a character size of 1 and we subsequently hit the
+ eassert (height >= 0) assertion in window_box_height. The
+ non-pixelwise code apparently worked around this because it had one
+ frame line vs one toolbar line which left us with a zero root
+ window height which was obviously wrong as well ... */
+ width = FRAME_TEXT_WIDTH (f);
+ height = FRAME_TEXT_HEIGHT (f);
+ FRAME_TEXT_HEIGHT (f) = 0;
+ SET_FRAME_WIDTH (f, 0);
+ change_frame_size (f, width, height, 1, 0, 0, 1);
+
/* The X resources controlling the menu-bar and tool-bar are
processed specially at startup, and reflected in the mode
variables; ignore them here. */
@@ -4510,6 +4548,7 @@ This function is an internal primitive--use `make-frame' instead. */)
f->output_data.w32->hand_cursor = w32_load_cursor (IDC_HAND);
f->output_data.w32->hourglass_cursor = w32_load_cursor (IDC_WAIT);
f->output_data.w32->horizontal_drag_cursor = w32_load_cursor (IDC_SIZEWE);
+ f->output_data.w32->vertical_drag_cursor = w32_load_cursor (IDC_SIZENS);
f->output_data.w32->current_cursor = f->output_data.w32->nontext_cursor;
@@ -4547,12 +4586,11 @@ This function is an internal primitive--use `make-frame' instead. */)
/* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
Change will not be effected unless different from the current
FRAME_LINES (f). */
- width = FRAME_COLS (f);
- height = FRAME_LINES (f);
-
- FRAME_LINES (f) = 0;
- SET_FRAME_COLS (f, 0);
- change_frame_size (f, height, width, 1, 0, 0);
+ width = FRAME_TEXT_WIDTH (f);
+ height = FRAME_TEXT_HEIGHT (f);
+ FRAME_TEXT_HEIGHT (f) = 0;
+ SET_FRAME_WIDTH (f, 0);
+ change_frame_size (f, width, height, 1, 0, 0, 1);
/* Tell the server what size and position, etc, we want, and how
badly we want them. This should be done after we have the menu
@@ -5690,6 +5728,10 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
x_default_parameter (f, parms, Qinternal_border_width, make_number (1),
"internalBorderWidth", "internalBorderWidth",
RES_TYPE_NUMBER);
+ x_default_parameter (f, parms, Qright_divider_width, make_number (0),
+ NULL, NULL, RES_TYPE_NUMBER);
+ x_default_parameter (f, parms, Qbottom_divider_width, make_number (0),
+ NULL, NULL, RES_TYPE_NUMBER);
/* Also do the stuff which must be set before the window exists. */
x_default_parameter (f, parms, Qforeground_color, build_string ("black"),
@@ -5734,14 +5776,14 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
x_default_parameter (f, parms, Qcursor_type, Qbox,
"cursorType", "CursorType", RES_TYPE_SYMBOL);
- /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
- Change will not be effected unless different from the current
- FRAME_LINES (f). */
+ /* Dimensions, especially FRAME_LINES (f), must be done via
+ change_frame_size. Change will not be effected unless different
+ from the current FRAME_LINES (f). */
width = FRAME_COLS (f);
height = FRAME_LINES (f);
FRAME_LINES (f) = 0;
SET_FRAME_COLS (f, 0);
- change_frame_size (f, height, width, 1, 0, 0);
+ change_frame_size (f, width, height, 1, 0, 0, 0);
/* Add `tooltip' frame parameter's default value. */
if (NILP (Fframe_parameter (frame, Qtooltip)))
@@ -5999,6 +6041,10 @@ Text larger than the specified size is clipped. */)
parms = Fcons (Fcons (Qname, build_string ("tooltip")), parms);
if (NILP (Fassq (Qinternal_border_width, parms)))
parms = Fcons (Fcons (Qinternal_border_width, make_number (3)), parms);
+ if (NILP (Fassq (Qright_divider_width, parms)))
+ parms = Fcons (Fcons (Qright_divider_width, make_number (0)), parms);
+ if (NILP (Fassq (Qbottom_divider_width, parms)))
+ parms = Fcons (Fcons (Qbottom_divider_width, make_number (0)), parms);
if (NILP (Fassq (Qborder_width, parms)))
parms = Fcons (Fcons (Qborder_width, make_number (1)), parms);
if (NILP (Fassq (Qborder_color, parms)))
@@ -6020,6 +6066,8 @@ Text larger than the specified size is clipped. */)
w = XWINDOW (FRAME_ROOT_WINDOW (f));
w->left_col = 0;
w->top_line = 0;
+ w->pixel_left = 0;
+ w->pixel_top = 0;
if (CONSP (Vx_max_tooltip_size)
&& INTEGERP (XCAR (Vx_max_tooltip_size))
@@ -6036,6 +6084,9 @@ Text larger than the specified size is clipped. */)
w->total_lines = 40;
}
+ w->pixel_width = w->total_cols * FRAME_COLUMN_WIDTH (f);
+ w->pixel_height = w->total_lines * FRAME_LINE_HEIGHT (f);
+
FRAME_TOTAL_COLS (f) = WINDOW_TOTAL_COLS (w);
adjust_frame_glyphs (f);
w->pseudo_window_p = 1;
@@ -6101,11 +6152,17 @@ Text larger than the specified size is clipped. */)
width of the frame. */
if (seen_reversed_p)
{
- /* w->total_cols and FRAME_TOTAL_COLS want the width in columns,
+ /* PXW: Why do we do the pixel-to-cols conversion only if
+ seen_reversed_p holds? Don't we have to set other fields of
+ the window/frame structure?
+
+ w->total_cols and FRAME_TOTAL_COLS want the width in columns,
not in pixels. */
+ w->pixel_width = width;
width /= WINDOW_FRAME_COLUMN_WIDTH (w);
w->total_cols = width;
FRAME_TOTAL_COLS (f) = width;
+ SET_FRAME_WIDTH (f, width);
adjust_frame_glyphs (f);
w->pseudo_window_p = 1;
clear_glyph_matrix (w->desired_matrix);
@@ -6135,16 +6192,15 @@ Text larger than the specified size is clipped. */)
}
}
- /* Round up the height to an integral multiple of FRAME_LINE_HEIGHT. */
- if (height % FRAME_LINE_HEIGHT (f) != 0)
- height += FRAME_LINE_HEIGHT (f) - height % FRAME_LINE_HEIGHT (f);
/* Add the frame's internal border to the width and height the w32
window should have. */
height += 2 * FRAME_INTERNAL_BORDER_WIDTH (f);
width += 2 * FRAME_INTERNAL_BORDER_WIDTH (f);
/* Move the tooltip window where the mouse pointer is. Resize and
- show it. */
+ show it.
+
+ PXW: This should use the frame's pixel coordinates. */
compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y);
{
@@ -7212,6 +7268,29 @@ This is a direct interface to the Windows API FindWindow function. */)
return Qt;
}
+DEFUN ("w32-frame-rect", Fw32_frame_rect, Sw32_frame_rect, 0, 2, 0,
+ doc: /* Return boundary rectangle of FRAME in screen coordinates.
+FRAME must be a live frame and defaults to the selected one.
+
+The boundary rectangle is a list of four elements, specifying the left,
+top, right and bottom screen coordinates of FRAME including menu and
+title bar and decorations. Optional argument CLIENT non-nil means to
+return the boundaries of the client rectangle which excludes menu and
+title bar and decorations. */)
+ (Lisp_Object frame, Lisp_Object client)
+{
+ struct frame *f = decode_live_frame (frame);
+ RECT rect;
+
+ if (!NILP (client))
+ GetClientRect (FRAME_W32_WINDOW (f), &rect);
+ else
+ GetWindowRect (FRAME_W32_WINDOW (f), &rect);
+
+ return list4 (make_number (rect.left), make_number (rect.top),
+ make_number (rect.right), make_number (rect.bottom));
+}
+
DEFUN ("w32-battery-status", Fw32_battery_status, Sw32_battery_status, 0, 0, 0,
doc: /* Get power status information from Windows system.
@@ -7868,6 +7947,8 @@ frame_parm_handler w32_frame_parm_handlers[] =
x_set_icon_name,
x_set_icon_type,
x_set_internal_border_width,
+ x_set_right_divider_width,
+ x_set_bottom_divider_width,
x_set_menu_bar_lines,
x_set_mouse_color,
x_explicitly_set_name,
@@ -8119,6 +8200,13 @@ or when you set the mouse color. */);
This variable takes effect when you create a new frame
or when you set the mouse color. */);
Vx_window_horizontal_drag_shape = Qnil;
+
+ DEFVAR_LISP ("x-window-vertical-drag-cursor",
+ Vx_window_vertical_drag_shape,
+ doc: /* Pointer shape to use for indicating a window can be dragged vertically.
+This variable takes effect when you create a new frame
+or when you set the mouse color. */);
+ Vx_window_vertical_drag_shape = Qnil;
#endif
DEFVAR_LISP ("x-cursor-fore-pixel", Vx_cursor_fore_pixel,
@@ -8211,6 +8299,7 @@ only be necessary if the default setting causes problems. */);
defsubr (&Sw32_reconstruct_hot_key);
defsubr (&Sw32_toggle_lock_key);
defsubr (&Sw32_window_exists_p);
+ defsubr (&Sw32_frame_rect);
defsubr (&Sw32_battery_status);
#ifdef WINDOWSNT
@@ -8238,61 +8327,35 @@ only be necessary if the default setting causes problems. */);
#endif
}
+
-/*
- globals_of_w32fns is used to initialize those global variables that
- must always be initialized on startup even when the global variable
- initialized is non zero (see the function main in emacs.c).
- globals_of_w32fns is called from syms_of_w32fns when the global
- variable initialized is 0 and directly from main when initialized
- is non zero.
- */
-void
-globals_of_w32fns (void)
-{
- HMODULE user32_lib = GetModuleHandle ("user32.dll");
- /*
- TrackMouseEvent not available in all versions of Windows, so must load
- it dynamically. Do it once, here, instead of every time it is used.
- */
- track_mouse_event_fn = (TrackMouseEvent_Proc)
- GetProcAddress (user32_lib, "TrackMouseEvent");
-
- monitor_from_point_fn = (MonitorFromPoint_Proc)
- GetProcAddress (user32_lib, "MonitorFromPoint");
- get_monitor_info_fn = (GetMonitorInfo_Proc)
- GetProcAddress (user32_lib, "GetMonitorInfoA");
- monitor_from_window_fn = (MonitorFromWindow_Proc)
- GetProcAddress (user32_lib, "MonitorFromWindow");
- enum_display_monitors_fn = (EnumDisplayMonitors_Proc)
- GetProcAddress (user32_lib, "EnumDisplayMonitors");
-
- {
- HMODULE imm32_lib = GetModuleHandle ("imm32.dll");
- get_composition_string_fn = (ImmGetCompositionString_Proc)
- GetProcAddress (imm32_lib, "ImmGetCompositionStringW");
- get_ime_context_fn = (ImmGetContext_Proc)
- GetProcAddress (imm32_lib, "ImmGetContext");
- release_ime_context_fn = (ImmReleaseContext_Proc)
- GetProcAddress (imm32_lib, "ImmReleaseContext");
- set_ime_composition_window_fn = (ImmSetCompositionWindow_Proc)
- GetProcAddress (imm32_lib, "ImmSetCompositionWindow");
- }
- DEFVAR_INT ("w32-ansi-code-page",
- w32_ansi_code_page,
- doc: /* The ANSI code page used by the system. */);
- w32_ansi_code_page = GetACP ();
+/* Crashing and reporting backtrace. */
- if (os_subtype == OS_NT)
- w32_unicode_gui = 1;
- else
- w32_unicode_gui = 0;
-
- /* MessageBox does not work without this when linked to comctl32.dll 6.0. */
- InitCommonControls ();
+#ifndef CYGWIN
+static LONG CALLBACK my_exception_handler (EXCEPTION_POINTERS *);
+static LPTOP_LEVEL_EXCEPTION_FILTER prev_exception_handler;
+#endif
+static DWORD except_code;
+static PVOID except_addr;
- syms_of_w32uniscribe ();
+#ifndef CYGWIN
+/* This handler records the exception code and the address where it
+ was triggered so that this info could be included in the backtrace.
+ Without that, the backtrace in some cases has no information
+ whatsoever about the offending code, and looks as if the top-level
+ exception handler in the MinGW startup code di the one that
+ crashed. */
+static LONG CALLBACK
+my_exception_handler (EXCEPTION_POINTERS * exception_data)
+{
+ except_code = exception_data->ExceptionRecord->ExceptionCode;
+ except_addr = exception_data->ExceptionRecord->ExceptionAddress;
+
+ if (prev_exception_handler)
+ return prev_exception_handler (exception_data);
+ return EXCEPTION_EXECUTE_HANDLER;
}
+#endif
typedef USHORT (WINAPI * CaptureStackBackTrace_proc) (ULONG, ULONG, PVOID *,
PULONG);
@@ -8349,21 +8412,32 @@ emacs_abort (void)
if (i)
{
+ int errfile_fd = -1;
+ int j;
+ char buf[sizeof ("\r\nException at this address:\r\n\r\n")
+ + 2 * INT_BUFSIZE_BOUND (void *)];
#ifdef CYGWIN
int stderr_fd = 2;
#else
HANDLE errout = GetStdHandle (STD_ERROR_HANDLE);
int stderr_fd = -1;
-#endif
- int errfile_fd = -1;
- int j;
-#ifndef CYGWIN
if (errout && errout != INVALID_HANDLE_VALUE)
stderr_fd = _open_osfhandle ((intptr_t)errout, O_APPEND | O_BINARY);
#endif
+
+ /* We use %p, not 0x%p, as %p produces a leading "0x" on XP,
+ but not on Windows 7. addr2line doesn't mind a missing
+ "0x", but will be confused by an extra one. */
+ if (except_addr)
+ sprintf (buf, "\r\nException 0x%lx at this address:\r\n%p\r\n",
+ except_code, except_addr);
if (stderr_fd >= 0)
- write (stderr_fd, "\r\nBacktrace:\r\n", 14);
+ {
+ if (except_addr)
+ write (stderr_fd, buf, strlen (buf));
+ write (stderr_fd, "\r\nBacktrace:\r\n", 14);
+ }
#ifdef CYGWIN
#define _open open
#endif
@@ -8371,17 +8445,17 @@ emacs_abort (void)
if (errfile_fd >= 0)
{
lseek (errfile_fd, 0L, SEEK_END);
+ if (except_addr)
+ write (errfile_fd, buf, strlen (buf));
write (errfile_fd, "\r\nBacktrace:\r\n", 14);
}
for (j = 0; j < i; j++)
{
- char buf[INT_BUFSIZE_BOUND (void *)];
-
/* stack[] gives the return addresses, whereas we want
the address of the call, so decrease each address
by approximate size of 1 CALL instruction. */
- sprintf (buf, "0x%p\r\n", (char *)stack[j] - sizeof(void *));
+ sprintf (buf, "%p\r\n", (char *)stack[j] - sizeof(void *));
if (stderr_fd >= 0)
write (stderr_fd, buf, strlen (buf));
if (errfile_fd >= 0)
@@ -8403,6 +8477,72 @@ emacs_abort (void)
}
}
+
+
+/* Initialization. */
+
+/*
+ globals_of_w32fns is used to initialize those global variables that
+ must always be initialized on startup even when the global variable
+ initialized is non zero (see the function main in emacs.c).
+ globals_of_w32fns is called from syms_of_w32fns when the global
+ variable initialized is 0 and directly from main when initialized
+ is non zero.
+ */
+void
+globals_of_w32fns (void)
+{
+ HMODULE user32_lib = GetModuleHandle ("user32.dll");
+ /*
+ TrackMouseEvent not available in all versions of Windows, so must load
+ it dynamically. Do it once, here, instead of every time it is used.
+ */
+ track_mouse_event_fn = (TrackMouseEvent_Proc)
+ GetProcAddress (user32_lib, "TrackMouseEvent");
+
+ monitor_from_point_fn = (MonitorFromPoint_Proc)
+ GetProcAddress (user32_lib, "MonitorFromPoint");
+ get_monitor_info_fn = (GetMonitorInfo_Proc)
+ GetProcAddress (user32_lib, "GetMonitorInfoA");
+ monitor_from_window_fn = (MonitorFromWindow_Proc)
+ GetProcAddress (user32_lib, "MonitorFromWindow");
+ enum_display_monitors_fn = (EnumDisplayMonitors_Proc)
+ GetProcAddress (user32_lib, "EnumDisplayMonitors");
+
+ {
+ HMODULE imm32_lib = GetModuleHandle ("imm32.dll");
+ get_composition_string_fn = (ImmGetCompositionString_Proc)
+ GetProcAddress (imm32_lib, "ImmGetCompositionStringW");
+ get_ime_context_fn = (ImmGetContext_Proc)
+ GetProcAddress (imm32_lib, "ImmGetContext");
+ release_ime_context_fn = (ImmReleaseContext_Proc)
+ GetProcAddress (imm32_lib, "ImmReleaseContext");
+ set_ime_composition_window_fn = (ImmSetCompositionWindow_Proc)
+ GetProcAddress (imm32_lib, "ImmSetCompositionWindow");
+ }
+
+ except_code = 0;
+ except_addr = 0;
+#ifndef CYGWIN
+ prev_exception_handler = SetUnhandledExceptionFilter (my_exception_handler);
+#endif
+
+ DEFVAR_INT ("w32-ansi-code-page",
+ w32_ansi_code_page,
+ doc: /* The ANSI code page used by the system. */);
+ w32_ansi_code_page = GetACP ();
+
+ if (os_subtype == OS_NT)
+ w32_unicode_gui = 1;
+ else
+ w32_unicode_gui = 0;
+
+ /* MessageBox does not work without this when linked to comctl32.dll 6.0. */
+ InitCommonControls ();
+
+ syms_of_w32uniscribe ();
+}
+
#ifdef NTGUI_UNICODE
Lisp_Object
diff --git a/src/w32font.c b/src/w32font.c
index effedfc04e1..654e0d9cae4 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -149,6 +149,7 @@ static BOOL g_b_init_get_outline_metrics_w;
static BOOL g_b_init_get_text_metrics_w;
static BOOL g_b_init_get_glyph_outline_w;
static BOOL g_b_init_get_glyph_outline_w;
+static BOOL g_b_init_get_char_width_32_w;
typedef UINT (WINAPI * GetOutlineTextMetricsW_Proc) (
HDC hdc,
@@ -165,6 +166,11 @@ typedef DWORD (WINAPI * GetGlyphOutlineW_Proc) (
DWORD cbBuffer,
LPVOID lpvBuffer,
const MAT2 *lpmat2);
+typedef BOOL (WINAPI * GetCharWidth32W_Proc) (
+ HDC hdc,
+ UINT uFirstChar,
+ UINT uLastChar,
+ LPINT lpBuffer);
/* Several "wide" functions we use to support the font backends are
unavailable on Windows 9X, unless UNICOWS.DLL is installed (their
@@ -274,6 +280,23 @@ get_glyph_outline_w (HDC hdc, UINT uChar, UINT uFormat, LPGLYPHMETRICS lpgm,
lpvBuffer, lpmat2);
}
+static DWORD WINAPI get_char_width_32_w (HDC hdc, UINT uFirstChar,
+ UINT uLastChar, LPINT lpBuffer)
+{
+ static GetCharWidth32W_Proc s_pfn_Get_Char_Width_32W = NULL;
+ HMODULE hm_unicows = NULL;
+ if (g_b_init_get_char_width_32_w == 0)
+ {
+ g_b_init_get_char_width_32_w = 1;
+ hm_unicows = w32_load_unicows_or_gdi32 ();
+ if (hm_unicows)
+ s_pfn_Get_Char_Width_32W = (GetCharWidth32W_Proc)
+ GetProcAddress (hm_unicows, "GetCharWidth32W");
+ }
+ eassert (s_pfn_Get_Char_Width_32W != NULL);
+ return s_pfn_Get_Char_Width_32W (hdc, uFirstChar, uLastChar, lpBuffer);
+}
+
static int
memq_no_quit (Lisp_Object elt, Lisp_Object list)
{
@@ -989,7 +1012,6 @@ w32font_open_internal (struct frame *f, Lisp_Object font_entity,
font->baseline_offset = 0;
font->relative_compose = 0;
font->default_ascent = w32_font->metrics.tmAscent;
- font->font_encoder = NULL;
font->pixel_size = size;
font->driver = &w32font_driver;
/* Use format cached during list, as the information we have access to
@@ -2437,6 +2459,7 @@ compute_metrics (HDC dc, struct w32font_info *w32_font, unsigned int code,
GLYPHMETRICS gm;
MAT2 transform;
unsigned int options = GGO_METRICS;
+ INT width;
if (w32_font->glyph_idx)
options |= GGO_GLYPH_INDEX;
@@ -2453,6 +2476,13 @@ compute_metrics (HDC dc, struct w32font_info *w32_font, unsigned int code,
metrics->width = gm.gmCellIncX;
metrics->status = W32METRIC_SUCCESS;
}
+ else if (get_char_width_32_w (dc, code, code, &width) != 0)
+ {
+ metrics->lbearing = 0;
+ metrics->rbearing = width;
+ metrics->width = width;
+ metrics->status = W32METRIC_SUCCESS;
+ }
else
metrics->status = W32METRIC_FAIL;
}
@@ -2727,4 +2757,5 @@ globals_of_w32font (void)
g_b_init_get_outline_metrics_w = 0;
g_b_init_get_text_metrics_w = 0;
g_b_init_get_glyph_outline_w = 0;
+ g_b_init_get_char_width_32_w = 0;
}
diff --git a/src/w32inevt.c b/src/w32inevt.c
index dc587de1183..d4c96bd9b8a 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -587,7 +587,7 @@ resize_event (WINDOW_BUFFER_SIZE_RECORD *event)
{
struct frame *f = get_frame ();
- change_frame_size (f, event->dwSize.Y, event->dwSize.X, 0, 1, 0);
+ change_frame_size (f, event->dwSize.X, event->dwSize.Y, 0, 1, 0, 0);
SET_FRAME_GARBAGED (f);
}
@@ -602,13 +602,13 @@ maybe_generate_resize_event (void)
/* It is okay to call this unconditionally, since it will do nothing
if the size hasn't actually changed. */
change_frame_size (f,
- 1 + info.srWindow.Bottom - info.srWindow.Top,
1 + info.srWindow.Right - info.srWindow.Left,
- 0, 0, 0);
+ 1 + info.srWindow.Bottom - info.srWindow.Top,
+ 0, 0, 0, 0);
}
#if HAVE_W32NOTIFY
-static int
+int
handle_file_notifications (struct input_event *hold_quit)
{
BYTE *p = file_notifications;
@@ -676,7 +676,7 @@ handle_file_notifications (struct input_event *hold_quit)
return nevents;
}
#else /* !HAVE_W32NOTIFY */
-static int
+int
handle_file_notifications (struct input_event *hold_quit)
{
return 0;
diff --git a/src/w32menu.c b/src/w32menu.c
index b25652017cd..4f8e8dbef05 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -114,7 +114,6 @@ static int fill_in_menu (HMENU, widget_value *);
void w32_free_menu_strings (HWND);
-#ifdef HAVE_MENUS
#ifdef HAVE_DIALOGS
Lisp_Object
w32_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents)
@@ -506,7 +505,7 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
/* Force the window size to be recomputed so that the frame's text
area remains the same, if menubar has just been created. */
if (old_widget == NULL)
- x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
+ x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 1);
}
unblock_input ();
@@ -1602,21 +1601,15 @@ w32_free_menu_strings (HWND hwnd)
current_popup_menu = NULL;
}
-#endif /* HAVE_MENUS */
-
/* The following is used by delayed window autoselection. */
DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,
doc: /* Return t if a menu or popup dialog is active on selected frame. */)
(void)
{
-#ifdef HAVE_MENUS
struct frame *f;
f = SELECTED_FRAME ();
return (f->output_data.w32->menubar_active > 0) ? Qt : Qnil;
-#else
- return Qnil;
-#endif /* HAVE_MENUS */
}
void
diff --git a/src/w32notify.c b/src/w32notify.c
index a48a83daf53..373e20e8e92 100644
--- a/src/w32notify.c
+++ b/src/w32notify.c
@@ -163,7 +163,12 @@ send_notifications (BYTE *info, DWORD info_size, void *desc,
&& PostThreadMessage (dwMainThreadId, WM_EMACS_FILENOTIFY, 0, 0))
|| (FRAME_W32_P (f)
&& PostMessage (FRAME_W32_WINDOW (f),
- WM_EMACS_FILENOTIFY, 0, 0)))
+ WM_EMACS_FILENOTIFY, 0, 0))
+ /* When we are running in batch mode, there's no one to
+ send a message, so we just signal the data is
+ available and hope sys_select will be called soon and
+ will read the data. */
+ || (FRAME_INITIAL_P (f) && noninteractive))
notification_buffer_in_use = 1;
done = 1;
}
@@ -324,7 +329,7 @@ add_watch (const char *parent_dir, const char *file, BOOL subdirs, DWORD flags)
HANDLE hdir;
struct notification *dirwatch = NULL;
- if (!file || !*file)
+ if (!file)
return NULL;
hdir = CreateFile (parent_dir,
@@ -526,13 +531,21 @@ generate notifications correctly, though. */)
report_file_error ("GetFullPathName failed",
Fcons (lisp_errstr, Fcons (file, Qnil)));
}
- /* We need the parent directory without the slash that follows it.
- If BASENAME is NULL, the argument was the root directory on its
- drive. */
- if (basename)
- basename[-1] = '\0';
+ /* filenotify.el always passes us a directory, either the parent
+ directory of a file to be watched, or the directory to be
+ watched. */
+ if (file_directory_p (parent_dir))
+ basename = "";
else
- subdirs = TRUE;
+ {
+ /* This should only happen if we are called directly, not via
+ filenotify.el. If BASENAME is NULL, the argument was the
+ root directory on its drive. */
+ if (basename)
+ basename[-1] = '\0';
+ else
+ subdirs = TRUE;
+ }
if (!NILP (Fmember (Qsubtree, filter)))
subdirs = TRUE;
diff --git a/src/w32proc.c b/src/w32proc.c
index d2751d50680..7d4fb9825fa 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -1941,12 +1941,17 @@ sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
FD_ZERO (rfds);
nr = 0;
- /* Always wait on interrupt_handle, to detect C-g (quit). */
- wait_hnd[0] = interrupt_handle;
- fdindex[0] = -1;
+ /* If interrupt_handle is available and valid, always wait on it, to
+ detect C-g (quit). */
+ nh = 0;
+ if (interrupt_handle && interrupt_handle != INVALID_HANDLE_VALUE)
+ {
+ wait_hnd[0] = interrupt_handle;
+ fdindex[0] = -1;
+ nh++;
+ }
/* Build a list of pipe handles to wait on. */
- nh = 1;
for (i = 0; i < nfds; i++)
if (FD_ISSET (i, &orfds))
{
@@ -1967,6 +1972,11 @@ sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
FD_SET (i, rfds);
return 1;
}
+ else if (noninteractive)
+ {
+ if (handle_file_notifications (NULL))
+ return 1;
+ }
}
else
{
@@ -2067,6 +2077,11 @@ count_children:
{
if (timeout)
Sleep (timeout_ms);
+ if (noninteractive)
+ {
+ if (handle_file_notifications (NULL))
+ return 1;
+ }
return 0;
}
@@ -2093,6 +2108,11 @@ count_children:
}
else if (active == WAIT_TIMEOUT)
{
+ if (noninteractive)
+ {
+ if (handle_file_notifications (NULL))
+ return 1;
+ }
return 0;
}
else if (active >= WAIT_OBJECT_0
@@ -2199,6 +2219,12 @@ count_children:
break;
} while (active < nh + nc);
+ if (noninteractive)
+ {
+ if (handle_file_notifications (NULL))
+ nr++;
+ }
+
/* If no input has arrived and timeout hasn't expired, wait again. */
if (nr == 0)
{
diff --git a/src/w32term.c b/src/w32term.c
index b29087ef57b..9c74304a83a 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -181,7 +181,7 @@ void x_lower_frame (struct frame *);
void x_scroll_bar_clear (struct frame *);
void x_wm_set_size_hint (struct frame *, long, bool);
void x_raise_frame (struct frame *);
-void x_set_window_size (struct frame *, int, int, int);
+void x_set_window_size (struct frame *, int, int, int, bool);
void x_wm_set_window_state (struct frame *, int);
void x_wm_set_icon_pixmap (struct frame *, int);
static void w32_initialize (void);
@@ -622,6 +622,32 @@ w32_draw_vertical_window_border (struct window *w, int x, int y0, int y1)
}
+/* Draw a window divider from (x0, y0) to (x1, y1) */
+
+static void
+w32_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1)
+{
+ struct frame *f = XFRAME (WINDOW_FRAME (w));
+ RECT r;
+ HDC hdc;
+ struct face *face;
+
+ r.left = x0;
+ r.right = x1;
+ r.top = y0;
+ r.bottom = y1;
+
+ hdc = get_frame_dc (f);
+ face = FACE_FROM_ID (f, WINDOW_DIVIDER_FACE_ID);
+ if (face)
+ w32_fill_rect (f, hdc, face->foreground, &r);
+ else
+ w32_fill_rect (f, hdc, FRAME_FOREGROUND_PIXEL (f), &r);
+
+ release_frame_dc (f, hdc);
+}
+
+
/* End update of window W.
Draw vertical borders between horizontally adjacent windows, and
@@ -649,7 +675,12 @@ x_update_window_end (struct window *w, bool cursor_on_p,
w->output_cursor.x, w->output_cursor.y);
if (draw_window_fringes (w, 1))
- x_draw_vertical_border (w);
+ {
+ if (WINDOW_RIGHT_DIVIDER_WIDTH (w))
+ x_draw_right_divider (w);
+ else
+ x_draw_vertical_border (w);
+ }
unblock_input ();
}
@@ -778,8 +809,7 @@ w32_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
if (sb_width > 0)
{
int bar_area_x = WINDOW_SCROLL_BAR_AREA_X (w);
- int bar_area_width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
- * FRAME_COLUMN_WIDTH (f));
+ int bar_area_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
if (bx < 0)
{
@@ -2676,8 +2706,7 @@ x_scroll_run (struct window *w, struct run *run)
if (sb_width > 0)
{
int bar_area_x = WINDOW_SCROLL_BAR_AREA_X (w);
- int bar_area_width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
- * FRAME_COLUMN_WIDTH (f));
+ int bar_area_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
if (bar_area_x + bar_area_width == x)
{
@@ -3761,7 +3790,7 @@ w32_set_vertical_scroll_bar (struct window *w,
/* Get window dimensions. */
window_box (w, ANY_AREA, 0, &window_y, 0, &window_height);
top = window_y;
- width = WINDOW_CONFIG_SCROLL_BAR_COLS (w) * FRAME_COLUMN_WIDTH (f);
+ width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
height = window_height;
/* Compute the left edge of the scroll bar area. */
@@ -4216,7 +4245,6 @@ w32_read_socket (struct terminal *terminal,
struct frame *f;
struct w32_display_info *dpyinfo = &one_w32_display_info;
Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
- static char buf[1];
block_input ();
@@ -4702,6 +4730,47 @@ w32_read_socket (struct terminal *terminal,
break;
case SIZE_MAXIMIZED:
+ {
+ bool iconified = FRAME_ICONIFIED_P (f);
+
+ SET_FRAME_VISIBLE (f, 1);
+ SET_FRAME_ICONIFIED (f, 0);
+
+ /* wait_reading_process_output will notice this
+ and update the frame's display structures. */
+ SET_FRAME_GARBAGED (f);
+
+ if (iconified)
+ {
+ int x, y;
+
+ /* Reset top and left positions of the Window
+ here since Windows sends a WM_MOVE message
+ BEFORE telling us the Window is minimized
+ when the Window is iconified, with 3000,3000
+ as the co-ords. */
+ x_real_positions (f, &x, &y);
+ f->left_pos = x;
+ f->top_pos = y;
+
+ inev.kind = DEICONIFY_EVENT;
+ XSETFRAME (inev.frame_or_window, f);
+ }
+ else if (! NILP (Vframe_list)
+ && ! NILP (XCDR (Vframe_list)))
+ /* Force a redisplay sooner or later
+ to update the frame titles
+ in case this is the second frame. */
+ record_asynch_buffer_change ();
+ }
+
+ if (get_frame_param (f, Qfullscreen) == Qnil)
+ set_frame_param (f, Qfullscreen, Qmaximized);
+ else if (get_frame_param (f, Qfullscreen) != Qmaximized)
+ set_frame_param (f, Qmaximized, Qmaximized);
+
+ break;
+
case SIZE_RESTORED:
{
bool iconified = FRAME_ICONIFIED_P (f);
@@ -4733,6 +4802,12 @@ w32_read_socket (struct terminal *terminal,
in case this is the second frame. */
record_asynch_buffer_change ();
}
+
+ if (get_frame_param (f, Qfullscreen) == Qmaximized)
+ set_frame_param (f, Qfullscreen, Qnil);
+ else if (get_frame_param (f, Qmaximized) != Qnil)
+ set_frame_param (f, Qmaximized, Qnil);
+
break;
}
}
@@ -4740,16 +4815,14 @@ w32_read_socket (struct terminal *terminal,
if (f && !FRAME_ICONIFIED_P (f) && msg.msg.wParam != SIZE_MINIMIZED)
{
RECT rect;
- int rows;
- int columns;
- int width;
- int height;
+ int rows, columns, width, height, text_width, text_height;
GetClientRect (msg.msg.hwnd, &rect);
height = rect.bottom - rect.top;
width = rect.right - rect.left;
-
+ text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, width);
+ text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, height);
rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height);
columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width);
@@ -4759,16 +4832,18 @@ w32_read_socket (struct terminal *terminal,
not changed, the font size may have changed, so we need
to check the pixel dimensions as well. */
- if (columns != FRAME_COLS (f)
- || rows != FRAME_LINES (f)
- || width != FRAME_PIXEL_WIDTH (f)
- || height != FRAME_PIXEL_HEIGHT (f))
+ if (width != FRAME_PIXEL_WIDTH (f)
+ || height != FRAME_PIXEL_HEIGHT (f)
+ || text_width != FRAME_TEXT_WIDTH (f)
+ || text_height != FRAME_TEXT_HEIGHT (f))
{
- change_frame_size (f, rows, columns, 0, 1, 0);
+ change_frame_size (f, text_width, text_height, 0, 1, 0, 1);
SET_FRAME_GARBAGED (f);
cancel_mouse_face (f);
- FRAME_PIXEL_WIDTH (f) = width;
- FRAME_PIXEL_HEIGHT (f) = height;
+ /* Do we want to set these here ???? */
+/** FRAME_PIXEL_WIDTH (f) = width; **/
+/** FRAME_TEXT_WIDTH (f) = text_width; **/
+/** FRAME_PIXEL_HEIGHT (f) = height; **/
f->win_gravity = NorthWestGravity;
}
}
@@ -5425,7 +5500,8 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
doing it because it's done in Fx_show_tip, and it leads to
problems because the tip frame has no widget. */
if (NILP (tip_frame) || XFRAME (tip_frame) != f)
- x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
+ x_set_window_size (f, 0, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
+ FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 1);
}
/* X version sets font of input methods here also. */
@@ -5563,7 +5639,7 @@ x_check_fullscreen (struct frame *f)
when setting WM manager hints. */
if (FRAME_COLS (f) != width || FRAME_LINES (f) != height)
{
- change_frame_size (f, height, width, 0, 1, 0);
+ change_frame_size (f, width, height, 0, 1, 0, 0);
SET_FRAME_GARBAGED (f);
cancel_mouse_face (f);
@@ -5627,20 +5703,28 @@ w32fullscreen_hook (struct frame *f)
Otherwise we leave the window gravity unchanged. */
void
-x_set_window_size (struct frame *f, int change_gravity, int cols, int rows)
+x_set_window_size (struct frame *f, int change_gravity, int width, int height, bool pixelwise)
{
int pixelwidth, pixelheight;
block_input ();
- check_frame_size (f, &rows, &cols);
+ check_frame_size (f, &width, &height, pixelwise);
f->scroll_bar_actual_width
= FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
compute_fringe_widths (f, 0);
- pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols);
- pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
+ if (pixelwise)
+ {
+ pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width);
+ pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height);
+ }
+ else
+ {
+ pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width);
+ pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height);
+ }
f->win_gravity = NorthWestGravity;
x_wm_set_size_hint (f, (long) 0, 0);
@@ -5691,7 +5775,7 @@ x_set_window_size (struct frame *f, int change_gravity, int cols, int rows)
We pass 1 for DELAY since we can't run Lisp code inside of
a BLOCK_INPUT. */
- change_frame_size (f, rows, cols, 0, 1, 0);
+ change_frame_size (f, width, height, 0, 1, 0, 0);
FRAME_PIXEL_WIDTH (f) = pixelwidth;
FRAME_PIXEL_HEIGHT (f) = pixelheight;
@@ -6072,7 +6156,7 @@ x_wm_set_size_hint (struct frame *f, long flags, bool user_position)
SetWindowLong (window, WND_FONTWIDTH_INDEX, FRAME_COLUMN_WIDTH (f));
SetWindowLong (window, WND_LINEHEIGHT_INDEX, FRAME_LINE_HEIGHT (f));
SetWindowLong (window, WND_BORDER_INDEX, FRAME_INTERNAL_BORDER_WIDTH (f));
- SetWindowLong (window, WND_SCROLLBAR_INDEX, f->scroll_bar_actual_width);
+ SetWindowLong (window, WND_SCROLLBAR_INDEX, FRAME_SCROLL_BAR_AREA_WIDTH (f));
leave_crit ();
}
@@ -6212,6 +6296,7 @@ static struct redisplay_interface w32_redisplay_interface =
w32_clear_frame_area,
w32_draw_window_cursor,
w32_draw_vertical_window_border,
+ w32_draw_window_divider,
w32_shift_glyphs_for_insert
};
diff --git a/src/w32term.h b/src/w32term.h
index b3c0cf56c7b..89008b7348c 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -26,23 +26,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define BLACK_PIX_DEFAULT(f) PALETTERGB(0,0,0)
#define WHITE_PIX_DEFAULT(f) PALETTERGB(255,255,255)
-#define FONT_WIDTH(f) ((f)->max_width)
-#define FONT_HEIGHT(f) ((f)->height)
-#define FONT_BASE(f) ((f)->ascent)
-#define FONT_DESCENT(f) ((f)->descent)
-
#define CP_DEFAULT 1004
-#define CHECK_W32_FRAME(f, frame) \
- if (NILP (frame)) \
- f = SELECTED_FRAME (); \
- else \
- { \
- CHECK_LIVE_FRAME (frame, 0); \
- f = XFRAME (frame); \
- } \
- if (! FRAME_W32_P (f))
-
/* Indicates whether we are in the readsocket call and the message we
are processing in the current loop */
@@ -230,7 +215,7 @@ extern struct w32_display_info *w32_term_init (Lisp_Object,
extern int w32_defined_color (struct frame *f, const char *color,
XColor *color_def, int alloc);
extern void x_set_window_size (struct frame *f, int change_grav,
- int cols, int rows);
+ int width, int height, bool pixelwise);
extern int x_display_pixel_height (struct w32_display_info *);
extern int x_display_pixel_width (struct w32_display_info *);
extern Lisp_Object x_get_focus_frame (struct frame *);
@@ -349,6 +334,7 @@ struct w32_output
Cursor hand_cursor;
Cursor hourglass_cursor;
Cursor horizontal_drag_cursor;
+ Cursor vertical_drag_cursor;
/* Non-zero means hourglass cursor is currently displayed. */
unsigned hourglass_p : 1;
@@ -680,6 +666,7 @@ extern DWORD notifications_size;
extern void *notifications_desc;
extern Lisp_Object w32_get_watch_object (void *);
extern Lisp_Object lispy_file_action (DWORD);
+extern int handle_file_notifications (struct input_event *);
extern void w32_initialize_display_info (Lisp_Object);
extern void initialize_w32_display (struct terminal *, int *, int *);
diff --git a/src/w32xfns.c b/src/w32xfns.c
index 07f75477863..b49abffa130 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -24,6 +24,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "lisp.h"
#include "keyboard.h"
#include "frame.h"
+#include "window.h"
#include "charset.h"
#include "fontset.h"
#include "blockinput.h"
diff --git a/src/widget.c b/src/widget.c
index d6469d7eec5..89b43fdae76 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -412,7 +412,7 @@ set_frame_size (EmacsFrame ew)
#if 0 /* This can run Lisp code, and it is dangerous to give
out the frame to Lisp code before it officially exists.
This is handled in Fx_create_frame so not needed here. */
- change_frame_size (f, h, w, 1, 0, 0);
+ change_frame_size (f, w, h, 1, 0, 0, 0);
#endif
char_to_pixel_size (ew, w, h, &pixel_width, &pixel_height);
ew->core.width = pixel_width;
@@ -467,7 +467,7 @@ update_wm_hints (EmacsFrame ew)
if (! wmshell) return;
#if 0
- check_frame_size (ew->emacs_frame.frame, &min_rows, &min_cols);
+ check_frame_size (ew->emacs_frame.frame, &min_cols, &min_rows, 0);
#endif
pixel_to_char_size (ew, ew->core.width, ew->core.height,
@@ -681,7 +681,7 @@ EmacsFrameResize (Widget widget)
|| ew->core.width != FRAME_PIXEL_WIDTH (f)
|| ew->core.height + x->menubar_height != FRAME_PIXEL_HEIGHT (f))
{
- change_frame_size (f, rows, columns, 0, 1, 0);
+ change_frame_size (f, columns, rows, 0, 1, 0, 0);
update_wm_hints (ew);
update_various_frame_slots (ew);
@@ -735,8 +735,8 @@ EmacsFrameSetValues (Widget cur_widget, Widget req_widget, Widget new_widget, Ar
new->core.width = pixel_width;
new->core.height = pixel_height;
- change_frame_size (new->emacs_frame.frame, char_height, char_width,
- 1, 0, 0);
+ change_frame_size (new->emacs_frame.frame, char_width, char_height,
+ 1, 0, 0, 0);
needs_a_refresh = True;
}
@@ -798,7 +798,7 @@ EmacsFrameSetCharSize (Widget widget, int columns, int rows)
EmacsFrame ew = (EmacsFrame) widget;
struct frame *f = ew->emacs_frame.frame;
- x_set_window_size (f, 0, columns, rows);
+ x_set_window_size (f, 0, columns, rows, 0);
}
diff --git a/src/window.c b/src/window.c
index bc0adaf459f..d1f3dd599b1 100644
--- a/src/window.c
+++ b/src/window.c
@@ -51,6 +51,7 @@ static Lisp_Object Qrecord_window_buffer;
static Lisp_Object Qwindow_deletable_p, Qdelete_window, Qdisplay_buffer;
static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window;
static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically;
+static Lisp_Object Qwindow_pixel_to_total;
static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command;
static Lisp_Object Qsafe, Qabove, Qbelow, Qwindow_size, Qclone_of;
@@ -60,7 +61,6 @@ static int get_leaf_windows (struct window *, struct window **, int);
static void window_scroll (Lisp_Object, EMACS_INT, bool, int);
static void window_scroll_pixel_based (Lisp_Object, int, bool, int);
static void window_scroll_line_based (Lisp_Object, int, bool, int);
-static Lisp_Object window_list (void);
static int add_window_to_list (struct window *, void *);
static Lisp_Object next_window (Lisp_Object, Lisp_Object,
Lisp_Object, int);
@@ -75,6 +75,7 @@ static int foreach_window_1 (struct window *,
static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object);
static int window_resize_check (struct window *, bool);
static void window_resize_apply (struct window *, bool);
+static void window_resize_apply_total (struct window *, bool);
static Lisp_Object select_window (Lisp_Object, Lisp_Object, int);
static void select_window_1 (Lisp_Object, bool);
@@ -113,6 +114,9 @@ Lisp_Object minibuf_selected_window;
/* Hook run at end of temp_output_buffer_show. */
static Lisp_Object Qtemp_buffer_show_hook;
+/* Incremented for each window created. */
+static int sequence_number;
+
/* Nonzero after init_window_once has finished. */
static int window_initialized;
@@ -482,6 +486,15 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
record_buffer before returning here. */
goto record_and_return;
+ if (NILP (norecord))
+ { /* Mark the window for redisplay since the selected-window has
+ a different mode-line. */
+ wset_redisplay (XWINDOW (selected_window));
+ wset_redisplay (w);
+ }
+ else
+ redisplay_other_windows ();
+
sf = SELECTED_FRAME ();
if (XFRAME (WINDOW_FRAME (w)) != sf)
{
@@ -500,7 +513,6 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
select_window_1 (window, inhibit_point_swap);
bset_last_selected_window (XBUFFER (w->contents), window);
- windows_or_buffers_changed = 24;
record_and_return:
/* record_buffer can run QUIT, so make sure it is run only after we have
@@ -669,6 +681,31 @@ selected one. */)
return make_number (decode_live_window (window)->use_time);
}
+DEFUN ("window-pixel-width", Fwindow_pixel_width, Swindow_pixel_width, 0, 1, 0,
+ doc: /* Return the pixel width of window WINDOW.
+WINDOW must be a valid window and defaults to the selected one.
+
+The return value includes the fringes and margins of WINDOW as well as
+any vertical dividers or scroll bars belonging to WINDOW. If WINDOW is
+an internal window, its pixel width is the width of the screen areas
+spanned by its children. */)
+ (Lisp_Object window)
+{
+ return make_number (decode_valid_window (window)->pixel_width);
+}
+
+DEFUN ("window-pixel-height", Fwindow_pixel_height, Swindow_pixel_height, 0, 1, 0,
+ doc: /* Return the pixel height of window WINDOW.
+WINDOW must be a valid window and defaults to the selected one.
+
+The return value includes the mode line and header line, if any. If
+WINDOW is an internal window, its pixel height is the height of the
+screen areas spanned by its children. */)
+ (Lisp_Object window)
+{
+ return make_number (decode_valid_window (window)->pixel_height);
+}
+
DEFUN ("window-total-height", Fwindow_total_height, Swindow_total_height, 0, 1, 0,
doc: /* Return the total height, in lines, of window WINDOW.
WINDOW must be a valid window and defaults to the selected one.
@@ -726,6 +763,30 @@ WINDOW must be a valid window and defaults to the selected one. */)
return decode_valid_window (window)->new_normal;
}
+DEFUN ("window-new-pixel", Fwindow_new_pixel, Swindow_new_pixel, 0, 1, 0,
+ doc: /* Return new pixel size of window WINDOW.
+WINDOW must be a valid window and defaults to the selected one. */)
+ (Lisp_Object window)
+{
+ return decode_valid_window (window)->new_pixel;
+}
+
+DEFUN ("window-pixel-left", Fwindow_pixel_left, Swindow_pixel_left, 0, 1, 0,
+ doc: /* Return left pixel edge of window WINDOW.
+WINDOW must be a valid window and defaults to the selected one. */)
+ (Lisp_Object window)
+{
+ return make_number (decode_valid_window (window)->pixel_left);
+}
+
+DEFUN ("window-pixel-top", Fwindow_pixel_top, Swindow_pixel_top, 0, 1, 0,
+ doc: /* Return top pixel edge of window WINDOW.
+WINDOW must be a valid window and defaults to the selected one. */)
+ (Lisp_Object window)
+{
+ return make_number (decode_valid_window (window)->pixel_top);
+}
+
DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0,
doc: /* Return left column of window WINDOW.
This is the distance, in columns, between the left edge of WINDOW and
@@ -754,75 +815,118 @@ WINDOW must be a valid window and defaults to the selected one. */)
header line of W. */
static int
-window_body_lines (struct window *w)
+window_body_height (struct window *w, bool pixelwise)
{
- int height = w->total_lines;
-
- if (!MINI_WINDOW_P (w))
- {
- if (WINDOW_WANTS_MODELINE_P (w))
- --height;
- if (WINDOW_WANTS_HEADER_LINE_P (w))
- --height;
- }
+ int pixels = (w->pixel_height
+ - WINDOW_BOTTOM_DIVIDER_WIDTH (w)
+ - WINDOW_HEADER_LINE_HEIGHT (w)
+ - WINDOW_MODE_LINE_HEIGHT (w));
+ int unit = FRAME_LINE_HEIGHT (WINDOW_XFRAME (w));
- return height;
+ return pixelwise ? pixels : ((pixels + unit - 1) / unit);
}
/* Return the number of columns of W's body. Don't count columns
occupied by the scroll bar or the vertical bar separating W from its
right sibling. On window-systems don't count fringes or display
margins either. */
-
int
-window_body_cols (struct window *w)
+window_body_width (struct window *w, bool pixelwise)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
- int width = w->total_cols;
- if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w))
- /* Scroll bars occupy a few columns. */
- width -= WINDOW_CONFIG_SCROLL_BAR_COLS (w);
- else if (!FRAME_WINDOW_P (f)
- && !WINDOW_RIGHTMOST_P (w) && !WINDOW_FULL_WIDTH_P (w))
- /* The column of `|' characters separating side-by-side windows
- occupies one column only. */
- width -= 1;
+ int pixels = (w->pixel_width
+ - WINDOW_RIGHT_DIVIDER_WIDTH (w)
+ - (WINDOW_HAS_VERTICAL_SCROLL_BAR (w)
+ ? WINDOW_SCROLL_BAR_AREA_WIDTH (w)
+ : ((!FRAME_WINDOW_P (f)
+ && !WINDOW_RIGHTMOST_P (w)
+ && !WINDOW_RIGHT_DIVIDER_WIDTH (w)
+ && !WINDOW_FULL_WIDTH_P (w))
+ /* According to Eli this is either 1 or 0. */
+ ? 1 : 0))
+ - WINDOW_MARGINS_WIDTH (w)
+ - (FRAME_WINDOW_P (f)
+ ? WINDOW_FRINGES_WIDTH (w)
+ : 0));
+ int unit = FRAME_COLUMN_WIDTH (WINDOW_XFRAME (w));
+
+ return pixelwise ? pixels : ((pixels + unit - 1) / unit);
+}
+
+DEFUN ("window-body-height", Fwindow_body_height, Swindow_body_height, 0, 2, 0,
+ doc: /* Return the height, in lines, of WINDOW's text area.
+WINDOW must be a live window and defaults to the selected one.
- /* Display margins cannot be used for normal text. */
- width -= WINDOW_LEFT_MARGIN_COLS (w) + WINDOW_RIGHT_MARGIN_COLS (w);
+Optional argument PIXELWISE non-nil means return the height in pixels.
- if (FRAME_WINDOW_P (f))
- /* On window-systems, fringes cannot be used for normal text. */
- width -= WINDOW_FRINGE_COLS (w);
+The returned height does not include the mode line or header line. On a
+graphical display, the height is expressed as an integer multiple of the
+default character height if PIXELWISE is nil.
- return width;
+If PIXELWISE is nil and a line at the bottom of the text area is only
+partially visible, that counts as a whole line; to exclude
+partially-visible lines, use `window-text-height'. */)
+ (Lisp_Object window, Lisp_Object pixelwise)
+{
+ return make_number (window_body_height (decode_live_window (window),
+ NILP (pixelwise) ? 0 : 1));
}
-DEFUN ("window-body-height", Fwindow_body_height, Swindow_body_height, 0, 1, 0,
- doc: /* Return the height, in lines, of WINDOW's text area.
+DEFUN ("window-body-width", Fwindow_body_width, Swindow_body_width, 0, 2, 0,
+ doc: /* Return the width, in columns, of WINDOW's text area.
WINDOW must be a live window and defaults to the selected one.
-The returned height does not include the mode line or header line.
-On a graphical display, the height is expressed as an integer multiple
-of the default character height. If a line at the bottom of the text
-area is only partially visible, that counts as a whole line; to
-exclude partially-visible lines, use `window-text-height'. */)
+Optional argument PIXELWISE non-nil means return the width in pixels.
+
+The return value does not include any vertical dividers, fringe or
+marginal areas, or scroll bars. On a graphical display, the width is
+expressed as an integer multiple of the default character width if
+PIXELWISE is nil.
+
+If PIXELWISE is nil and a column at the right of the text area is only
+partially visible, that counts as a whole column; to exclude
+partially-visible columns, use `window-text-width'. */)
+ (Lisp_Object window, Lisp_Object pixelwise)
+{
+ return make_number (window_body_width (decode_live_window (window),
+ NILP (pixelwise) ? 0 : 1));
+}
+
+DEFUN ("window-mode-line-height", Fwindow_mode_line_height,
+ Swindow_mode_line_height, 0, 1, 0,
+ doc: /* Return the height in pixel of WINDOW's mode-line.
+WINDOW must be a live window and defaults to the selected one. */)
(Lisp_Object window)
{
- return make_number (window_body_lines (decode_live_window (window)));
+ return (make_number (WINDOW_MODE_LINE_HEIGHT (decode_live_window (window))));
}
-DEFUN ("window-body-width", Fwindow_body_width, Swindow_body_width, 0, 1, 0,
- doc: /* Return the width, in columns, of WINDOW's text area.
-WINDOW must be a live window and defaults to the selected one.
+DEFUN ("window-header-line-height", Fwindow_header_line_height,
+ Swindow_header_line_height, 0, 1, 0,
+ doc: /* Return the height in pixel of WINDOW's header-line.
+WINDOW must be a live window and defaults to the selected one. */)
+ (Lisp_Object window)
+{
+ return (make_number (WINDOW_HEADER_LINE_HEIGHT (decode_live_window (window))));
+}
-The return value does not include any vertical dividers, fringe or
-marginal areas, or scroll bars. On a graphical display, the width is
-expressed as an integer multiple of the default character width. */)
+DEFUN ("window-right-divider-width", Fwindow_right_divider_width,
+ Swindow_right_divider_width, 0, 1, 0,
+ doc: /* Return the width of WINDOW's right divider.
+WINDOW must be a live window and defaults to the selected one. */)
+ (Lisp_Object window)
+{
+ return (make_number (WINDOW_RIGHT_DIVIDER_WIDTH (decode_live_window (window))));
+}
+
+DEFUN ("window-bottom-divider-width", Fwindow_bottom_divider_width,
+ Swindow_bottom_divider_width, 0, 1, 0,
+ doc: /* Return the width of WINDOW's bottom divider.
+WINDOW must be a live window and defaults to the selected one. */)
(Lisp_Object window)
{
- return make_number (window_body_cols (decode_live_window (window)));
+ return (make_number (WINDOW_BOTTOM_DIVIDER_WIDTH (decode_live_window (window))));
}
DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0,
@@ -1072,11 +1176,15 @@ display margins, fringes, header line, and/or mode line. */)
/* Test if the character at column X, row Y is within window W.
If it is not, return ON_NOTHING;
+ if it is on the window's vertical divider, return
+ ON_RIGHT_DIVIDER;
+ if it is on the window's horizontal divider, return
+ ON_BOTTOM_DIVIDER;
if it is in the window's text area, return ON_TEXT;
if it is on the window's modeline, return ON_MODE_LINE;
if it is on the border between the window and its right sibling,
- return ON_VERTICAL_BORDER.
- if it is on a scroll bar, return ON_SCROLL_BAR.
+ return ON_VERTICAL_BORDER;
+ if it is on a scroll bar, return ON_SCROLL_BAR;
if it is on the window's top line, return ON_HEADER_LINE;
if it is in left or right fringe of the window,
return ON_LEFT_FRINGE or ON_RIGHT_FRINGE;
@@ -1104,13 +1212,28 @@ coordinates_in_window (register struct window *w, int x, int y)
if (y < top_y || y >= bottom_y || x < left_x || x >= right_x)
return ON_NOTHING;
- /* On the mode line or header line? */
- if ((WINDOW_WANTS_MODELINE_P (w)
- && y >= bottom_y - CURRENT_MODE_LINE_HEIGHT (w)
- && (part = ON_MODE_LINE))
- || (WINDOW_WANTS_HEADER_LINE_P (w)
- && y < top_y + CURRENT_HEADER_LINE_HEIGHT (w)
- && (part = ON_HEADER_LINE)))
+ /* On vertical window divider (which prevails horizontal
+ dividers)? */
+ if (!WINDOW_RIGHTMOST_P (w)
+ && WINDOW_RIGHT_DIVIDER_WIDTH (w)
+ && x >= right_x - WINDOW_RIGHT_DIVIDER_WIDTH (w)
+ && x <= right_x)
+ return ON_RIGHT_DIVIDER;
+ /* On the horizontal window divider? */
+ else if (WINDOW_BOTTOM_DIVIDER_WIDTH (w)
+ && y >= (bottom_y - WINDOW_BOTTOM_DIVIDER_WIDTH (w))
+ && y <= bottom_y)
+ return ON_BOTTOM_DIVIDER;
+ /* On the mode or header line? */
+ else if ((WINDOW_WANTS_MODELINE_P (w)
+ && y >= (bottom_y
+ - CURRENT_MODE_LINE_HEIGHT (w)
+ - WINDOW_BOTTOM_DIVIDER_WIDTH (w))
+ && y <= bottom_y - WINDOW_BOTTOM_DIVIDER_WIDTH (w)
+ && (part = ON_MODE_LINE))
+ || (WINDOW_WANTS_HEADER_LINE_P (w)
+ && y < top_y + CURRENT_HEADER_LINE_HEIGHT (w)
+ && (part = ON_HEADER_LINE)))
{
/* If it's under/over the scroll bar portion of the mode/header
line, say it's on the vertical line. That's to be able to
@@ -1133,7 +1256,7 @@ coordinates_in_window (register struct window *w, int x, int y)
if (w->pseudo_window_p)
{
left_x = 0;
- right_x = WINDOW_TOTAL_WIDTH (w) - 1;
+ right_x = WINDOW_PIXEL_WIDTH (w) - 1;
}
else
{
@@ -1163,6 +1286,8 @@ coordinates_in_window (register struct window *w, int x, int y)
terminals, the vertical line's x coordinate is right_x. */
else if (!w->pseudo_window_p
&& !WINDOW_RIGHTMOST_P (w)
+ /* Why check ux if we are not the rightmost window? Also
+ shouldn't a pseudo window always be rightmost? */
&& x > right_x - ux)
return ON_VERTICAL_BORDER;
@@ -1218,7 +1343,7 @@ window_relative_x_coord (struct window *w, enum window_part part, int x)
case ON_RIGHT_MARGIN:
return (x + 1
- ((w->pseudo_window_p)
- ? WINDOW_TOTAL_WIDTH (w)
+ ? WINDOW_PIXEL_WIDTH (w)
: WINDOW_BOX_RIGHT_EDGE_X (w))
+ window_box_width (w, RIGHT_MARGIN_AREA)
+ ((WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w))
@@ -1303,6 +1428,12 @@ If they are in the windows's left or right marginal areas, `left-margin'\n\
/* Historically we are supposed to return nil in this case. */
return Qnil;
+ case ON_RIGHT_DIVIDER:
+ return Qright_divider;
+
+ case ON_BOTTOM_DIVIDER:
+ return Qbottom_divider;
+
default:
emacs_abort ();
}
@@ -1553,7 +1684,7 @@ Return POS. */)
set_marker_restricted (w->pointm, pos, w->contents);
/* We have to make sure that redisplay updates the window to show
the new value of point. */
- windows_or_buffers_changed = 25;
+ wset_redisplay (w);
}
return pos;
@@ -1574,9 +1705,9 @@ overriding motion of point in order to display at this exact start. */)
if (NILP (noforce))
w->force_start = 1;
w->update_mode_line = 1;
- if (w != XWINDOW (selected_window))
- /* Enforce full redisplay. FIXME: make it more selective. */
- windows_or_buffers_changed = 26;
+ /* Bug#15957. */
+ w->window_end_valid = 0;
+ wset_redisplay (w);
return pos;
}
@@ -1995,6 +2126,10 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag)
if (setflag)
{
+ n->pixel_left = o->pixel_left;
+ n->pixel_top = o->pixel_top;
+ n->pixel_width = o->pixel_width;
+ n->pixel_height = o->pixel_height;
n->left_col = o->left_col;
n->top_line = o->top_line;
n->total_cols = o->total_cols;
@@ -2075,13 +2210,13 @@ recombine_windows (Lisp_Object window)
wset_parent (c, parent);
if (horflag)
- wset_normal_cols (c,
- make_float ((double) c->total_cols
- / (double) p->total_cols));
+ wset_normal_cols
+ (c, make_float ((double) c->pixel_width
+ / (double) p->pixel_width));
else
- wset_normal_lines (c,
- make_float ((double) c->total_lines
- / (double) p->total_lines));
+ wset_normal_lines
+ (c, make_float ((double) c->pixel_height
+ / (double) p->pixel_height));
if (NILP (c->next))
{
@@ -2137,7 +2272,7 @@ add_window_to_list (struct window *w, void *user_data)
Vwindow_list is a list, return that list. Otherwise, build a new
list, cache it in Vwindow_list, and return that. */
-static Lisp_Object
+Lisp_Object
window_list (void)
{
if (!CONSP (Vwindow_list))
@@ -2712,9 +2847,16 @@ selected frame and no others. */)
}
static Lisp_Object
-resize_root_window (Lisp_Object window, Lisp_Object delta, Lisp_Object horizontal, Lisp_Object ignore)
+resize_root_window (Lisp_Object window, Lisp_Object delta, Lisp_Object horizontal, Lisp_Object ignore, Lisp_Object pixelwise)
{
- return call4 (Qwindow_resize_root_window, window, delta, horizontal, ignore);
+ return call5 (Qwindow_resize_root_window, window, delta, horizontal, ignore, pixelwise);
+}
+
+
+static Lisp_Object
+window_pixel_to_total (Lisp_Object frame, Lisp_Object horizontal)
+{
+ return call2(Qwindow_pixel_to_total, frame, horizontal);
}
@@ -2778,8 +2920,8 @@ window-start value is reasonable when this function is called. */)
{
startpos = marker_position (w->start);
startbyte = marker_byte_position (w->start);
- top = WINDOW_TOP_EDGE_LINE (w)
- - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w)));
+ top = (WINDOW_TOP_EDGE_LINE (w)
+ - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w))));
/* Make sure WINDOW is the frame's selected window. */
if (!EQ (window, FRAME_SELECTED_WINDOW (f)))
{
@@ -2837,7 +2979,7 @@ window-start value is reasonable when this function is called. */)
}
free_window_matrices (r);
- windows_or_buffers_changed = 27;
+ fset_redisplay (f);
Vwindow_list = Qnil;
FRAME_WINDOW_SIZES_CHANGED (f) = 1;
resize_failed = 0;
@@ -2845,16 +2987,23 @@ window-start value is reasonable when this function is called. */)
if (!WINDOW_LEAF_P (w))
{
/* Resize child windows vertically. */
- XSETINT (delta, r->total_lines - w->total_lines);
+ XSETINT (delta, r->pixel_height - w->pixel_height);
+ w->pixel_top = r->pixel_top;
w->top_line = r->top_line;
- resize_root_window (window, delta, Qnil, Qnil);
+ resize_root_window (window, delta, Qnil, Qnil, Qt);
if (window_resize_check (w, 0))
- window_resize_apply (w, 0);
+ {
+ window_resize_apply (w, 0);
+ window_pixel_to_total (w->frame, Qnil);
+ }
else
{
- resize_root_window (window, delta, Qnil, Qt);
+ resize_root_window (window, delta, Qnil, Qt, Qt);
if (window_resize_check (w, 0))
- window_resize_apply (w, 0);
+ {
+ window_resize_apply (w, 0);
+ window_pixel_to_total (w->frame, Qnil);
+ }
else
resize_failed = 1;
}
@@ -2863,15 +3012,22 @@ window-start value is reasonable when this function is called. */)
if (!resize_failed)
{
w->left_col = r->left_col;
- XSETINT (delta, r->total_cols - w->total_cols);
- resize_root_window (window, delta, Qt, Qnil);
+ w->pixel_left = r->pixel_left;
+ XSETINT (delta, r->pixel_width - w->pixel_width);
+ resize_root_window (window, delta, Qt, Qnil, Qt);
if (window_resize_check (w, 1))
- window_resize_apply (w, 1);
+ {
+ window_resize_apply (w, 1);
+ window_pixel_to_total (w->frame, Qt);
+ }
else
{
- resize_root_window (window, delta, Qt, Qt);
+ resize_root_window (window, delta, Qt, Qt, Qt);
if (window_resize_check (w, 1))
- window_resize_apply (w, 1);
+ {
+ window_resize_apply (w, 1);
+ window_pixel_to_total (w->frame, Qt);
+ }
else
resize_failed = 1;
}
@@ -2980,27 +3136,46 @@ replace_buffer_in_windows_safely (Lisp_Object buffer)
}
}
-/* If *ROWS or *COLS are too small a size for FRAME, set them to the
- minimum allowable size. */
+/* If *HEIGHT or *WIDTH are too small a size for FRAME, set them to the
+ minimum allowable size. PIXELWISE means interpret these as pixel
+ sizes. */
void
-check_frame_size (struct frame *frame, int *rows, int *cols)
+check_frame_size (struct frame *frame, int *width, int *height, bool pixelwise)
{
/* For height, we have to see:
how many windows the frame has at minimum (one or two),
and whether it has a menu bar or other special stuff at the top. */
- int min_height
- = ((FRAME_MINIBUF_ONLY_P (frame) || ! FRAME_HAS_MINIBUF_P (frame))
- ? MIN_SAFE_WINDOW_HEIGHT
- : 2 * MIN_SAFE_WINDOW_HEIGHT);
+ if (pixelwise)
+ {
+ int min_height = MIN_SAFE_WINDOW_HEIGHT * FRAME_LINE_HEIGHT (frame);
+ int min_width = MIN_SAFE_WINDOW_WIDTH * FRAME_COLUMN_WIDTH (frame);
+
+ if (!FRAME_MINIBUF_ONLY_P (frame) && FRAME_HAS_MINIBUF_P (frame))
+ min_height = 2 * min_height;
- if (FRAME_TOP_MARGIN (frame) > 0)
- min_height += FRAME_TOP_MARGIN (frame);
+ min_height += FRAME_TOP_MARGIN_HEIGHT (frame);
- if (*rows < min_height)
- *rows = min_height;
- if (*cols < MIN_SAFE_WINDOW_WIDTH)
- *cols = MIN_SAFE_WINDOW_WIDTH;
+ if (*height < min_height)
+ *height = min_height;
+ if (*width < min_width)
+ *width = min_width;
+ }
+ else
+ {
+ int min_height
+ = ((FRAME_MINIBUF_ONLY_P (frame) || ! FRAME_HAS_MINIBUF_P (frame))
+ ? MIN_SAFE_WINDOW_HEIGHT
+ : 2 * MIN_SAFE_WINDOW_HEIGHT);
+
+ if (FRAME_TOP_MARGIN (frame) > 0)
+ min_height += FRAME_TOP_MARGIN (frame);
+
+ if (*height < min_height)
+ *height = min_height;
+ if (*width < MIN_SAFE_WINDOW_WIDTH)
+ *width = MIN_SAFE_WINDOW_WIDTH;
+ }
}
/* Adjust the margins of window W if text area is too small.
@@ -3010,31 +3185,37 @@ check_frame_size (struct frame *frame, int *rows, int *cols)
static int
adjust_window_margins (struct window *w)
{
- int box_cols = (WINDOW_TOTAL_COLS (w)
- - WINDOW_FRINGE_COLS (w)
- - WINDOW_SCROLL_BAR_COLS (w));
- int margin_cols = (WINDOW_LEFT_MARGIN_COLS (w)
- + WINDOW_RIGHT_MARGIN_COLS (w));
+ int box_width = (WINDOW_PIXEL_WIDTH (w)
+ - WINDOW_FRINGES_WIDTH (w)
+ - WINDOW_SCROLL_BAR_AREA_WIDTH (w));
+ int margin_width = WINDOW_MARGINS_WIDTH (w);
- if (box_cols - margin_cols >= MIN_SAFE_WINDOW_WIDTH)
+ if (box_width - margin_width >= MIN_SAFE_WINDOW_PIXEL_WIDTH (w))
return 1;
- if (margin_cols < 0 || box_cols < MIN_SAFE_WINDOW_WIDTH)
+ if (margin_width < 0 || box_width < MIN_SAFE_WINDOW_PIXEL_WIDTH (w))
return 0;
-
- /* Window's text area is too narrow, but reducing the window
- margins will fix that. */
- margin_cols = box_cols - MIN_SAFE_WINDOW_WIDTH;
- if (WINDOW_RIGHT_MARGIN_COLS (w) > 0)
+ else
+ /* Window's text area is too narrow, but reducing the window
+ margins will fix that. */
{
- if (WINDOW_LEFT_MARGIN_COLS (w) > 0)
- w->left_margin_cols = w->right_margin_cols = margin_cols / 2;
+ int unit = WINDOW_FRAME_COLUMN_WIDTH (w);
+
+ margin_width = box_width - MIN_SAFE_WINDOW_PIXEL_WIDTH (w);
+
+ if (WINDOW_RIGHT_MARGIN_WIDTH (w) > 0)
+ {
+ if (WINDOW_LEFT_MARGIN_WIDTH (w) > 0)
+ w->left_margin_cols = w->right_margin_cols =
+ margin_width / (2 * unit);
+ else
+ w->right_margin_cols = margin_width / unit;
+ }
else
- w->right_margin_cols = margin_cols;
+ w->left_margin_cols = margin_width / unit;
+
+ return 1;
}
- else
- w->left_margin_cols = margin_cols;
- return 1;
}
/* The following three routines are needed for running a window's
@@ -3119,11 +3300,23 @@ If FRAME is omitted or nil, it defaults to the selected frame. */)
return Qnil;
}
-/* Make WINDOW display BUFFER as its contents. RUN_HOOKS_P non-zero
- means it's allowed to run hooks. See make_frame for a case where
- it's not allowed. KEEP_MARGINS_P non-zero means that the current
- margins, fringes, and scroll-bar settings of the window are not
- reset from the buffer's local settings. */
+DEFUN ("run-window-scroll-functions", Frun_window_scroll_functions,
+ Srun_window_scroll_functions, 0, 1, 0,
+ doc: /* Run `window-scroll-functions' for WINDOW.
+If WINDOW is omitted or nil, it defaults to the selected window. */)
+ (Lisp_Object window)
+{
+ if (! NILP (Vwindow_scroll_functions))
+ run_hook_with_args_2 (Qwindow_scroll_functions, window,
+ Fmarker_position (decode_live_window (window)->start));
+ return Qnil;
+}
+
+/* Make WINDOW display BUFFER. RUN_HOOKS_P non-zero means it's allowed
+ to run hooks. See make_frame for a case where it's not allowed.
+ KEEP_MARGINS_P non-zero means that the current margins, fringes, and
+ scroll-bar settings of the window are not reset from the buffer's
+ local settings. */
void
set_window_buffer (Lisp_Object window, Lisp_Object buffer,
@@ -3132,7 +3325,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer,
struct window *w = XWINDOW (window);
struct buffer *b = XBUFFER (buffer);
ptrdiff_t count = SPECPDL_INDEX ();
- int samebuf = EQ (buffer, w->contents);
+ bool samebuf = EQ (buffer, w->contents);
wset_buffer (w, buffer);
@@ -3171,7 +3364,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer,
}
/* Maybe we could move this into the `if' but it's not obviously safe and
I doubt it's worth the trouble. */
- windows_or_buffers_changed = 28;
+ wset_redisplay (w);
/* We must select BUFFER for running the window-scroll-functions. */
/* We can't check ! NILP (Vwindow_scroll_functions) here
@@ -3202,14 +3395,15 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer,
if (! NILP (Vwindow_scroll_functions))
run_hook_with_args_2 (Qwindow_scroll_functions, window,
Fmarker_position (w->start));
- run_window_configuration_change_hook (XFRAME (WINDOW_FRAME (w)));
+ if (!samebuf)
+ run_window_configuration_change_hook (XFRAME (WINDOW_FRAME (w)));
}
unbind_to (count, Qnil);
}
DEFUN ("set-window-buffer", Fset_window_buffer, Sset_window_buffer, 2, 3, 0,
- doc: /* Make WINDOW display BUFFER-OR-NAME as its contents.
+ doc: /* Make WINDOW display BUFFER-OR-NAME.
WINDOW must be a live window and defaults to the selected one.
BUFFER-OR-NAME must be a buffer or the name of an existing buffer.
@@ -3381,6 +3575,8 @@ make_parent_window (Lisp_Object window, bool horflag)
adjust_window_count (p, 1);
XSETWINDOW (parent, p);
+ p->sequence_number = ++sequence_number;
+
replace_window (window, parent, 1);
wset_next (o, Qnil);
@@ -3409,6 +3605,7 @@ make_window (void)
wset_normal_cols (w, make_float (1.0));
wset_new_total (w, make_number (0));
wset_new_normal (w, make_number (0));
+ wset_new_pixel (w, make_number (0));
wset_start (w, Fmake_marker ());
wset_pointm (w, Fmake_marker ());
wset_vertical_scroll_bar_type (w, Qt);
@@ -3426,6 +3623,7 @@ make_window (void)
w->phys_cursor_type = NO_CURSOR;
w->phys_cursor_width = -1;
#endif
+ w->sequence_number = ++sequence_number;
w->scroll_bar_width = -1;
w->column_number_displayed = -1;
@@ -3436,6 +3634,30 @@ make_window (void)
return window;
}
+DEFUN ("set-window-new-pixel", Fset_window_new_pixel, Sset_window_new_pixel, 2, 3, 0,
+ doc: /* Set new pixel size of WINDOW to SIZE.
+WINDOW must be a valid window and defaults to the selected one.
+Return SIZE.
+
+Optional argument ADD non-nil means add SIZE to the new pixel size of
+WINDOW and return the sum.
+
+Note: This function does not operate on any child windows of WINDOW. */)
+ (Lisp_Object window, Lisp_Object size, Lisp_Object add)
+{
+ struct window *w = decode_valid_window (window);
+ EMACS_INT size_min = NILP (add) ? 0 : - XINT (w->new_pixel);
+ EMACS_INT size_max = size_min + min (INT_MAX, MOST_POSITIVE_FIXNUM);
+
+ CHECK_RANGED_INTEGER (size, size_min, size_max);
+ if (NILP (add))
+ wset_new_pixel (w, size);
+ else
+ wset_new_pixel (w, make_number (XINT (w->new_pixel) + XINT (size)));
+
+ return w->new_pixel;
+}
+
DEFUN ("set-window-new-total", Fset_window_new_total, Sset_window_new_total, 2, 3, 0,
doc: /* Set new total size of WINDOW to SIZE.
WINDOW must be a valid window and defaults to the selected one.
@@ -3470,8 +3692,8 @@ Note: This function does not operate on any child windows of WINDOW. */)
return size;
}
-/* Return 1 if setting w->total_lines (w->total_cols if HORFLAG is
- non-zero) to w->new_total would result in correct heights (widths)
+/* Return 1 if setting w->pixel_height (w->pixel_width if HORFLAG is
+ non-zero) to w->new_pixel would result in correct heights (widths)
for window W and recursively all child windows of W.
Note: This function does not check any of `window-fixed-size-p',
@@ -3480,6 +3702,7 @@ Note: This function does not operate on any child windows of WINDOW. */)
static int
window_resize_check (struct window *w, bool horflag)
{
+ struct frame *f = XFRAME (w->frame);
struct window *c;
if (WINDOW_VERTICAL_COMBINATION_P (w))
@@ -3491,26 +3714,33 @@ window_resize_check (struct window *w, bool horflag)
{
while (c)
{
- if ((XINT (c->new_total) != XINT (w->new_total))
+ if (XINT (c->new_pixel) != XINT (w->new_pixel)
|| !window_resize_check (c, horflag))
return 0;
+
c = NILP (c->next) ? 0 : XWINDOW (c->next);
}
+
return 1;
}
else
/* The sum of the heights of the child windows of W must equal
W's height. */
{
- int sum_of_sizes = 0;
+ int remaining_pixels = XINT (w->new_pixel);
+
while (c)
{
if (!window_resize_check (c, horflag))
return 0;
- sum_of_sizes = sum_of_sizes + XINT (c->new_total);
+
+ remaining_pixels -= XINT (c->new_pixel);
+ if (remaining_pixels < 0)
+ return 0;
c = NILP (c->next) ? 0 : XWINDOW (c->next);
}
- return (sum_of_sizes == XINT (w->new_total));
+
+ return remaining_pixels == 0;
}
}
else if (WINDOW_HORIZONTAL_COMBINATION_P (w))
@@ -3521,26 +3751,33 @@ window_resize_check (struct window *w, bool horflag)
/* The sum of the widths of the child windows of W must equal W's
width. */
{
- int sum_of_sizes = 0;
+ int remaining_pixels = XINT (w->new_pixel);
+
while (c)
{
if (!window_resize_check (c, horflag))
return 0;
- sum_of_sizes = sum_of_sizes + XINT (c->new_total);
+
+ remaining_pixels -= XINT (c->new_pixel);
+ if (remaining_pixels < 0)
+ return 0;
c = NILP (c->next) ? 0 : XWINDOW (c->next);
}
- return (sum_of_sizes == XINT (w->new_total));
+
+ return remaining_pixels == 0;
}
else
/* All child windows of W must have the same height as W. */
{
while (c)
{
- if ((XINT (c->new_total) != XINT (w->new_total))
+ if (XINT (c->new_pixel) != XINT (w->new_pixel)
|| !window_resize_check (c, horflag))
return 0;
+
c = NILP (c->next) ? 0 : XWINDOW (c->next);
}
+
return 1;
}
}
@@ -3548,12 +3785,15 @@ window_resize_check (struct window *w, bool horflag)
/* A leaf window. Make sure it's not too small. The following
hardcodes the values of `window-safe-min-width' (2) and
`window-safe-min-height' (1) which are defined in window.el. */
- return XINT (w->new_total) >= (horflag ? 2 : 1);
+ return (XINT (w->new_pixel) >= (horflag
+ ? (2 * FRAME_COLUMN_WIDTH (f))
+ : FRAME_LINE_HEIGHT (f)));
}
-/* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to
- w->new_total for window W and recursively all child windows of W.
- Also calculate and assign the new vertical (horizontal) start
+
+/* Set w->pixel_height (w->pixel_height if HORIZONTAL is non-zero) to
+ w->new_pixel for window W and recursively all child windows of W.
+ Also calculate and assign the new vertical (horizontal) pixel start
positions of each of these windows.
This function does not perform any error checks. Make sure you have
@@ -3562,25 +3802,30 @@ static void
window_resize_apply (struct window *w, bool horflag)
{
struct window *c;
- int pos;
+ int edge;
+ int unit = (horflag
+ ? FRAME_COLUMN_WIDTH (WINDOW_XFRAME (w))
+ : FRAME_LINE_HEIGHT (WINDOW_XFRAME (w)));
/* Note: Assigning new_normal requires that the new total size of the
parent window has been set *before*. */
if (horflag)
{
- w->total_cols = XFASTINT (w->new_total);
+ w->pixel_width = XFASTINT (w->new_pixel);
+ w->total_cols = w->pixel_width / unit;
if (NUMBERP (w->new_normal))
wset_normal_cols (w, w->new_normal);
- pos = w->left_col;
+ edge = w->pixel_left;
}
else
{
- w->total_lines = XFASTINT (w->new_total);
+ w->pixel_height = XFASTINT (w->new_pixel);
+ w->total_lines = w->pixel_height / unit;
if (NUMBERP (w->new_normal))
wset_normal_lines (w, w->new_normal);
- pos = w->top_line;
+ edge = w->pixel_top;
}
if (WINDOW_VERTICAL_COMBINATION_P (w))
@@ -3590,12 +3835,19 @@ window_resize_apply (struct window *w, bool horflag)
while (c)
{
if (horflag)
- c->left_col = pos;
+ {
+ c->pixel_left = edge;
+ c->left_col = edge / unit;
+ }
else
- c->top_line = pos;
+ {
+ c->pixel_top = edge;
+ c->top_line = edge / unit;
+ }
window_resize_apply (c, horflag);
if (!horflag)
- pos = pos + c->total_lines;
+ edge = edge + c->pixel_height;
+
c = NILP (c->next) ? 0 : XWINDOW (c->next);
}
}
@@ -3606,18 +3858,90 @@ window_resize_apply (struct window *w, bool horflag)
while (c)
{
if (horflag)
- c->left_col = pos;
+ {
+ c->pixel_left = edge;
+ c->left_col = edge / unit;
+ }
else
- c->top_line = pos;
+ {
+ c->pixel_top = edge;
+ c->top_line = edge / unit;
+ }
+
window_resize_apply (c, horflag);
if (horflag)
- pos = pos + c->total_cols;
+ edge = edge + c->pixel_width;
+
c = NILP (c->next) ? 0 : XWINDOW (c->next);
}
}
+ else
+ /* Bug#15957. */
+ w->window_end_valid = 0;
}
+/* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to
+ w->new_total for window W and recursively all child windows of W.
+ Also calculate and assign the new vertical (horizontal) start
+ positions of each of these windows. */
+static void
+window_resize_apply_total (struct window *w, bool horflag)
+{
+ struct window *c;
+ int edge;
+
+ /* Note: Assigning new_normal requires that the new total size of the
+ parent window has been set *before*. */
+ if (horflag)
+ {
+ w->total_cols = XFASTINT (w->new_total);
+ edge = w->left_col;
+ }
+ else
+ {
+ w->total_lines = XFASTINT (w->new_total);
+ edge = w->top_line;
+ }
+
+ if (WINDOW_VERTICAL_COMBINATION_P (w))
+ /* W is a vertical combination. */
+ {
+ c = XWINDOW (w->contents);
+ while (c)
+ {
+ if (horflag)
+ c->left_col = edge;
+ else
+ c->top_line = edge;
+
+ window_resize_apply_total (c, horflag);
+ if (!horflag)
+ edge = edge + c->total_lines;
+
+ c = NILP (c->next) ? 0 : XWINDOW (c->next);
+ }
+ }
+ else if (WINDOW_HORIZONTAL_COMBINATION_P (w))
+ /* W is a horizontal combination. */
+ {
+ c = XWINDOW (w->contents);
+ while (c)
+ {
+ if (horflag)
+ c->left_col = edge;
+ else
+ c->top_line = edge;
+
+ window_resize_apply_total (c, horflag);
+ if (horflag)
+ edge = edge + c->total_cols;
+
+ c = NILP (c->next) ? 0 : XWINDOW (c->next);
+ }
+ }
+}
+
DEFUN ("window-resize-apply", Fwindow_resize_apply, Swindow_resize_apply, 0, 2, 0,
doc: /* Apply requested size values for window-tree of FRAME.
If FRAME is omitted or nil, it defaults to the selected frame.
@@ -3639,20 +3963,44 @@ be applied on the Elisp level. */)
bool horflag = !NILP (horizontal);
if (!window_resize_check (r, horflag)
- || (XINT (r->new_total)
- != (horflag ? r->total_cols : r->total_lines)))
+ || (XINT (r->new_pixel)
+ != (horflag ? r->pixel_width : r->pixel_height)))
return Qnil;
block_input ();
window_resize_apply (r, horflag);
- windows_or_buffers_changed = 30;
+ fset_redisplay (f);
FRAME_WINDOW_SIZES_CHANGED (f) = 1;
adjust_frame_glyphs (f);
unblock_input ();
- run_window_configuration_change_hook (f);
+ return Qt;
+}
+
+
+DEFUN ("window-resize-apply-total", Fwindow_resize_apply_total, Swindow_resize_apply_total, 0, 2, 0,
+ doc: /* Apply requested total size values for window-tree of FRAME.
+If FRAME is omitted or nil, it defaults to the selected frame.
+
+This function does not assign pixel or normal size values. You should
+have run `window-resize-apply' before running this.
+
+Optional argument HORIZONTAL omitted or nil means apply requested
+height values. HORIZONTAL non-nil means apply requested width
+values. */)
+ (Lisp_Object frame, Lisp_Object horizontal)
+{
+ struct frame *f = decode_live_frame (frame);
+ struct window *r = XWINDOW (FRAME_ROOT_WINDOW (f));
+
+ block_input ();
+ /* Necessary when deleting the top-/or leftmost window. */
+ r->left_col = 0;
+ r->top_line = FRAME_TOP_MARGIN (f);
+ window_resize_apply_total (r, !NILP (horizontal));
+ unblock_input ();
return Qt;
}
@@ -3660,59 +4008,107 @@ be applied on the Elisp level. */)
/* Resize frame F's windows when number of lines of F is set to SIZE.
HORFLAG 1 means resize windows when number of columns of F is set to
- SIZE.
+ SIZE. PIXELWISE 1 means to interpret SIZE as pixels.
This function can delete all windows but the selected one in order to
satisfy the request. The result will be meaningful if and only if
F's windows have meaningful sizes when you call this. */
void
-resize_frame_windows (struct frame *f, int size, bool horflag)
+resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise)
{
Lisp_Object root = f->root_window;
struct window *r = XWINDOW (root);
Lisp_Object mini = f->minibuffer_window;
struct window *m;
+ /* old_size is the old size of the frame's root window. */
+ int old_size = horflag ? r->total_cols : r->total_lines;
+ int old_pixel_size = horflag ? r->pixel_width : r->pixel_height;
/* new_size is the new size of the frame's root window. */
- int new_size = (horflag
- ? size
- : (size
- - FRAME_TOP_MARGIN (f)
- - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f))
- ? 1 : 0)));
+ int new_size, new_pixel_size;
+
+ if (pixelwise)
+ {
+ new_pixel_size
+ = (horflag
+ ? size
+ : (size
+ - FRAME_TOP_MARGIN_HEIGHT (f)
+ - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f))
+ ? FRAME_LINE_HEIGHT (f) : 0)));
+ new_size = new_pixel_size / (horflag
+ ? FRAME_COLUMN_WIDTH (f)
+ : FRAME_LINE_HEIGHT (f));
+ }
+ else
+ {
+ new_size= (horflag
+ ? size
+ : (size
+ - FRAME_TOP_MARGIN (f)
+ - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f))
+ ? 1 : 0)));
+ new_pixel_size = new_size * (horflag
+ ? FRAME_COLUMN_WIDTH (f)
+ : FRAME_LINE_HEIGHT (f));
+ }
r->top_line = FRAME_TOP_MARGIN (f);
- if (WINDOW_LEAF_P (r))
+ r->pixel_top = FRAME_TOP_MARGIN_HEIGHT (f);
+
+ if (new_pixel_size == old_pixel_size)
+ return;
+ else if (WINDOW_LEAF_P (r))
/* For a leaf root window just set the size. */
if (horflag)
- r->total_cols = new_size;
+ {
+ r->total_cols = new_size;
+ r->pixel_width = new_pixel_size;
+ }
else
- r->total_lines = new_size;
+ {
+ r->total_lines = new_size;
+ r->pixel_height = new_pixel_size;
+ }
else
{
- /* old_size is the old size of the frame's root window. */
- int old_size = horflag ? r->total_cols : r->total_lines;
Lisp_Object delta;
- XSETINT (delta, new_size - old_size);
+ if (pixelwise)
+ XSETINT (delta, new_pixel_size - old_pixel_size);
+ else
+ XSETINT (delta, new_size - old_size);
+
/* Try a "normal" resize first. */
- resize_root_window (root, delta, horflag ? Qt : Qnil, Qnil);
+ resize_root_window (root, delta, horflag ? Qt : Qnil, Qnil,
+ pixelwise ? Qt : Qnil);
if (window_resize_check (r, horflag)
- && new_size == XINT (r->new_total))
- window_resize_apply (r, horflag);
+ && new_pixel_size == XINT (r->new_pixel))
+ {
+ window_resize_apply (r, horflag);
+ window_pixel_to_total (r->frame, horflag ? Qt : Qnil);
+ }
else
{
/* Try with "reasonable" minimum sizes next. */
- resize_root_window (root, delta, horflag ? Qt : Qnil, Qt);
+ resize_root_window (root, delta, horflag ? Qt : Qnil, Qt,
+ pixelwise ? Qt : Qnil);
if (window_resize_check (r, horflag)
- && new_size == XINT (r->new_total))
- window_resize_apply (r, horflag);
+ && new_pixel_size == XINT (r->new_pixel))
+ {
+ window_resize_apply (r, horflag);
+ window_pixel_to_total (r->frame, horflag ? Qt : Qnil);
+ }
else
{
/* Finally, try with "safe" minimum sizes. */
- resize_root_window (root, delta, horflag ? Qt : Qnil, Qsafe);
+ resize_root_window (root, delta, horflag ? Qt : Qnil, Qsafe,
+ pixelwise ? Qt : Qnil);
if (window_resize_check (r, horflag)
- && new_size == XINT (r->new_total))
- window_resize_apply (r, horflag);
+ && new_pixel_size == XINT (r->new_pixel))
+ {
+ window_resize_apply (r, horflag);
+ window_pixel_to_total (r->frame, horflag ? Qt : Qnil);
+ }
else
{
/* We lost. Delete all windows but the frame's
@@ -3720,9 +4116,15 @@ resize_frame_windows (struct frame *f, int size, bool horflag)
root = f->selected_window;
Fdelete_other_windows_internal (root, Qnil);
if (horflag)
- XWINDOW (root)->total_cols = new_size;
+ {
+ XWINDOW (root)->total_cols = new_size;
+ XWINDOW (root)->pixel_width = new_pixel_size;
+ }
else
- XWINDOW (root)->total_lines = new_size;
+ {
+ XWINDOW (root)->total_lines = new_size;
+ XWINDOW (root)->pixel_height = new_pixel_size;
+ }
}
}
}
@@ -3732,42 +4134,47 @@ resize_frame_windows (struct frame *f, int size, bool horflag)
{
m = XWINDOW (mini);
if (horflag)
- m->total_cols = size;
+ {
+ m->total_cols = size;
+ m->pixel_width = new_pixel_size;
+ }
else
{
/* Are we sure we always want 1 line here? */
m->total_lines = 1;
+ m->pixel_height = FRAME_LINE_HEIGHT (f);
m->top_line = r->top_line + r->total_lines;
+ m->pixel_top = r->pixel_top + r->pixel_height;
}
}
- windows_or_buffers_changed = 31;
+ fset_redisplay (f);
}
DEFUN ("split-window-internal", Fsplit_window_internal, Ssplit_window_internal, 4, 4, 0,
doc: /* Split window OLD.
-Second argument TOTAL-SIZE specifies the number of lines or columns of the
+Second argument PIXEL-SIZE specifies the number of pixels of the
new window. In any case TOTAL-SIZE must be a positive integer.
Third argument SIDE nil (or `below') specifies that the new window shall
be located below WINDOW. SIDE `above' means the new window shall be
-located above WINDOW. In both cases TOTAL-SIZE specifies the number of
-lines of the new window including space reserved for the mode and/or
+located above WINDOW. In both cases PIXEL-SIZE specifies the pixel
+height of the new window including space reserved for the mode and/or
header line.
SIDE t (or `right') specifies that the new window shall be located on
the right side of WINDOW. SIDE `left' means the new window shall be
-located on the left of WINDOW. In both cases TOTAL-SIZE specifies the
-number of columns of the new window including space reserved for fringes
-and the scrollbar or a divider column.
+located on the left of WINDOW. In both cases PIXEL-SIZE specifies the
+width of the new window including space reserved for fringes and the
+scrollbar or a divider column.
Fourth argument NORMAL-SIZE specifies the normal size of the new window
according to the SIDE argument.
-The new total and normal sizes of all involved windows must have been
+The new pixel and normal sizes of all involved windows must have been
set correctly. See the code of `split-window' for how this is done. */)
- (Lisp_Object old, Lisp_Object total_size, Lisp_Object side, Lisp_Object normal_size)
+ (Lisp_Object old, Lisp_Object pixel_size, Lisp_Object side, Lisp_Object normal_size)
{
/* OLD (*o) is the window we have to split. (*p) is either OLD's
parent window or an internal window we have to install as OLD's new
@@ -3776,19 +4183,24 @@ set correctly. See the code of `split-window' for how this is done. */)
NEW (*n) is the new window created with some parameters taken from
REFERENCE (*r). */
register Lisp_Object new, frame, reference;
- register struct window *o, *p, *n, *r;
+ register struct window *o, *p, *n, *r, *c;
struct frame *f;
bool horflag
/* HORFLAG is 1 when we split side-by-side, 0 otherwise. */
= EQ (side, Qt) || EQ (side, Qleft) || EQ (side, Qright);
- int combination_limit = 0;
+ int combination_limit = 0, sum = 0;
+ int total_size;
CHECK_WINDOW (old);
o = XWINDOW (old);
frame = WINDOW_FRAME (o);
f = XFRAME (frame);
- CHECK_NUMBER (total_size);
+ CHECK_NUMBER (pixel_size);
+ total_size
+ = XINT (pixel_size) / (horflag
+ ? FRAME_COLUMN_WIDTH (f)
+ : FRAME_LINE_HEIGHT (f));
/* Set combination_limit to 1 if we have to make a new parent window.
We do that if either `window-combination-limit' is t, or OLD has no
@@ -3812,7 +4224,7 @@ set correctly. See the code of `split-window' for how this is done. */)
/* The following bugs are caught by `split-window'. */
if (MINI_WINDOW_P (o))
error ("Attempt to split minibuffer window");
- else if (XINT (total_size) < (horflag ? 2 : 1))
+ else if (total_size < (horflag ? 2 : 1))
error ("Size of new window too small (after split)");
else if (!combination_limit && !NILP (Vwindow_combination_resize))
/* `window-combination-resize' non-nil means try to resize OLD's siblings
@@ -3820,26 +4232,25 @@ set correctly. See the code of `split-window' for how this is done. */)
{
p = XWINDOW (o->parent);
/* Temporarily pretend we split the parent window. */
- wset_new_total
- (p, make_number ((horflag ? p->total_cols : p->total_lines)
- - XINT (total_size)));
+ wset_new_pixel
+ (p, make_number ((horflag ? p->pixel_width : p->pixel_height)
+ - XINT (pixel_size)));
if (!window_resize_check (p, horflag))
error ("Window sizes don't fit");
else
/* Undo the temporary pretension. */
- wset_new_total (p, make_number
- (horflag ? p->total_cols : p->total_lines));
+ wset_new_pixel (p, make_number (horflag ? p->pixel_width : p->pixel_height));
}
else
{
if (!window_resize_check (o, horflag))
error ("Resizing old window failed");
- else if (XINT (total_size) + XINT (o->new_total)
- != (horflag ? o->total_cols : o->total_lines))
+ else if (XINT (pixel_size) + XINT (o->new_pixel)
+ != (horflag ? o->pixel_width : o->pixel_height))
error ("Sum of sizes of old and new window don't fit");
}
- /* This is our point of no return. */
+ /* This is our point of no return. */
if (combination_limit)
{
/* Save the old value of o->normal_cols/lines. It gets corrupted
@@ -3855,14 +4266,16 @@ set correctly. See the code of `split-window' for how this is done. */)
that its children get merged into another window. */
wset_combination_limit (p, Qt);
/* These get applied below. */
- wset_new_total (p, make_number
- (horflag ? o->total_cols : o->total_lines));
+ wset_new_pixel
+ (p, make_number (horflag ? o->pixel_width : o->pixel_height));
+ wset_new_total
+ (p, make_number (horflag ? o->total_cols : o->total_lines));
wset_new_normal (p, new_normal);
}
else
p = XWINDOW (o->parent);
- windows_or_buffers_changed = 32;
+ fset_redisplay (f);
FRAME_WINDOW_SIZES_CHANGED (f) = 1;
new = make_window ();
n = XWINDOW (new);
@@ -3903,18 +4316,33 @@ set correctly. See the code of `split-window' for how this is done. */)
/* Directly assign orthogonal coordinates and sizes. */
if (horflag)
{
+ n->pixel_top = o->pixel_top;
n->top_line = o->top_line;
+ n->pixel_height = o->pixel_height;
n->total_lines = o->total_lines;
}
else
{
+ n->pixel_left = o->pixel_left;
n->left_col = o->left_col;
+ n->pixel_width = o->pixel_width;
n->total_cols = o->total_cols;
}
/* Iso-coordinates and sizes are assigned by window_resize_apply,
get them ready here. */
- wset_new_total (n, total_size);
+ wset_new_pixel (n, pixel_size);
+ c = XWINDOW (p->contents);
+ while (c)
+ {
+ if (c != n)
+ sum = sum + XINT (c->new_total);
+ c = NILP (c->next) ? 0 : XWINDOW (c->next);
+ }
+ wset_new_total (n, make_number ((horflag
+ ? p->total_cols
+ : p->total_lines)
+ - sum));
wset_new_normal (n, normal_size);
block_input ();
@@ -3993,15 +4421,14 @@ Signal an error when WINDOW is the only window on its frame. */)
}
if (window_resize_check (r, horflag)
- && (XINT (r->new_total)
- == (horflag ? r->total_cols : r->total_lines)))
+ && (XINT (r->new_pixel)
+ == (horflag ? r->pixel_width : r->pixel_height)))
/* We can delete WINDOW now. */
{
/* Block input. */
block_input ();
window_resize_apply (p, horflag);
-
/* If this window is referred to by the dpyinfo's mouse
highlight, invalidate that slot to be safe (Bug#9904). */
if (!FRAME_INITIAL_P (f))
@@ -4012,7 +4439,7 @@ Signal an error when WINDOW is the only window on its frame. */)
hlinfo->mouse_face_window = Qnil;
}
- windows_or_buffers_changed = 33;
+ fset_redisplay (f);
Vwindow_list = Qnil;
FRAME_WINDOW_SIZES_CHANGED (f) = 1;
@@ -4112,54 +4539,76 @@ Signal an error when WINDOW is the only window on its frame. */)
/* Grow mini-window W by DELTA lines, DELTA >= 0, or as much as we
can. */
void
-grow_mini_window (struct window *w, int delta)
+grow_mini_window (struct window *w, int delta, bool pixelwise)
{
struct frame *f = XFRAME (w->frame);
struct window *r;
- Lisp_Object root, value;
+ Lisp_Object root, height;
+ int line_height, pixel_height;
eassert (MINI_WINDOW_P (w));
eassert (delta >= 0);
- root = FRAME_ROOT_WINDOW (f);
- r = XWINDOW (root);
- value = call2 (Qwindow_resize_root_window_vertically,
- root, make_number (- delta));
- if (INTEGERP (value) && window_resize_check (r, 0))
+ if (delta > 0)
{
- block_input ();
- window_resize_apply (r, 0);
+ root = FRAME_ROOT_WINDOW (f);
+ r = XWINDOW (root);
+ height = call3 (Qwindow_resize_root_window_vertically,
+ root, make_number (- delta), pixelwise ? Qt : Qnil);
+ if (INTEGERP (height) && window_resize_check (r, 0))
+ {
+ block_input ();
+ window_resize_apply (r, 0);
- /* Grow the mini-window. */
- w->top_line = r->top_line + r->total_lines;
- w->total_lines -= XINT (value);
- /* Enforce full redisplay. FIXME: make it more selective. */
- windows_or_buffers_changed = 34;
- adjust_frame_glyphs (f);
- unblock_input ();
+ if (pixelwise)
+ {
+ pixel_height = min (-XINT (height), INT_MAX - w->pixel_height);
+ line_height = pixel_height / FRAME_LINE_HEIGHT (f);
+ }
+ else
+ {
+ line_height = min (-XINT (height),
+ ((INT_MAX - w->pixel_height)
+ / FRAME_LINE_HEIGHT (f)));
+ pixel_height = line_height * FRAME_LINE_HEIGHT (f);
+ }
+
+ /* Grow the mini-window. */
+ w->pixel_top = r->pixel_top + r->pixel_height;
+ w->top_line = r->top_line + r->total_lines;
+ w->pixel_height += pixel_height;
+ w->total_lines += line_height;
+
+ /* Enforce full redisplay of the frame. */
+ /* FIXME: Shouldn't window--resize-root-window-vertically do it? */
+ fset_redisplay (f);
+ adjust_frame_glyphs (f);
+ unblock_input ();
+ }
}
}
-
-/* Shrink mini-window W. */
+/* Shrink mini-window W to one line. */
void
-shrink_mini_window (struct window *w)
+shrink_mini_window (struct window *w, bool pixelwise)
{
struct frame *f = XFRAME (w->frame);
struct window *r;
- Lisp_Object root, value;
- EMACS_INT size;
+ Lisp_Object root, delta;
+ EMACS_INT height, unit;
eassert (MINI_WINDOW_P (w));
- size = w->total_lines;
- if (size > 1)
+ height = pixelwise ? w->pixel_height : w->total_lines;
+ unit = pixelwise ? FRAME_LINE_HEIGHT (f) : 1;
+ if (height > unit)
{
root = FRAME_ROOT_WINDOW (f);
r = XWINDOW (root);
- value = call2 (Qwindow_resize_root_window_vertically,
- root, make_number (size - 1));
- if (INTEGERP (value) && window_resize_check (r, 0))
+ delta = call3 (Qwindow_resize_root_window_vertically,
+ root, make_number (height - unit),
+ pixelwise ? Qt : Qnil);
+ if (INTEGERP (delta) && window_resize_check (r, 0))
{
block_input ();
window_resize_apply (r, 0);
@@ -4167,8 +4616,11 @@ shrink_mini_window (struct window *w)
/* Shrink the mini-window. */
w->top_line = r->top_line + r->total_lines;
w->total_lines = 1;
- /* Enforce full redisplay. FIXME: make it more selective. */
- windows_or_buffers_changed = 35;
+ w->pixel_top = r->pixel_top + r->pixel_height;
+ w->pixel_height = FRAME_LINE_HEIGHT (f);
+ /* Enforce full redisplay of the frame. */
+ /* FIXME: Shouldn't window--resize-root-window-vertically do it? */
+ fset_redisplay (f);
adjust_frame_glyphs (f);
unblock_input ();
}
@@ -4197,26 +4649,27 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini
error ("Cannot resize a minibuffer-only frame");
r = XWINDOW (FRAME_ROOT_WINDOW (f));
- height = r->total_lines + w->total_lines;
+ height = r->pixel_height + w->pixel_height;
if (window_resize_check (r, 0)
- && XINT (w->new_total) > 0
- && height == XINT (r->new_total) + XINT (w->new_total))
+ && XINT (w->new_pixel) > 0
+ && height == XINT (r->new_pixel) + XINT (w->new_pixel))
{
block_input ();
window_resize_apply (r, 0);
w->total_lines = XFASTINT (w->new_total);
w->top_line = r->top_line + r->total_lines;
+ w->pixel_height = XFASTINT (w->new_pixel);
+ w->pixel_top = r->pixel_top + r->pixel_height;
- windows_or_buffers_changed = 36;
+ fset_redisplay (f);
FRAME_WINDOW_SIZES_CHANGED (f) = 1;
adjust_frame_glyphs (f);
unblock_input ();
-
- run_window_configuration_change_hook (f);
return Qt;
}
- else error ("Failed to resize minibuffer window");
+ else
+ error ("Failed to resize minibuffer window");
}
/* Mark window cursors off for all windows in the window tree rooted
@@ -4279,6 +4732,8 @@ window_scroll (Lisp_Object window, EMACS_INT n, bool whole, int noerror)
immediate_quit = 1;
n = clip_to_bounds (INT_MIN, n, INT_MAX);
+ wset_redisplay (XWINDOW (window));
+
/* If we must, use the pixel-based version which is much slower than
the line-based one but can handle varying line heights. */
if (FRAME_WINDOW_P (XFRAME (XWINDOW (window)->frame)))
@@ -4286,6 +4741,8 @@ window_scroll (Lisp_Object window, EMACS_INT n, bool whole, int noerror)
else
window_scroll_line_based (window, n, whole, noerror);
+ /* Bug#15957. */
+ XWINDOW (window)->window_end_valid = 0;
immediate_quit = 0;
}
@@ -4828,9 +5285,6 @@ scroll_command (Lisp_Object n, int direction)
{
record_unwind_protect (save_excursion_restore, save_excursion_save ());
Fset_buffer (XWINDOW (selected_window)->contents);
-
- /* Make redisplay consider other windows than just selected_window. */
- windows_or_buffers_changed = 37;
}
if (NILP (n))
@@ -4940,7 +5394,6 @@ specifies the window to scroll. This takes precedence over
/* Don't screw up if window_scroll gets an error. */
record_unwind_protect (save_excursion_restore, save_excursion_save ());
- windows_or_buffers_changed = 38;
Fset_buffer (w->contents);
SET_PT_BOTH (marker_position (w->pointm), marker_byte_position (w->pointm));
@@ -4976,7 +5429,7 @@ by this function. This happens in an interactive call. */)
{
struct window *w = XWINDOW (selected_window);
EMACS_INT requested_arg = (NILP (arg)
- ? window_body_cols (w) - 2
+ ? window_body_width (w, 0) - 2
: XINT (Fprefix_numeric_value (arg)));
Lisp_Object result = set_window_hscroll (w, w->hscroll + requested_arg);
@@ -4999,7 +5452,7 @@ by this function. This happens in an interactive call. */)
{
struct window *w = XWINDOW (selected_window);
EMACS_INT requested_arg = (NILP (arg)
- ? window_body_cols (w) - 2
+ ? window_body_width (w, 0) - 2
: XINT (Fprefix_numeric_value (arg)));
Lisp_Object result = set_window_hscroll (w, w->hscroll - requested_arg);
@@ -5273,22 +5726,36 @@ and redisplay normally--don't erase and redraw the frame. */)
return Qnil;
}
-DEFUN ("window-text-height", Fwindow_text_height, Swindow_text_height,
+DEFUN ("window-text-width", Fwindow_text_width, Swindow_text_width,
0, 1, 0,
- doc: /* Return the height in lines of the text display area of WINDOW.
+ doc: /* Return the width in columns of the text display area of WINDOW.
WINDOW must be a live window and defaults to the selected one.
-The returned height does not include the mode line, any header line,
-nor any partial-height lines at the bottom of the text area. */)
+The returned width does not include dividers, scrollbars, margins,
+fringes, nor any partial-width columns at the right of the text
+area. */)
(Lisp_Object window)
{
struct window *w = decode_live_window (window);
- int pixel_height = window_box_height (w);
- int line_height = pixel_height / FRAME_LINE_HEIGHT (XFRAME (w->frame));
- return make_number (line_height);
+
+ return make_number (window_box_width (w, TEXT_AREA)
+ / FRAME_COLUMN_WIDTH (WINDOW_XFRAME (w)));
}
+DEFUN ("window-text-height", Fwindow_text_height, Swindow_text_height,
+ 0, 1, 0,
+ doc: /* Return the height in lines of the text display area of WINDOW.
+WINDOW must be a live window and defaults to the selected one.
+
+The returned height does not include dividers, the mode line, any header
+line, nor any partial-height lines at the bottom of the text area. */)
+ (Lisp_Object window)
+{
+ struct window *w = decode_live_window (window);
+ return make_number (window_box_height (w)
+ / FRAME_LINE_HEIGHT (WINDOW_XFRAME (w)));
+}
DEFUN ("move-to-window-line", Fmove_to_window_line, Smove_to_window_line,
1, 1, "P",
@@ -5381,9 +5848,15 @@ struct save_window_data
/* All fields above are traced by the GC.
From `frame-cols' down, the fields are ignored by the GC. */
-
- int frame_cols, frame_lines, frame_menu_bar_lines;
- int frame_tool_bar_lines;
+ /* We should be able to do without the following two. */
+ int frame_cols, frame_lines;
+ /* These two should get eventually replaced by their pixel
+ counterparts. */
+ int frame_menu_bar_lines, frame_tool_bar_lines;
+ int frame_text_width, frame_text_height;
+ /* These are currently unused. We need them as soon as we convert
+ to pixels. */
+ int frame_menu_bar_height, frame_tool_bar_height;
};
/* This is saved as a Lisp_Vector */
@@ -5392,6 +5865,7 @@ struct saved_window
struct vectorlike_header header;
Lisp_Object window, buffer, start, pointm, mark;
+ Lisp_Object pixel_left, pixel_top, pixel_height, pixel_width;
Lisp_Object left_col, top_line, total_cols, total_lines;
Lisp_Object normal_cols, normal_lines;
Lisp_Object hscroll, min_hscroll;
@@ -5512,8 +5986,12 @@ the return value is nil. Otherwise the value is t. */)
made, we change the frame to the size specified in the
configuration, restore the configuration, and then resize it
back. We keep track of the prevailing height in these variables. */
- int previous_frame_lines = FRAME_LINES (f);
- int previous_frame_cols = FRAME_COLS (f);
+ int previous_frame_text_height = FRAME_TEXT_HEIGHT (f);
+ int previous_frame_text_width = FRAME_TEXT_WIDTH (f);
+ /* int previous_frame_menu_bar_height = FRAME_MENU_BAR_HEIGHT (f); */
+ /* int previous_frame_tool_bar_height = FRAME_TOOL_BAR_HEIGHT (f); */
+ /* int previous_frame_lines = FRAME_LINES (f); */
+ /* int previous_frame_cols = FRAME_COLS (f); */
int previous_frame_menu_bar_lines = FRAME_MENU_BAR_LINES (f);
int previous_frame_tool_bar_lines = FRAME_TOOL_BAR_LINES (f);
@@ -5536,13 +6014,12 @@ the return value is nil. Otherwise the value is t. */)
if it runs during this. */
block_input ();
- if (data->frame_lines != previous_frame_lines
- || data->frame_cols != previous_frame_cols)
- change_frame_size (f, data->frame_lines,
- data->frame_cols, 0, 0, 0);
-#ifdef HAVE_MENUS
- if (data->frame_menu_bar_lines
- != previous_frame_menu_bar_lines)
+ if (data->frame_text_width != previous_frame_text_width
+ || data->frame_text_height != previous_frame_text_height)
+ change_frame_size (f, data->frame_text_width,
+ data->frame_text_height, 0, 0, 0, 1);
+
+ if (data->frame_menu_bar_lines != previous_frame_menu_bar_lines)
{
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
@@ -5553,10 +6030,8 @@ the return value is nil. Otherwise the value is t. */)
set_menu_bar_lines (f, make_number (data->frame_menu_bar_lines),
make_number (0));
}
-#endif
#ifdef HAVE_WINDOW_SYSTEM
- if (data->frame_tool_bar_lines
- != previous_frame_tool_bar_lines)
+ if (data->frame_tool_bar_lines != previous_frame_tool_bar_lines)
x_set_tool_bar_lines (f, make_number (data->frame_tool_bar_lines),
make_number (0));
#endif
@@ -5575,7 +6050,7 @@ the return value is nil. Otherwise the value is t. */)
BUF_PT_BYTE (XBUFFER (w->contents)));
}
- windows_or_buffers_changed = 39;
+ fset_redisplay (f);
FRAME_WINDOW_SIZES_CHANGED (f) = 1;
/* Problem: Freeing all matrices and later allocating them again
@@ -5628,6 +6103,10 @@ the return value is nil. Otherwise the value is t. */)
/* If we squirreled away the buffer, restore it now. */
if (BUFFERP (w->combination_limit))
wset_buffer (w, w->combination_limit);
+ w->pixel_left = XFASTINT (p->pixel_left);
+ w->pixel_top = XFASTINT (p->pixel_top);
+ w->pixel_width = XFASTINT (p->pixel_width);
+ w->pixel_height = XFASTINT (p->pixel_height);
w->left_col = XFASTINT (p->left_col);
w->top_line = XFASTINT (p->top_line);
w->total_cols = XFASTINT (p->total_cols);
@@ -5728,25 +6207,17 @@ the return value is nil. Otherwise the value is t. */)
make_number (old_point),
XWINDOW (data->current_window)->contents);
- /* In the following call to `select-window', prevent "swapping out
- point" in the old selected window using the buffer that has
- been restored into it. We already swapped out that point from
- that window's old buffer. */
- select_window (data->current_window, Qnil, 1);
- BVAR (XBUFFER (XWINDOW (selected_window)->contents), last_selected_window)
- = selected_window;
-
if (NILP (data->focus_frame)
|| (FRAMEP (data->focus_frame)
&& FRAME_LIVE_P (XFRAME (data->focus_frame))))
Fredirect_frame_focus (frame, data->focus_frame);
- /* Set the screen height to the value it had before this function. */
- if (previous_frame_lines != FRAME_LINES (f)
- || previous_frame_cols != FRAME_COLS (f))
- change_frame_size (f, previous_frame_lines, previous_frame_cols,
- 0, 0, 0);
-#ifdef HAVE_MENUS
+ /* Set the frame size to the value it had before this function. */
+ if (previous_frame_text_width != FRAME_TEXT_WIDTH (f)
+ || previous_frame_text_height != FRAME_TEXT_HEIGHT (f))
+ change_frame_size (f, previous_frame_text_width,
+ previous_frame_text_height, 0, 0, 0, 1);
+
if (previous_frame_menu_bar_lines != FRAME_MENU_BAR_LINES (f))
{
#ifdef HAVE_WINDOW_SYSTEM
@@ -5759,7 +6230,6 @@ the return value is nil. Otherwise the value is t. */)
set_menu_bar_lines (f, make_number (previous_frame_menu_bar_lines),
make_number (0));
}
-#endif
#ifdef HAVE_WINDOW_SYSTEM
if (previous_frame_tool_bar_lines != FRAME_TOOL_BAR_LINES (f))
x_set_tool_bar_lines (f, make_number (previous_frame_tool_bar_lines),
@@ -5786,6 +6256,20 @@ the return value is nil. Otherwise the value is t. */)
delete_deletable_window (window);
}
+ /* In the following call to `select-window', prevent "swapping out
+ point" in the old selected window using the buffer that has
+ been restored into it. We already swapped out that point from
+ that window's old buffer. */
+ /* This `select_window' calls record_buffer which calls Fdelq which
+ invokes QUIT, so we do it here at the end rather than earlier,
+ to minimize the risk of interrupting the Fset_window_configuration
+ in an inconsistent state (e.g. before frame-focus redirection is
+ canceled). */
+ select_window (data->current_window, Qnil, 1);
+ BVAR (XBUFFER (XWINDOW (selected_window)->contents),
+ last_selected_window)
+ = selected_window;
+
/* Fselect_window will have made f the selected frame, so we
reselect the proper frame here. Fhandle_switch_frame will change the
selected window too, but that doesn't make the call to
@@ -5938,6 +6422,10 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
wset_temslot (w, make_number (i)); i++;
p->window = window;
p->buffer = (WINDOW_LEAF_P (w) ? w->contents : Qnil);
+ p->pixel_left = make_number (w->pixel_left);
+ p->pixel_top = make_number (w->pixel_top);
+ p->pixel_width = make_number (w->pixel_width);
+ p->pixel_height = make_number (w->pixel_height);
p->left_col = make_number (w->left_col);
p->top_line = make_number (w->top_line);
p->total_cols = make_number (w->total_cols);
@@ -6077,6 +6565,10 @@ saved by this function. */)
data->frame_lines = FRAME_LINES (f);
data->frame_menu_bar_lines = FRAME_MENU_BAR_LINES (f);
data->frame_tool_bar_lines = FRAME_TOOL_BAR_LINES (f);
+ data->frame_text_width = FRAME_TEXT_WIDTH (f);
+ data->frame_text_height = FRAME_TEXT_HEIGHT (f);
+ data->frame_menu_bar_height = FRAME_MENU_BAR_HEIGHT (f);
+ data->frame_tool_bar_height = FRAME_TOOL_BAR_HEIGHT (f);
data->selected_frame = selected_frame;
data->current_window = FRAME_SELECTED_WINDOW (f);
XSETBUFFER (data->current_buffer, current_buffer);
@@ -6103,7 +6595,7 @@ apply_window_adjustment (struct window *w)
adjust_window_margins (w);
clear_glyph_matrix (w->current_matrix);
w->window_end_valid = 0;
- windows_or_buffers_changed = 40;
+ wset_redisplay (w);
adjust_frame_glyphs (XFRAME (WINDOW_FRAME (w)));
}
@@ -6163,8 +6655,10 @@ as nil. */)
(Lisp_Object window)
{
struct window *w = decode_live_window (window);
- return Fcons (w->left_margin_cols ? make_number (w->left_margin_cols) : Qnil,
- w->right_margin_cols ? make_number (w->right_margin_cols) : Qnil);
+ return Fcons (w->left_margin_cols
+ ? make_number (w->left_margin_cols) : Qnil,
+ w->right_margin_cols
+ ? make_number (w->right_margin_cols) : Qnil);
}
@@ -6274,15 +6768,14 @@ DEFUN ("set-window-scroll-bars", Fset_window_scroll_bars,
doc: /* Set width and type of scroll bars of window WINDOW.
WINDOW must be a live window and defaults to the selected one.
-Second parameter WIDTH specifies the pixel width for the scroll bar;
-this is automatically adjusted to a multiple of the frame column width.
+Second parameter WIDTH specifies the pixel width for the scroll bar.
Third parameter VERTICAL-TYPE specifies the type of the vertical scroll
bar: left, right, or nil.
If WIDTH is nil, use the frame's scroll-bar width.
If VERTICAL-TYPE is t, use the frame's scroll-bar type.
Fourth parameter HORIZONTAL-TYPE is currently unused.
-Return t if scroll bars was actually changed and nil otherwise. */)
+Return t if scroll bars were actually changed and nil otherwise. */)
(Lisp_Object window, Lisp_Object width,
Lisp_Object vertical_type, Lisp_Object horizontal_type)
{
@@ -6477,6 +6970,10 @@ compare_window_configurations (Lisp_Object configuration1,
!= EQ (d2->current_window, sw2->window)
/* Windows' buffers must match. */
|| !EQ (sw1->buffer, sw2->buffer)
+ || !EQ (sw1->pixel_left, sw2->pixel_left)
+ || !EQ (sw1->pixel_top, sw2->pixel_top)
+ || !EQ (sw1->pixel_height, sw2->pixel_height)
+ || !EQ (sw1->pixel_width, sw2->pixel_width)
|| !EQ (sw1->left_col, sw2->left_col)
|| !EQ (sw1->top_line, sw2->top_line)
|| !EQ (sw1->total_cols, sw2->total_cols)
@@ -6555,6 +7052,7 @@ syms_of_window (void)
DEFSYM (Qdelete_window, "delete-window");
DEFSYM (Qwindow_resize_root_window, "window--resize-root-window");
DEFSYM (Qwindow_resize_root_window_vertically, "window--resize-root-window-vertically");
+ DEFSYM (Qwindow_pixel_to_total, "window--pixel-to-total");
DEFSYM (Qsafe, "safe");
DEFSYM (Qdisplay_buffer, "display-buffer");
DEFSYM (Qreplace_buffer_in_windows, "replace-buffer-in-windows");
@@ -6713,6 +7211,18 @@ Parameters not saved by `current-window-configuration' or
respectively are not installed by `window-state-put'. */);
Vwindow_persistent_parameters = list1 (Fcons (Qclone_of, Qt));
+ DEFVAR_BOOL ("window-resize-pixelwise", window_resize_pixelwise,
+ doc: /* Non-nil means resizing windows works pixelwise.
+Functions currently affected by this option are `split-window',
+`maximize-window', `minimize-window', `fit-window-to-buffer' and
+`fit-frame-to-buffer' and all functions symmetrically resizing a
+parent window.
+
+Note that when a frame's pixel size is not a multiple of the
+frame's character size, at least one window may get resized
+pixelwise even if this option is nil. */);
+ window_resize_pixelwise = 0;
+
defsubr (&Sselected_window);
defsubr (&Sminibuffer_window);
defsubr (&Swindow_minibuffer_p);
@@ -6735,16 +7245,23 @@ respectively are not installed by `window-state-put'. */);
defsubr (&Swindow_combination_limit);
defsubr (&Sset_window_combination_limit);
defsubr (&Swindow_use_time);
- defsubr (&Swindow_top_line);
- defsubr (&Swindow_left_column);
- defsubr (&Swindow_total_height);
+ defsubr (&Swindow_pixel_width);
+ defsubr (&Swindow_pixel_height);
defsubr (&Swindow_total_width);
+ defsubr (&Swindow_total_height);
defsubr (&Swindow_normal_size);
+ defsubr (&Swindow_new_pixel);
defsubr (&Swindow_new_total);
defsubr (&Swindow_new_normal);
+ defsubr (&Swindow_pixel_left);
+ defsubr (&Swindow_pixel_top);
+ defsubr (&Swindow_left_column);
+ defsubr (&Swindow_top_line);
+ defsubr (&Sset_window_new_pixel);
defsubr (&Sset_window_new_total);
defsubr (&Sset_window_new_normal);
defsubr (&Swindow_resize_apply);
+ defsubr (&Swindow_resize_apply_total);
defsubr (&Swindow_body_height);
defsubr (&Swindow_body_width);
defsubr (&Swindow_hscroll);
@@ -6754,6 +7271,10 @@ respectively are not installed by `window-state-put'. */);
defsubr (&Swindow_edges);
defsubr (&Swindow_pixel_edges);
defsubr (&Swindow_absolute_pixel_edges);
+ defsubr (&Swindow_mode_line_height);
+ defsubr (&Swindow_header_line_height);
+ defsubr (&Swindow_right_divider_width);
+ defsubr (&Swindow_bottom_divider_width);
defsubr (&Swindow_inside_edges);
defsubr (&Swindow_inside_pixel_edges);
defsubr (&Swindow_inside_absolute_pixel_edges);
@@ -6776,6 +7297,7 @@ respectively are not installed by `window-state-put'. */);
defsubr (&Sresize_mini_window_internal);
defsubr (&Sset_window_buffer);
defsubr (&Srun_window_configuration_change_hook);
+ defsubr (&Srun_window_scroll_functions);
defsubr (&Sselect_window);
defsubr (&Sforce_window_update);
defsubr (&Ssplit_window_internal);
@@ -6787,6 +7309,7 @@ respectively are not installed by `window-state-put'. */);
defsubr (&Sscroll_other_window);
defsubr (&Sminibuffer_selected_window);
defsubr (&Srecenter);
+ defsubr (&Swindow_text_width);
defsubr (&Swindow_text_height);
defsubr (&Smove_to_window_line);
defsubr (&Swindow_configuration_p);
diff --git a/src/window.h b/src/window.h
index f619b82e8a3..b91161f4d32 100644
--- a/src/window.h
+++ b/src/window.h
@@ -111,6 +111,7 @@ struct window
to something beyond an integer, so C int can't be used here. */
Lisp_Object new_total;
Lisp_Object new_normal;
+ Lisp_Object new_pixel;
/* May be buffer, window, or nil. */
Lisp_Object contents;
@@ -180,14 +181,26 @@ struct window
/* Number saying how recently window was selected. */
int use_time;
+ /* Unique number of window assigned when it was created. */
+ int sequence_number;
+
+ /* The upper left corner pixel coordinates of this window, as
+ integers relative to upper left corner of frame = 0, 0. */
+ int pixel_left;
+ int pixel_top;
+
/* The upper left corner coordinates of this window,
relative to upper left corner of frame = 0, 0. */
int left_col;
int top_line;
+ /* The pixel size of the window. */
+ int pixel_width;
+ int pixel_height;
+
/* The size of the window. */
- int total_lines;
int total_cols;
+ int total_lines;
/* Number of columns display within the window is scrolled to the left. */
ptrdiff_t hscroll;
@@ -337,6 +350,9 @@ struct window
the frame image that window_end_pos did not get onto the frame. */
unsigned window_end_valid : 1;
+ /* True if it needs to be redisplayed. */
+ unsigned redisplay : 1;
+
/* Amount by which lines of this window are scrolled in
y-direction (smooth scrolling). */
int vscroll;
@@ -344,7 +360,7 @@ struct window
/* Z_BYTE - buffer position of the last glyph in the current matrix of W.
Should be nonnegative, and only valid if window_end_valid is nonzero. */
ptrdiff_t window_end_bytepos;
-};
+ };
/* Most code should use these functions to set Lisp fields in struct
window. */
@@ -353,31 +369,43 @@ wset_frame (struct window *w, Lisp_Object val)
{
w->frame = val;
}
+
INLINE void
wset_next (struct window *w, Lisp_Object val)
{
w->next = val;
}
+
INLINE void
wset_prev (struct window *w, Lisp_Object val)
{
w->prev = val;
}
+
INLINE void
wset_redisplay_end_trigger (struct window *w, Lisp_Object val)
{
w->redisplay_end_trigger = val;
}
+
+INLINE void
+wset_new_pixel (struct window *w, Lisp_Object val)
+{
+ w->new_pixel = val;
+}
+
INLINE void
wset_vertical_scroll_bar (struct window *w, Lisp_Object val)
{
w->vertical_scroll_bar = val;
}
+
INLINE void
wset_prev_buffers (struct window *w, Lisp_Object val)
{
w->prev_buffers = val;
}
+
INLINE void
wset_next_buffers (struct window *w, Lisp_Object val)
{
@@ -443,38 +471,44 @@ wset_next_buffers (struct window *w, Lisp_Object val)
#define WINDOW_FRAME_LINE_HEIGHT(W) \
(FRAME_LINE_HEIGHT (WINDOW_XFRAME ((W))))
-/* Return the width of window W in canonical column units.
+/* Return the pixel width of window W.
This includes scroll bars and fringes. */
+#define WINDOW_PIXEL_WIDTH(W) (W)->pixel_width
+
+/* Return the pixel height of window W.
+ This includes header and mode lines, if any. */
+#define WINDOW_PIXEL_HEIGHT(W) (W)->pixel_height
+/* Return the width of window W in canonical column units.
+ This includes scroll bars and fringes.
+ This value is adjusted such that the sum of the widths of all child
+ windows equals the width of their parent window. */
#define WINDOW_TOTAL_COLS(W) (W)->total_cols
/* Return the height of window W in canonical line units.
- This includes header and mode lines, if any. */
-
+ This includes header and mode lines, if any.
+ This value is adjusted such that the sum of the heights of all child
+ windows equals the height of their parent window. */
#define WINDOW_TOTAL_LINES(W) (W)->total_lines
-/* Return the total pixel width of window W. */
-
-#define WINDOW_TOTAL_WIDTH(W) \
- (WINDOW_TOTAL_COLS (W) * WINDOW_FRAME_COLUMN_WIDTH (W))
-
-/* Return the total pixel height of window W. */
-
-#define WINDOW_TOTAL_HEIGHT(W) \
- (WINDOW_TOTAL_LINES (W) * WINDOW_FRAME_LINE_HEIGHT (W))
-
-/* For HORFLAG non-zero the total number of columns of window W. Otherwise
- the total number of lines of W. */
-
-#define WINDOW_TOTAL_SIZE(w, horflag) \
- (horflag ? WINDOW_TOTAL_COLS (w) : WINDOW_TOTAL_LINES (w))
-
/* The smallest acceptable dimensions for a window. Anything smaller
might crash Emacs. */
+#define MIN_SAFE_WINDOW_WIDTH (2)
+
+#define MIN_SAFE_WINDOW_PIXEL_WIDTH(W) \
+ (2 * WINDOW_FRAME_COLUMN_WIDTH (W))
-#define MIN_SAFE_WINDOW_WIDTH (2)
#define MIN_SAFE_WINDOW_HEIGHT (1)
+#define MIN_SAFE_WINDOW_PIXEL_HEIGHT(W) \
+ (WINDOW_FRAME_LINE_HEIGHT (W))
+
+/* Width of right divider of window W. */
+#define WINDOW_RIGHT_DIVIDER_WIDTH(W) \
+ ((WINDOW_RIGHTMOST_P (W) || MINI_WINDOW_P (W)) \
+ ? 0 \
+ : FRAME_RIGHT_DIVIDER_WIDTH (WINDOW_XFRAME (W)))
+
/* Return the canonical frame column at which window W starts.
This includes a left-hand scroll bar, if any. */
@@ -497,20 +531,37 @@ wset_next_buffers (struct window *w, Lisp_Object val)
#define WINDOW_BOTTOM_EDGE_LINE(W) \
(WINDOW_TOP_EDGE_LINE (W) + WINDOW_TOTAL_LINES (W))
+/* Return the left pixel edge at which window W starts.
+ This includes a left-hand scroll bar, if any. */
+#define WINDOW_LEFT_PIXEL_EDGE(W) (W)->pixel_left
+
+/* Return the right pixel edge before which window W ends.
+ This includes a right-hand scroll bar, if any. */
+#define WINDOW_RIGHT_PIXEL_EDGE(W) \
+ (WINDOW_LEFT_PIXEL_EDGE (W) + WINDOW_PIXEL_WIDTH (W))
+
+/* Return the top pixel edge at which window W starts.
+ This includes a header line, if any. */
+#define WINDOW_TOP_PIXEL_EDGE(W) (W)->pixel_top
+
+/* Return the bottom pixel edge before which window W ends.
+ This includes a mode line, if any. */
+#define WINDOW_BOTTOM_PIXEL_EDGE(W) \
+ (WINDOW_TOP_PIXEL_EDGE (W) + WINDOW_PIXEL_HEIGHT (W))
/* Return the frame x-position at which window W starts.
This includes a left-hand scroll bar, if any. */
#define WINDOW_LEFT_EDGE_X(W) \
(FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \
- + WINDOW_LEFT_EDGE_COL (W) * WINDOW_FRAME_COLUMN_WIDTH (W))
+ + WINDOW_LEFT_PIXEL_EDGE (W))
/* Return the frame x- position before which window W ends.
This includes a right-hand scroll bar, if any. */
#define WINDOW_RIGHT_EDGE_X(W) \
(FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \
- + WINDOW_RIGHT_EDGE_COL (W) * WINDOW_FRAME_COLUMN_WIDTH (W))
+ + WINDOW_RIGHT_PIXEL_EDGE (W))
/* 1 if W is a menu bar window. */
@@ -533,37 +584,45 @@ wset_next_buffers (struct window *w, Lisp_Object val)
#endif
/* Return the frame y-position at which window W starts.
- This includes a header line, if any. */
+ This includes a header line, if any.
+ PXW: With a menu or tool bar this is not symmetric to the _X values
+ since it _does_ include the internal border width. */
#define WINDOW_TOP_EDGE_Y(W) \
(((WINDOW_MENU_BAR_P (W) || WINDOW_TOOL_BAR_P (W)) \
? 0 : FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W))) \
- + WINDOW_TOP_EDGE_LINE (W) * WINDOW_FRAME_LINE_HEIGHT (W))
+ + WINDOW_TOP_PIXEL_EDGE (W))
/* Return the frame y-position before which window W ends.
This includes a mode line, if any. */
-
-#define WINDOW_BOTTOM_EDGE_Y(W) \
- (((WINDOW_MENU_BAR_P (W) || WINDOW_TOOL_BAR_P (W)) \
+#define WINDOW_BOTTOM_EDGE_Y(W) \
+ (((WINDOW_MENU_BAR_P (W) || WINDOW_TOOL_BAR_P (W)) \
? 0 : FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W))) \
- + WINDOW_BOTTOM_EDGE_LINE (W) * WINDOW_FRAME_LINE_HEIGHT (W))
-
+ + WINDOW_BOTTOM_PIXEL_EDGE (W))
/* 1 if window W takes up the full width of its frame. */
-
-#define WINDOW_FULL_WIDTH_P(W) \
- (WINDOW_TOTAL_COLS (W) == FRAME_TOTAL_COLS (WINDOW_XFRAME (W)))
+#define WINDOW_FULL_WIDTH_P(W) \
+ (WINDOW_PIXEL_WIDTH (W) \
+ == (WINDOW_PIXEL_WIDTH \
+ (XWINDOW (FRAME_ROOT_WINDOW (WINDOW_XFRAME (W)))))) \
/* 1 if window W's has no other windows to its left in its frame. */
#define WINDOW_LEFTMOST_P(W) \
- (WINDOW_LEFT_EDGE_COL (W) == 0)
+ (WINDOW_LEFT_PIXEL_EDGE (W) == 0)
/* 1 if window W's has no other windows to its right in its frame. */
-
-#define WINDOW_RIGHTMOST_P(W) \
- (WINDOW_RIGHT_EDGE_COL (W) == FRAME_TOTAL_COLS (WINDOW_XFRAME (W)))
-
+#define WINDOW_RIGHTMOST_P(W) \
+ (WINDOW_RIGHT_PIXEL_EDGE (W) \
+ == (WINDOW_RIGHT_PIXEL_EDGE \
+ (XWINDOW (FRAME_ROOT_WINDOW (WINDOW_XFRAME (W)))))) \
+
+/* 1 if window W's has no other windows below it in its frame
+ (the minibuffer window is not counted in this respect). */
+#define WINDOW_BOTTOMMOST_P(W) \
+ (WINDOW_BOTTOM_PIXEL_EDGE (W) \
+ == (WINDOW_BOTTOM_PIXEL_EDGE \
+ (XWINDOW (FRAME_ROOT_WINDOW (WINDOW_XFRAME (W)))))) \
/* Return the frame column at which the text (or left fringe) in
window W starts. This is different from the `LEFT_EDGE' because it
@@ -573,6 +632,13 @@ wset_next_buffers (struct window *w, Lisp_Object val)
(WINDOW_LEFT_EDGE_COL (W) \
+ WINDOW_LEFT_SCROLL_BAR_COLS (W))
+/* Return the pixel value where the text (or left fringe) in
+ window W starts. This is different from the `LEFT_EDGE' because it
+ does not include a left-hand scroll bar if any. */
+#define WINDOW_BOX_LEFT_PIXEL_EDGE(W) \
+ (WINDOW_LEFT_PIXEL_EDGE (W) \
+ + WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (W))
+
/* Return the window column before which the text in window W ends.
This is different from WINDOW_RIGHT_EDGE_COL because it does not
include a scroll bar or window-separating line on the right edge. */
@@ -581,59 +647,72 @@ wset_next_buffers (struct window *w, Lisp_Object val)
(WINDOW_RIGHT_EDGE_COL (W) \
- WINDOW_RIGHT_SCROLL_BAR_COLS (W))
+/* Return the pixel value before which the text in window W ends. This
+ is different from the `RIGHT_EDGE' because it does not include a
+ right-hand scroll bar or window-separating line on the right
+ edge. */
+#define WINDOW_BOX_RIGHT_PIXEL_EDGE(W) \
+ (WINDOW_RIGHT_PIXEL_EDGE (W) \
+ - WINDOW_RIGHT_DIVIDER_WIDTH (W) \
+ - WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH (W))
/* Return the frame position at which the text (or left fringe) in
window W starts. This is different from the `LEFT_EDGE' because it
does not include a left-hand scroll bar if any. */
-
-#define WINDOW_BOX_LEFT_EDGE_X(W) \
+#define WINDOW_BOX_LEFT_EDGE_X(W) \
(FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \
- + WINDOW_BOX_LEFT_EDGE_COL (W) * WINDOW_FRAME_COLUMN_WIDTH (W))
+ + WINDOW_BOX_LEFT_PIXEL_EDGE (W))
/* Return the window column before which the text in window W ends.
This is different from WINDOW_RIGHT_EDGE_COL because it does not
include a scroll bar or window-separating line on the right edge. */
-
-#define WINDOW_BOX_RIGHT_EDGE_X(W) \
+#define WINDOW_BOX_RIGHT_EDGE_X(W) \
(FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \
- + WINDOW_BOX_RIGHT_EDGE_COL (W) * WINDOW_FRAME_COLUMN_WIDTH (W))
-
-
-/* Width of left margin area in columns. */
+ + WINDOW_BOX_RIGHT_PIXEL_EDGE (W))
+/* Widths of marginal areas in columns. */
#define WINDOW_LEFT_MARGIN_COLS(W) (W->left_margin_cols)
-/* Width of right marginal area in columns. */
-
#define WINDOW_RIGHT_MARGIN_COLS(W) (W->right_margin_cols)
-/* Width of left margin area in pixels. */
+#define WINDOW_MARGINS_COLS(W) \
+ (WINDOW_LEFT_MARGIN_COLS (W) \
+ + WINDOW_RIGHT_MARGIN_COLS (W))
+/* Widths of marginal areas in pixels. */
#define WINDOW_LEFT_MARGIN_WIDTH(W) \
(W->left_margin_cols * WINDOW_FRAME_COLUMN_WIDTH (W))
-/* Width of right marginal area in pixels. */
-
-#define WINDOW_RIGHT_MARGIN_WIDTH(W) \
+#define WINDOW_RIGHT_MARGIN_WIDTH(W) \
(W->right_margin_cols * WINDOW_FRAME_COLUMN_WIDTH (W))
-/* Total width of fringes reserved for drawing truncation bitmaps,
- continuation bitmaps and alike. The width is in canonical char
- units of the frame. This must currently be the case because window
- sizes aren't pixel values. If it weren't the case, we wouldn't be
- able to split windows horizontally nicely. */
+#define WINDOW_MARGINS_WIDTH(W) \
+ (WINDOW_LEFT_MARGIN_WIDTH (W) \
+ + WINDOW_RIGHT_MARGIN_WIDTH (W))
+/* Pixel-widths of fringes. */
+#define WINDOW_LEFT_FRINGE_WIDTH(W) \
+ (W->left_fringe_width >= 0 \
+ ? W->left_fringe_width \
+ : FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
+
+#define WINDOW_RIGHT_FRINGE_WIDTH(W) \
+ (W->right_fringe_width >= 0 \
+ ? W->right_fringe_width \
+ : FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
+
+#define WINDOW_FRINGES_WIDTH(W) \
+ (WINDOW_LEFT_FRINGE_WIDTH (W) + WINDOW_RIGHT_FRINGE_WIDTH (W))
+
+/* Widths of fringes in columns. */
#define WINDOW_FRINGE_COLS(W) \
((W->left_fringe_width >= 0 \
&& W->right_fringe_width >= 0) \
- ? ((W->left_fringe_width \
- + W->right_fringe_width \
+ ? ((WINDOW_FRINGES_WIDTH (W) \
+ WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \
/ WINDOW_FRAME_COLUMN_WIDTH (W)) \
: FRAME_FRINGE_COLS (WINDOW_XFRAME (W)))
-/* Column-width of the left and right fringe. */
-
#define WINDOW_LEFT_FRINGE_COLS(W) \
((WINDOW_LEFT_FRINGE_WIDTH ((W)) \
+ WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \
@@ -644,29 +723,12 @@ wset_next_buffers (struct window *w, Lisp_Object val)
+ WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \
/ WINDOW_FRAME_COLUMN_WIDTH (W))
-/* Pixel-width of the left and right fringe. */
-
-#define WINDOW_LEFT_FRINGE_WIDTH(W) \
- (W->left_fringe_width >= 0 ? W->left_fringe_width \
- : FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
-
-#define WINDOW_RIGHT_FRINGE_WIDTH(W) \
- (W->right_fringe_width >= 0 ? W->right_fringe_width \
- : FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
-
-/* Total width of fringes in pixels. */
-
-#define WINDOW_TOTAL_FRINGE_WIDTH(W) \
- (WINDOW_LEFT_FRINGE_WIDTH (W) + WINDOW_RIGHT_FRINGE_WIDTH (W))
-
/* Are fringes outside display margins in window W. */
-
#define WINDOW_HAS_FRINGES_OUTSIDE_MARGINS(W) \
((W)->fringes_outside_margins)
/* Say whether scroll bars are currently enabled for window W,
and which side they are on. */
-
#define WINDOW_VERTICAL_SCROLL_BAR_TYPE(w) \
(EQ (w->vertical_scroll_bar_type, Qt) \
? FRAME_VERTICAL_SCROLL_BAR_TYPE (WINDOW_XFRAME (w)) \
@@ -694,15 +756,14 @@ wset_next_buffers (struct window *w, Lisp_Object val)
/* Width that a scroll bar in window W should have, if there is one.
Measured in pixels. If scroll bars are turned off, this is still
nonzero. */
-
#define WINDOW_CONFIG_SCROLL_BAR_WIDTH(w) \
- (w->scroll_bar_width >= 0 ? w->scroll_bar_width \
+ (w->scroll_bar_width >= 0 \
+ ? w->scroll_bar_width \
: FRAME_CONFIG_SCROLL_BAR_WIDTH (WINDOW_XFRAME (w)))
/* Width that a scroll bar in window W should have, if there is one.
Measured in columns (characters). If scroll bars are turned off,
this is still nonzero. */
-
#define WINDOW_CONFIG_SCROLL_BAR_COLS(w) \
(w->scroll_bar_width >= 0 \
? ((w->scroll_bar_width \
@@ -710,65 +771,64 @@ wset_next_buffers (struct window *w, Lisp_Object val)
/ WINDOW_FRAME_COLUMN_WIDTH (w)) \
: FRAME_CONFIG_SCROLL_BAR_COLS (WINDOW_XFRAME (w)))
-/* Width of a scroll bar in window W, measured in columns (characters),
- but only if scroll bars are on the left. If scroll bars are on
- the right in this frame, or there are no scroll bars, value is 0. */
-
+/* Width of left scroll bar in window W, measured in columns
+ (characters). If scroll bars are on the right in this frame, or
+ there are no scroll bars, value is 0. */
#define WINDOW_LEFT_SCROLL_BAR_COLS(w) \
(WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \
? (WINDOW_CONFIG_SCROLL_BAR_COLS (w)) \
: 0)
-/* Width of a left scroll bar area in window W , measured in pixels. */
-
-#define WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH(w) \
- (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \
- ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \
- : 0)
-
-/* Width of a scroll bar in window W, measured in columns (characters),
- but only if scroll bars are on the right. If scroll bars are on
- the left in this frame, or there are no scroll bars, value is 0. */
-
+/* Width of right scroll bar in window W, measured in columns
+ (characters). If scroll bars are on the left in this frame, or there
+ are no scroll bars, value is 0. */
#define WINDOW_RIGHT_SCROLL_BAR_COLS(w) \
(WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w) \
? WINDOW_CONFIG_SCROLL_BAR_COLS (w) \
: 0)
-/* Width of a left scroll bar area in window W , measured in pixels. */
-
-#define WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH(w) \
- (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w) \
- ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \
- : 0)
-
-
-/* Actual width of a scroll bar in window W, measured in columns. */
-
+/* Width of a scroll bar in window W, measured in columns. */
#define WINDOW_SCROLL_BAR_COLS(w) \
(WINDOW_HAS_VERTICAL_SCROLL_BAR (w) \
? WINDOW_CONFIG_SCROLL_BAR_COLS (w) \
: 0)
-/* Width of a left scroll bar area in window W , measured in pixels. */
+/* Width of a left scroll bar area in window W, measured in pixels. */
+#define WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH(w) \
+ (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \
+ ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) \
+ : 0)
-#define WINDOW_SCROLL_BAR_AREA_WIDTH(w) \
- (WINDOW_HAS_VERTICAL_SCROLL_BAR (w) \
- ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \
+/* Width of a right scroll bar area in window W, measured in pixels. */
+#define WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH(w) \
+ (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w) \
+ ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) \
: 0)
+/* Width of scroll bar area in window W, measured in pixels. */
+#define WINDOW_SCROLL_BAR_AREA_WIDTH(w) \
+ (WINDOW_HAS_VERTICAL_SCROLL_BAR (w) \
+ ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) \
+ : 0)
/* Return the frame position where the scroll bar of window W starts. */
-
#define WINDOW_SCROLL_BAR_AREA_X(W) \
(WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (W) \
? WINDOW_BOX_RIGHT_EDGE_X (W) \
: WINDOW_LEFT_EDGE_X (W))
+/* Width of bottom divider of window W. */
+#define WINDOW_BOTTOM_DIVIDER_WIDTH(W) \
+ (((WINDOW_BOTTOMMOST_P (W) \
+ && NILP ((XWINDOW (FRAME_ROOT_WINDOW \
+ (WINDOW_XFRAME (W))))->next)) \
+ || EQ ((W)->prev, FRAME_ROOT_WINDOW (WINDOW_XFRAME (W))) \
+ || (W)->pseudo_window_p) \
+ ? 0 \
+ : FRAME_BOTTOM_DIVIDER_WIDTH (WINDOW_XFRAME (W)))
/* Height in pixels, and in lines, of the mode line.
May be zero if W doesn't have a mode line. */
-
#define WINDOW_MODE_LINE_HEIGHT(W) \
(WINDOW_WANTS_MODELINE_P ((W)) \
? CURRENT_MODE_LINE_HEIGHT (W) \
@@ -779,7 +839,6 @@ wset_next_buffers (struct window *w, Lisp_Object val)
/* Height in pixels, and in lines, of the header line.
Zero if W doesn't have a header line. */
-
#define WINDOW_HEADER_LINE_HEIGHT(W) \
(WINDOW_WANTS_HEADER_LINE_P ((W)) \
? CURRENT_HEADER_LINE_HEIGHT (W) \
@@ -788,43 +847,38 @@ wset_next_buffers (struct window *w, Lisp_Object val)
#define WINDOW_HEADER_LINE_LINES(W) \
(!! WINDOW_WANTS_HEADER_LINE_P ((W)))
-/* Pixel height of window W without mode line. */
-
+/* Pixel height of window W without mode line and bottom divider. */
#define WINDOW_BOX_HEIGHT_NO_MODE_LINE(W) \
- (WINDOW_TOTAL_HEIGHT ((W)) \
+ (WINDOW_PIXEL_HEIGHT ((W)) \
+ - WINDOW_BOTTOM_DIVIDER_WIDTH (W) \
- WINDOW_MODE_LINE_HEIGHT ((W)))
-/* Pixel height of window W without mode and header line. */
-
+/* Pixel height of window W without mode and header line and bottom
+ divider. */
#define WINDOW_BOX_TEXT_HEIGHT(W) \
- (WINDOW_TOTAL_HEIGHT ((W)) \
+ (WINDOW_PIXEL_HEIGHT ((W)) \
+ - WINDOW_BOTTOM_DIVIDER_WIDTH (W) \
- WINDOW_MODE_LINE_HEIGHT ((W)) \
- WINDOW_HEADER_LINE_HEIGHT ((W)))
-
/* Convert window W relative pixel X to frame pixel coordinates. */
-
#define WINDOW_TO_FRAME_PIXEL_X(W, X) \
((X) + WINDOW_BOX_LEFT_EDGE_X ((W)))
/* Convert window W relative pixel Y to frame pixel coordinates. */
-
#define WINDOW_TO_FRAME_PIXEL_Y(W, Y) \
((Y) + WINDOW_TOP_EDGE_Y ((W)))
/* Convert frame relative pixel X to window relative pixel X. */
-
#define FRAME_TO_WINDOW_PIXEL_X(W, X) \
((X) - WINDOW_BOX_LEFT_EDGE_X ((W)))
/* Convert frame relative pixel Y to window relative pixel Y. */
-
#define FRAME_TO_WINDOW_PIXEL_Y(W, Y) \
((Y) - WINDOW_TOP_EDGE_Y ((W)))
/* Convert a text area relative x-position in window W to frame X
pixel coordinates. */
-
#define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \
(window_box_left ((W), TEXT_AREA) + (X))
@@ -870,18 +924,17 @@ extern Lisp_Object minibuf_selected_window;
extern Lisp_Object make_window (void);
extern Lisp_Object window_from_coordinates (struct frame *, int, int,
enum window_part *, bool);
-extern void resize_frame_windows (struct frame *, int, bool);
+extern void resize_frame_windows (struct frame *, int, bool, bool);
extern void restore_window_configuration (Lisp_Object);
extern void delete_all_child_windows (Lisp_Object);
-extern void grow_mini_window (struct window *, int);
-extern void shrink_mini_window (struct window *);
+extern void grow_mini_window (struct window *, int, bool);
+extern void shrink_mini_window (struct window *, bool);
extern int window_relative_x_coord (struct window *, enum window_part, int);
void run_window_configuration_change_hook (struct frame *f);
-/* Make WINDOW display BUFFER as its contents. RUN_HOOKS_P non-zero
- means it's allowed to run hooks. See make_frame for a case where
- it's not allowed. */
+/* Make WINDOW display BUFFER. RUN_HOOKS_P non-zero means it's allowed
+ to run hooks. See make_frame for a case where it's not allowed. */
void set_window_buffer (Lisp_Object window, Lisp_Object buffer,
bool run_hooks_p, bool keep_margins_p);
@@ -900,19 +953,36 @@ extern EMACS_INT command_loop_level;
extern EMACS_INT minibuf_level;
-/* true if we should redraw the mode lines on the next redisplay. */
+/* Non-zero if we should redraw the mode lines on the next redisplay.
+ Usually set to a unique small integer so we can track the main causes of
+ full redisplays in `redisplay--mode-lines-cause'. */
extern int update_mode_lines;
/* Nonzero if window sizes or contents have changed since last
- redisplay that finished. */
+ redisplay that finished. Usually set to a unique small integer so
+ we can track the main causes of full redisplays in
+ `redisplay--all-windows-cause'. */
extern int windows_or_buffers_changed;
+/* The main redisplay routine usually only redisplays the selected-window,
+ so when something's changed elsewhere, we call one of the functions below
+ to indicate which other windows might also need to be redisplayed. */
+
+extern void wset_redisplay (struct window *w);
+extern void fset_redisplay (struct frame *f);
+extern void bset_redisplay (struct buffer *b);
+extern void bset_update_mode_line (struct buffer *b);
+/* Call this to tell redisplay to look for other windows than selected-window
+ that need to be redisplayed. Calling one of the *set_redisplay functions
+ above already does it, so it's only needed in unusual cases. */
+extern void redisplay_other_windows (void);
+
/* If *ROWS or *COLS are too small a size for FRAME, set them to the
minimum allowable size. */
-extern void check_frame_size (struct frame *frame, int *rows, int *cols);
+extern void check_frame_size (struct frame *frame, int *width, int *height, bool pixelwise);
/* Return a pointer to the glyph W's physical cursor is on. Value is
null if W's current matrix is invalid, so that no meaningful glyph
@@ -942,12 +1012,13 @@ struct glyph *get_phys_cursor_glyph (struct window *w);
extern Lisp_Object Qwindow_live_p;
extern Lisp_Object Vwindow_list;
+extern Lisp_Object window_list (void);
extern struct window *decode_live_window (Lisp_Object);
extern struct window *decode_any_window (Lisp_Object);
extern bool compare_window_configurations (Lisp_Object, Lisp_Object, bool);
extern void mark_window_cursors_off (struct window *);
extern int window_internal_height (struct window *);
-extern int window_body_cols (struct window *w);
+extern int window_body_width (struct window *w, bool);
extern void temp_output_buffer_show (Lisp_Object);
extern void replace_buffer_in_windows (Lisp_Object);
extern void replace_buffer_in_windows_safely (Lisp_Object);
diff --git a/src/xdisp.c b/src/xdisp.c
index 47855a1de3c..530eae3cb9e 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -502,12 +502,20 @@ static Lisp_Object Vmessage_stack;
static bool message_enable_multibyte;
-/* Nonzero if we should redraw the mode lines on the next redisplay. */
+/* Nonzero if we should redraw the mode lines on the next redisplay.
+ If it has value REDISPLAY_SOME, then only redisplay the mode lines where
+ the `redisplay' bit has been set. Otherwise, redisplay all mode lines
+ (the number used is then only used to track down the cause for this
+ full-redisplay). */
int update_mode_lines;
-/* Nonzero if window sizes or contents have changed since last
- redisplay that finished. */
+/* Nonzero if window sizes or contents other than selected-window have changed
+ since last redisplay that finished.
+ If it has value REDISPLAY_SOME, then only redisplay the windows where
+ the `redisplay' bit has been set. Otherwise, redisplay all windows
+ (the number used is then only used to track down the cause for this
+ full-redisplay). */
int windows_or_buffers_changed;
@@ -562,7 +570,7 @@ static struct glyph scratch_glyphs[MAX_SCRATCH_GLYPHS];
/* Ascent and height of the last line processed by move_it_to. */
-static int last_height;
+static int last_max_ascent, last_height;
/* Non-zero if there's a help-echo in the echo area. */
@@ -599,6 +607,56 @@ bool help_echo_showing_p;
CACHE = NULL; \
} while (0)
+/* Functions to mark elements as needing redisplay. */
+enum { REDISPLAY_SOME = 2}; /* Arbitrary choice. */
+
+void
+redisplay_other_windows (void)
+{
+ if (!windows_or_buffers_changed)
+ windows_or_buffers_changed = REDISPLAY_SOME;
+}
+
+void
+wset_redisplay (struct window *w)
+{
+ /* Beware: selected_window can be nil during early stages. */
+ if (!EQ (make_lisp_ptr (w, Lisp_Vectorlike), selected_window))
+ redisplay_other_windows ();
+ w->redisplay = true;
+}
+
+void
+fset_redisplay (struct frame *f)
+{
+ redisplay_other_windows ();
+ f->redisplay = true;
+}
+
+void
+bset_redisplay (struct buffer *b)
+{
+ int count = buffer_window_count (b);
+ if (count > 0)
+ {
+ /* ... it's visible in other window than selected, */
+ if (count > 1 || b != XBUFFER (XWINDOW (selected_window)->contents))
+ redisplay_other_windows ();
+ /* Even if we don't set windows_or_buffers_changed, do set `redisplay'
+ so that if we later set windows_or_buffers_changed, this buffer will
+ not be omitted. */
+ b->text->redisplay = true;
+ }
+}
+
+void
+bset_update_mode_line (struct buffer *b)
+{
+ if (!update_mode_lines)
+ update_mode_lines = REDISPLAY_SOME;
+ b->text->redisplay = true;
+}
+
#ifdef GLYPH_DEBUG
/* Non-zero means print traces of redisplay if compiled with
@@ -779,7 +837,7 @@ static int single_display_spec_string_p (Lisp_Object, Lisp_Object);
static int display_prop_string_p (Lisp_Object, Lisp_Object);
static int row_for_charpos_p (struct glyph_row *, ptrdiff_t);
static int cursor_row_p (struct glyph_row *);
-static int redisplay_mode_lines (Lisp_Object, int);
+static int redisplay_mode_lines (Lisp_Object, bool);
static char *decode_mode_spec_coding (Lisp_Object, char *, int);
static Lisp_Object get_it_property (struct it *it, Lisp_Object prop);
@@ -833,7 +891,7 @@ static void sync_frame_with_window_matrix_rows (struct window *);
static void redisplay_internal (void);
static int echo_area_display (int);
static void redisplay_windows (Lisp_Object);
-static void redisplay_window (Lisp_Object, int);
+static void redisplay_window (Lisp_Object, bool);
static Lisp_Object redisplay_window_error (Lisp_Object);
static Lisp_Object redisplay_window_0 (Lisp_Object);
static Lisp_Object redisplay_window_1 (Lisp_Object);
@@ -914,6 +972,7 @@ static int in_ellipses_for_invisible_text_p (struct display_pos *,
static void x_consider_frame_title (Lisp_Object);
static void update_tool_bar (struct frame *, int);
static int redisplay_tool_bar (struct frame *);
+static void x_draw_bottom_divider (struct window *w);
static void notice_overwritten_cursor (struct window *,
enum glyph_row_area,
int, int, int, int);
@@ -942,10 +1001,13 @@ static int coords_in_mouse_face_p (struct window *, int, int);
int
window_text_bottom_y (struct window *w)
{
- int height = WINDOW_TOTAL_HEIGHT (w);
+ int height = WINDOW_PIXEL_HEIGHT (w);
+
+ height -= WINDOW_BOTTOM_DIVIDER_WIDTH (w);
if (WINDOW_WANTS_MODELINE_P (w))
height -= CURRENT_MODE_LINE_HEIGHT (w);
+
return height;
}
@@ -956,32 +1018,23 @@ window_text_bottom_y (struct window *w)
int
window_box_width (struct window *w, enum glyph_row_area area)
{
- int cols = w->total_cols;
- int pixels = 0;
+ int pixels = w->pixel_width;
if (!w->pseudo_window_p)
{
- cols -= WINDOW_SCROLL_BAR_COLS (w);
+ pixels -= WINDOW_SCROLL_BAR_AREA_WIDTH (w);
+ pixels -= WINDOW_RIGHT_DIVIDER_WIDTH (w);
if (area == TEXT_AREA)
- {
- cols -= max (0, w->left_margin_cols);
- cols -= max (0, w->right_margin_cols);
- pixels = -WINDOW_TOTAL_FRINGE_WIDTH (w);
- }
+ pixels -= (WINDOW_MARGINS_WIDTH (w)
+ + WINDOW_FRINGES_WIDTH (w));
else if (area == LEFT_MARGIN_AREA)
- {
- cols = max (0, w->left_margin_cols);
- pixels = 0;
- }
+ pixels = WINDOW_LEFT_MARGIN_WIDTH (w);
else if (area == RIGHT_MARGIN_AREA)
- {
- cols = max (0, w->right_margin_cols);
- pixels = 0;
- }
+ pixels = WINDOW_RIGHT_MARGIN_WIDTH (w);
}
- return cols * WINDOW_FRAME_COLUMN_WIDTH (w) + pixels;
+ return pixels;
}
@@ -992,10 +1045,12 @@ int
window_box_height (struct window *w)
{
struct frame *f = XFRAME (w->frame);
- int height = WINDOW_TOTAL_HEIGHT (w);
+ int height = WINDOW_PIXEL_HEIGHT (w);
eassert (height >= 0);
+ height -= WINDOW_BOTTOM_DIVIDER_WIDTH (w);
+
/* Note: the code below that determines the mode-line/header-line
height is essentially the same as that contained in the macro
CURRENT_{MODE,HEADER}_LINE_HEIGHT, except that it checks whether
@@ -1373,7 +1428,7 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
if (top_y < window_top_y)
visible_p = bottom_y > window_top_y;
else if (top_y < it.last_visible_y)
- visible_p = 1;
+ visible_p = true;
if (bottom_y >= it.last_visible_y
&& it.bidi_p && it.bidi_it.scan_dir == -1
&& IT_CHARPOS (it) < charpos)
@@ -1611,7 +1666,7 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
if (charpos < IT_CHARPOS (it)
|| (it.what == IT_EOB && charpos == IT_CHARPOS (it)))
{
- visible_p = 1;
+ visible_p = true;
RESTORE_IT (&it2, &it2, it2data);
move_it_to (&it2, charpos, -1, -1, -1, MOVE_TO_POS);
*x = it2.current_x;
@@ -1854,6 +1909,7 @@ pixel_to_glyph_coords (struct frame *f, register int pix_x, register int pix_y,
FRAME_COLUMN_WIDTH (f) - 1,
FRAME_LINE_HEIGHT (f) - 1);
+ /* PXW: Should we clip pixels before converting to columns/lines? */
if (!noclip)
{
if (pix_x < 0)
@@ -1994,7 +2050,10 @@ get_glyph_string_clip_rects (struct glyph_string *s, NativeRectangle *rects, int
{
/* Draw full-width. X coordinates are relative to S->w->left_col. */
r.x = WINDOW_LEFT_EDGE_X (s->w);
- r.width = WINDOW_TOTAL_WIDTH (s->w);
+ if (s->row->mode_line_p)
+ r.width = WINDOW_PIXEL_WIDTH (s->w) - WINDOW_RIGHT_DIVIDER_WIDTH (s->w);
+ else
+ r.width = WINDOW_PIXEL_WIDTH (s->w);
/* Unless displaying a mode or menu bar line, which are always
fully visible, clip to the visible part of the row. */
@@ -2262,9 +2321,14 @@ remember_mouse_glyph (struct frame *f, int gx, int gy, NativeRectangle *rect)
/* Try to determine frame pixel position and size of the glyph under
frame pixel coordinates X/Y on frame F. */
- if (!f->glyphs_initialized_p
- || (window = window_from_coordinates (f, gx, gy, &part, 0),
- NILP (window)))
+ if (window_resize_pixelwise)
+ {
+ width = height = 1;
+ goto virtual_glyph;
+ }
+ else if (!f->glyphs_initialized_p
+ || (window = window_from_coordinates (f, gx, gy, &part, 0),
+ NILP (window)))
{
width = FRAME_SMALLEST_CHAR_WIDTH (f);
height = FRAME_SMALLEST_FONT_HEIGHT (f);
@@ -2751,6 +2815,7 @@ init_iterator (struct it *it, struct window *w,
&& ((!NILP (Vtruncate_partial_width_windows)
&& !INTEGERP (Vtruncate_partial_width_windows))
|| (INTEGERP (Vtruncate_partial_width_windows)
+ /* PXW: Shall we do something about this? */
&& (WINDOW_TOTAL_COLS (it->w)
< XINT (Vtruncate_partial_width_windows))))))
it->line_wrap = TRUNCATE;
@@ -2810,12 +2875,12 @@ init_iterator (struct it *it, struct window *w,
{
/* Mode lines, menu bar in terminal frames. */
it->first_visible_x = 0;
- it->last_visible_x = WINDOW_TOTAL_WIDTH (w);
+ it->last_visible_x = WINDOW_PIXEL_WIDTH (w);
}
else
{
- it->first_visible_x =
- window_hscroll_limited (it->w, it->f) * FRAME_COLUMN_WIDTH (it->f);
+ it->first_visible_x
+ = window_hscroll_limited (it->w, it->f) * FRAME_COLUMN_WIDTH (it->f);
it->last_visible_x = (it->first_visible_x
+ window_box_width (w, TEXT_AREA));
@@ -2857,7 +2922,7 @@ init_iterator (struct it *it, struct window *w,
with a left box line. */
face = FACE_FROM_ID (it->f, remapped_base_face_id);
if (face->box != FACE_NO_BOX)
- it->start_of_box_run_p = 1;
+ it->start_of_box_run_p = true;
}
/* If a buffer position was specified, set the iterator there,
@@ -3285,7 +3350,7 @@ handle_stop (struct it *it)
pop_it (it);
else
{
- it->ignore_overlay_strings_at_pos_p = 1;
+ it->ignore_overlay_strings_at_pos_p = true;
it->string_from_display_prop_p = 0;
it->from_disp_prop_p = 0;
handle_overlay_change_p = 0;
@@ -4150,13 +4215,13 @@ handle_invisible_prop (struct it *it)
prop = Fget_text_property (end_charpos, Qinvisible, it->string);
invis_p = TEXT_PROP_MEANS_INVISIBLE (prop);
if (invis_p == 2)
- display_ellipsis_p = 1;
+ display_ellipsis_p = true;
}
}
while (invis_p && endpos < len);
if (display_ellipsis_p)
- it->ellipsis_p = 1;
+ it->ellipsis_p = true;
if (endpos < len)
{
@@ -4268,9 +4333,9 @@ handle_invisible_prop (struct it *it)
tem = next_stop;
/* If there are adjacent invisible texts, don't lose the
- second one's ellipsis. */
+ second one's ellipsis. */
if (invis_p == 2)
- display_ellipsis_p = 1;
+ display_ellipsis_p = true;
}
while (invis_p);
@@ -4278,10 +4343,10 @@ handle_invisible_prop (struct it *it)
if (it->bidi_p)
{
ptrdiff_t bpos = CHAR_TO_BYTE (newpos);
- int on_newline =
- bpos == ZV_BYTE || FETCH_BYTE (bpos) == '\n';
- int after_newline =
- newpos <= BEGV || FETCH_BYTE (bpos - 1) == '\n';
+ int on_newline
+ = bpos == ZV_BYTE || FETCH_BYTE (bpos) == '\n';
+ int after_newline
+ = newpos <= BEGV || FETCH_BYTE (bpos - 1) == '\n';
/* If the invisible text ends on a newline or on a
character after a newline, we can avoid the costly,
@@ -4388,7 +4453,7 @@ handle_invisible_prop (struct it *it)
it->position.charpos = newpos - 1;
it->position.bytepos = CHAR_TO_BYTE (it->position.charpos);
}
- it->ellipsis_p = 1;
+ it->ellipsis_p = true;
/* Let the ellipsis display before
considering any properties of the following char.
Fixes jasonr@gnu.org 01 Oct 07 bug. */
@@ -4433,7 +4498,7 @@ setup_for_ellipsis (struct it *it, int len)
it->saved_face_id = it->face_id = DEFAULT_FACE_ID;
it->method = GET_FROM_DISPLAY_VECTOR;
- it->ellipsis_p = 1;
+ it->ellipsis_p = true;
}
@@ -4902,7 +4967,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
it->method = GET_FROM_IMAGE;
it->from_overlay = Qnil;
it->face_id = face_id;
- it->from_disp_prop_p = 1;
+ it->from_disp_prop_p = true;
/* Say that we haven't consumed the characters with
`display' property yet. The call to pop_it in
@@ -4984,7 +5049,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
when we are finished with the glyph property value. */
push_it (it, position);
it->from_overlay = overlay;
- it->from_disp_prop_p = 1;
+ it->from_disp_prop_p = true;
if (NILP (location))
it->area = TEXT_AREA;
@@ -5004,7 +5069,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
it->stop_charpos = 0;
it->prev_stop = 0;
it->base_level_stop = 0;
- it->string_from_display_prop_p = 1;
+ it->string_from_display_prop_p = true;
/* Say that we haven't consumed the characters with
`display' property yet. The call to pop_it in
set_iterator_to_next will clean this up. */
@@ -5370,7 +5435,7 @@ next_overlay_string (struct it *it)
processed the overlay strings there already, so that
next_element_from_buffer doesn't try it again. */
if (NILP (it->string) && IT_CHARPOS (*it) >= it->end_charpos)
- it->overlay_strings_at_end_processed_p = 1;
+ it->overlay_strings_at_end_processed_p = true;
}
else
{
@@ -6053,7 +6118,7 @@ forward_to_next_line_start (struct it *it, int *skipped_p,
if (bidi_it_prev)
*bidi_it_prev = bprev;
}
- *skipped_p = newline_found_p = 1;
+ *skipped_p = newline_found_p = true;
}
else
{
@@ -6743,9 +6808,9 @@ get_next_display_element (struct it *it)
if (! ASCII_CHAR_P (c) && ! NILP (Vnobreak_char_display))
{
if (c == 0xA0)
- nonascii_space_p = 1;
+ nonascii_space_p = true;
else if (c == 0xAD || c == 0x2010 || c == 0x2011)
- nonascii_hyphen_p = 1;
+ nonascii_hyphen_p = true;
}
/* Translate control characters into `\003' or `^C' form.
@@ -7204,12 +7269,12 @@ set_iterator_to_next (struct it *it, int reseat_p)
if (it->method == GET_FROM_STRING
&& it->current.overlay_string_index >= 0
&& it->n_overlay_strings > 0)
- it->ignore_overlay_strings_at_pos_p = 1;
+ it->ignore_overlay_strings_at_pos_p = true;
it->len = it->dpvec_char_len;
set_iterator_to_next (it, reseat_p);
}
- /* Maybe recheck faces after display vector */
+ /* Maybe recheck faces after display vector. */
if (recheck_faces)
it->stop_charpos = IT_CHARPOS (*it);
}
@@ -7234,7 +7299,7 @@ set_iterator_to_next (struct it *it, int reseat_p)
else
{
/* Not an overlay string. There could be padding, so test
- against it->end_charpos . */
+ against it->end_charpos. */
if (IT_STRING_CHARPOS (*it) >= it->end_charpos)
goto consider_string_end;
}
@@ -7746,7 +7811,7 @@ next_element_from_string (struct it *it)
static int
next_element_from_c_string (struct it *it)
{
- int success_p = 1;
+ bool success_p = true;
eassert (it->s);
eassert (!it->bidi_p || it->s == it->bidi_it.string.s);
@@ -7805,7 +7870,7 @@ next_element_from_ellipsis (struct it *it)
it->method = GET_FROM_BUFFER;
it->object = it->w->contents;
reseat_at_next_visible_line_start (it, 1);
- it->face_before_selective_p = 1;
+ it->face_before_selective_p = true;
}
return GET_NEXT_DISPLAY_ELEMENT (it);
@@ -7874,7 +7939,7 @@ compute_stop_pos_backwards (struct it *it)
it->prev_stop = it->stop_charpos;
else
it->prev_stop = BEGV;
- it->bidi_p = 1;
+ it->bidi_p = true;
it->current = save_current;
it->position = save_position;
it->stop_charpos = save_stop_pos;
@@ -7920,7 +7985,7 @@ handle_stop_backwards (struct it *it, ptrdiff_t charpos)
}
while (charpos <= where_we_are);
- it->bidi_p = 1;
+ it->bidi_p = true;
it->current = save_current;
it->position = save_position;
next_stop = it->stop_charpos;
@@ -7937,7 +8002,7 @@ handle_stop_backwards (struct it *it, ptrdiff_t charpos)
static int
next_element_from_buffer (struct it *it)
{
- int success_p = 1;
+ bool success_p = true;
eassert (IT_CHARPOS (*it) >= BEGV);
eassert (NILP (it->string) && !it->s);
@@ -7967,7 +8032,7 @@ next_element_from_buffer (struct it *it)
overlay_strings_follow_p = 0;
else
{
- it->overlay_strings_at_end_processed_p = 1;
+ it->overlay_strings_at_end_processed_p = true;
overlay_strings_follow_p = get_overlay_strings (it, 0);
}
@@ -8787,13 +8852,17 @@ move_it_in_display_line (struct it *it,
If TO_CHARPOS is in invisible text, e.g. a truncated part of a
screen line, this function will set IT to the next position that is
- displayed to the right of TO_CHARPOS on the screen. */
+ displayed to the right of TO_CHARPOS on the screen.
-void
+ Return the maximum pixel length of any line scanned but never more
+ than it.last_visible_x. */
+
+int
move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos, int op)
{
enum move_it_result skip, skip2 = MOVE_X_REACHED;
int line_height, line_start_x = 0, reached = 0;
+ int max_current_x = 0;
void *backup_data = NULL;
for (;;)
@@ -8924,6 +8993,9 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos
if (to_y >= it->current_y
&& to_y < it->current_y + line_height)
{
+ if (to_y > it->current_y)
+ max_current_x = max (it->current_x, max_current_x);
+
/* When word-wrap is on, TO_X may lie past the end
of a wrapped line. Then it->current is the
character on the next line, so backtrack to the
@@ -8936,12 +9008,16 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos
skip = move_it_in_display_line_to
(it, -1, prev_x, MOVE_TO_X);
}
+
reached = 6;
}
}
if (reached)
- break;
+ {
+ max_current_x = max (it->current_x, max_current_x);
+ break;
+ }
}
else if (BUFFERP (it->object)
&& (it->method == GET_FROM_BUFFER
@@ -8961,15 +9037,18 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos
switch (skip)
{
case MOVE_POS_MATCH_OR_ZV:
+ max_current_x = max (it->current_x, max_current_x);
reached = 8;
goto out;
case MOVE_NEWLINE_OR_CR:
+ max_current_x = max (it->current_x, max_current_x);
set_iterator_to_next (it, 1);
it->continuation_lines_width = 0;
break;
case MOVE_LINE_TRUNCATED:
+ max_current_x = it->last_visible_x;
it->continuation_lines_width = 0;
reseat_at_next_visible_line_start (it, 0);
if ((op & MOVE_TO_POS) != 0
@@ -8981,6 +9060,7 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos
break;
case MOVE_LINE_CONTINUED:
+ max_current_x = it->last_visible_x;
/* For continued lines ending in a tab, some of the glyphs
associated with the tab are displayed on the current
line. Since it->current_x does not include these glyphs,
@@ -9016,6 +9096,7 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos
it->current_y += it->max_ascent + it->max_descent;
++it->vpos;
last_height = it->max_ascent + it->max_descent;
+ last_max_ascent = it->max_ascent;
it->max_ascent = it->max_descent = 0;
}
@@ -9042,12 +9123,15 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos
it->current_y += it->max_ascent + it->max_descent;
++it->vpos;
last_height = it->max_ascent + it->max_descent;
+ last_max_ascent = it->max_ascent;
}
if (backup_data)
bidi_unshelve_cache (backup_data, 1);
TRACE_MOVE ((stderr, "move_it_to: reached %d\n", reached));
+
+ return max_current_x;
}
@@ -9395,6 +9479,145 @@ in_display_vector_p (struct it *it)
&& it->dpvec + it->current.dpvec_index != it->dpend);
}
+DEFUN ("window-text-pixel-size", Fwindow_text_pixel_size, Swindow_text_pixel_size, 0, 6, 0,
+ doc: /* Return the size of the text of WINDOW's buffer in pixels.
+WINDOW must be a live window and defaults to the selected one. The
+return value is a cons of the maximum pixel-width of any text line and
+the maximum pixel-height of all text lines.
+
+The optional argument FROM, if non-nil, specifies the first text
+position and defaults to the minimum accessible position of the buffer.
+If FROM is t, use the minimum accessible position that is not a newline
+character. TO, if non-nil, specifies the last text position and
+defaults to the maximum accessible position of the buffer. If TO is t,
+use the maximum accessible position that is not a newline character.
+
+The optional argument X_LIMIT, if non-nil, specifies the maximum text
+width that can be returned. X_LIMIT nil or omitted, means to use the
+pixel-width of WINDOW's body; use this if you do not intend to change
+the width of WINDOW. Use the maximum width WINDOW may assume if you
+intend to change WINDOW's width.
+
+The optional argument Y_LIMIT, if non-nil, specifies the maximum text
+height that can be returned. Text lines whose y-coordinate is beyond
+Y_LIMIT are ignored. Since calculating the text height of a large
+buffer can take some time, it makes sense to specify this argument if
+the size of the buffer is unknown.
+
+Optional argument MODE_AND_HEADER_LINE nil or omitted means do not
+include the height of the mode- or header-line of WINDOW in the return
+value. If it is either the symbol `mode-line' or `header-line', include
+only the height of that line, if present, in the return value. If t,
+include the height of any of these lines in the return value. */)
+ (Lisp_Object window, Lisp_Object from, Lisp_Object to, Lisp_Object x_limit, Lisp_Object y_limit,
+ Lisp_Object mode_and_header_line)
+{
+ struct window *w = decode_live_window (window);
+ Lisp_Object buf;
+ struct buffer *b;
+ struct it it;
+ struct buffer *old_buffer = NULL;
+ ptrdiff_t start, end, pos;
+ struct text_pos startp;
+ void *itdata = NULL;
+ int c, max_y = -1, x = 0, y = 0;
+
+ buf = w->contents;
+ CHECK_BUFFER (buf);
+ b = XBUFFER (buf);
+
+ if (b != current_buffer)
+ {
+ old_buffer = current_buffer;
+ set_buffer_internal (b);
+ }
+
+ if (NILP (from))
+ start = BEGV;
+ else if (EQ (from, Qt))
+ {
+ start = pos = BEGV;
+ while ((pos++ < ZV) && (c = FETCH_CHAR (pos))
+ && (c == ' ' || c == '\t' || c == '\n' || c == '\r'))
+ start = pos;
+ while ((pos-- > BEGV) && (c = FETCH_CHAR (pos)) && (c == ' ' || c == '\t'))
+ start = pos;
+ }
+ else
+ {
+ CHECK_NUMBER_COERCE_MARKER (from);
+ start = min (max (XINT (from), BEGV), ZV);
+ }
+
+ if (NILP (to))
+ end = ZV;
+ else if (EQ (to, Qt))
+ {
+ end = pos = ZV;
+ while ((pos-- > BEGV) && (c = FETCH_CHAR (pos))
+ && (c == ' ' || c == '\t' || c == '\n' || c == '\r'))
+ end = pos;
+ while ((pos++ < ZV) && (c = FETCH_CHAR (pos)) && (c == ' ' || c == '\t'))
+ end = pos;
+ }
+ else
+ {
+ CHECK_NUMBER_COERCE_MARKER (to);
+ end = max (start, min (XINT (to), ZV));
+ }
+
+ if (!NILP (y_limit))
+ {
+ CHECK_NUMBER (y_limit);
+ max_y = min (XINT (y_limit), INT_MAX);
+ }
+
+ itdata = bidi_shelve_cache ();
+ SET_TEXT_POS (startp, start, CHAR_TO_BYTE (start));
+ start_display (&it, w, startp);
+
+ /** move_it_vertically_backward (&it, 0); **/
+ if (NILP (x_limit))
+ x = move_it_to (&it, end, -1, max_y, -1, MOVE_TO_POS | MOVE_TO_Y);
+ else
+ {
+ CHECK_NUMBER (x_limit);
+ it.last_visible_x = min (XINT (x_limit), INFINITY);
+ /* Actually, we never want move_it_to stop at to_x. But to make
+ sure that move_it_in_display_line_to always moves far enough,
+ we set it to INT_MAX and specify MOVE_TO_X. */
+ x = move_it_to (&it, end, INT_MAX, max_y, -1,
+ MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
+ }
+
+ if (start == end)
+ y = it.current_y;
+ else
+ {
+ /* Count last line. */
+ last_height = 0;
+ y = line_bottom_y (&it); /* - y; */
+ }
+
+ if (!EQ (mode_and_header_line, Qheader_line)
+ && !EQ (mode_and_header_line, Qt))
+ /* Do not count the header-line which was counted automatically by
+ start_display. */
+ y = y - WINDOW_HEADER_LINE_HEIGHT (w);
+
+ if (EQ (mode_and_header_line, Qmode_line)
+ || EQ (mode_and_header_line, Qt))
+ /* Do count the mode-line which is not included automatically by
+ start_display. */
+ y = y + WINDOW_MODE_LINE_HEIGHT (w);
+
+ bidi_unshelve_cache (itdata, 0);
+
+ if (old_buffer)
+ set_buffer_internal (old_buffer);
+
+ return Fcons (make_number (x), make_number (y));
+}
/***********************************************************************
Messages
@@ -9468,7 +9691,6 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte)
ptrdiff_t point_at_end = 0;
ptrdiff_t zv_at_end = 0;
Lisp_Object old_deactivate_mark;
- bool shown;
struct gcpro gcpro1;
old_deactivate_mark = Vdeactivate_mark;
@@ -9482,8 +9704,8 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte)
Fset_buffer (Fget_buffer_create (Vmessages_buffer_name));
- if (newbuffer &&
- !NILP (Ffboundp (intern ("messages-buffer-mode"))))
+ if (newbuffer
+ && !NILP (Ffboundp (intern ("messages-buffer-mode"))))
call0 (intern ("messages-buffer-mode"));
}
@@ -9625,18 +9847,17 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte)
unchain_marker (XMARKER (oldbegv));
unchain_marker (XMARKER (oldzv));
- shown = buffer_window_count (current_buffer) > 0;
- set_buffer_internal (oldbuf);
/* We called insert_1_both above with its 5th argument (PREPARE)
zero, which prevents insert_1_both from calling
prepare_to_modify_buffer, which in turns prevents us from
incrementing windows_or_buffers_changed even if *Messages* is
- shown in some window. So we must manually incrementing
+ shown in some window. So we must manually set
windows_or_buffers_changed here to make up for that. */
- if (shown)
- windows_or_buffers_changed = 41;
- else
windows_or_buffers_changed = old_windows_or_buffers_changed;
+ bset_redisplay (current_buffer);
+
+ set_buffer_internal (oldbuf);
+
message_log_need_newline = !nlflag;
Vdeactivate_mark = old_deactivate_mark;
}
@@ -9692,7 +9913,7 @@ message3 (Lisp_Object m)
struct gcpro gcpro1;
GCPRO1 (m);
- clear_message (1,1);
+ clear_message (true, true);
cancel_echoing ();
/* First flush out any partial line written with print. */
@@ -9762,7 +9983,7 @@ message3_nolog (Lisp_Object m)
echo_message_buffer = Qnil;
}
else
- clear_message (1, 1);
+ clear_message (true, true);
do_pending_window_change (0);
echo_area_display (1);
@@ -10035,7 +10256,7 @@ with_echo_area_buffer (struct window *w, int which,
else
{
this_one = 0, the_other = 1;
- clear_buffer_p = 1;
+ clear_buffer_p = true;
/* We need a fresh one in case the current echo buffer equals
the one containing the last displayed echo area message. */
@@ -10052,7 +10273,7 @@ with_echo_area_buffer (struct window *w, int which,
= (EQ (echo_area_buffer[the_other], echo_buffer[this_one])
? echo_buffer[the_other]
: echo_buffer[this_one]);
- clear_buffer_p = 1;
+ clear_buffer_p = true;
}
buffer = echo_area_buffer[this_one];
@@ -10325,15 +10546,8 @@ resize_echo_area_exactly (void)
&& WINDOWP (echo_area_window))
{
struct window *w = XWINDOW (echo_area_window);
- int resized_p;
- Lisp_Object resize_exactly;
-
- if (minibuf_level == 0)
- resize_exactly = Qt;
- else
- resize_exactly = Qnil;
-
- resized_p = with_echo_area_buffer (w, 0, resize_mini_window_1,
+ Lisp_Object resize_exactly = (minibuf_level == 0 ? Qt : Qnil);
+ int resized_p = with_echo_area_buffer (w, 0, resize_mini_window_1,
(intptr_t) w, resize_exactly);
if (resized_p)
{
@@ -10400,11 +10614,10 @@ resize_mini_window (struct window *w, int exact_p)
if (!FRAME_MINIBUF_ONLY_P (f))
{
struct it it;
- struct window *root = XWINDOW (FRAME_ROOT_WINDOW (f));
- int total_height = WINDOW_TOTAL_LINES (root) + WINDOW_TOTAL_LINES (w);
- int height;
- EMACS_INT max_height;
+ int total_height = (WINDOW_PIXEL_HEIGHT (XWINDOW (FRAME_ROOT_WINDOW (f)))
+ + WINDOW_PIXEL_HEIGHT (w));
int unit = FRAME_LINE_HEIGHT (f);
+ int height, max_height;
struct text_pos start;
struct buffer *old_current_buffer = NULL;
@@ -10418,18 +10631,18 @@ resize_mini_window (struct window *w, int exact_p)
/* Compute the max. number of lines specified by the user. */
if (FLOATP (Vmax_mini_window_height))
- max_height = XFLOATINT (Vmax_mini_window_height) * FRAME_LINES (f);
+ max_height = XFLOATINT (Vmax_mini_window_height) * total_height;
else if (INTEGERP (Vmax_mini_window_height))
- max_height = XINT (Vmax_mini_window_height);
+ max_height = XINT (Vmax_mini_window_height) * unit;
else
max_height = total_height / 4;
/* Correct that max. height if it's bogus. */
- max_height = clip_to_bounds (1, max_height, total_height);
+ max_height = clip_to_bounds (unit, max_height, total_height);
/* Find out the height of the text in the window. */
if (it.line_wrap == TRUNCATE)
- height = 1;
+ height = unit;
else
{
last_height = 0;
@@ -10439,7 +10652,6 @@ resize_mini_window (struct window *w, int exact_p)
else
height = it.current_y + it.max_ascent + it.max_descent;
height -= min (it.extra_line_spacing, it.max_extra_line_spacing);
- height = (height + unit - 1) / unit;
}
/* Compute a suitable window start. */
@@ -10447,7 +10659,7 @@ resize_mini_window (struct window *w, int exact_p)
{
height = max_height;
init_iterator (&it, w, ZV, ZV_BYTE, NULL, DEFAULT_FACE_ID);
- move_it_vertically_backward (&it, (height - 1) * unit);
+ move_it_vertically_backward (&it, height);
start = it.current.pos;
}
else
@@ -10458,49 +10670,49 @@ resize_mini_window (struct window *w, int exact_p)
{
/* Let it grow only, until we display an empty message, in which
case the window shrinks again. */
- if (height > WINDOW_TOTAL_LINES (w))
+ if (height > WINDOW_PIXEL_HEIGHT (w))
{
- int old_height = WINDOW_TOTAL_LINES (w);
+ int old_height = WINDOW_PIXEL_HEIGHT (w);
FRAME_WINDOWS_FROZEN (f) = 1;
- grow_mini_window (w, height - WINDOW_TOTAL_LINES (w));
- window_height_changed_p = WINDOW_TOTAL_LINES (w) != old_height;
+ grow_mini_window (w, height - WINDOW_PIXEL_HEIGHT (w), 1);
+ window_height_changed_p = WINDOW_PIXEL_HEIGHT (w) != old_height;
}
- else if (height < WINDOW_TOTAL_LINES (w)
+ else if (height < WINDOW_PIXEL_HEIGHT (w)
&& (exact_p || BEGV == ZV))
{
- int old_height = WINDOW_TOTAL_LINES (w);
+ int old_height = WINDOW_PIXEL_HEIGHT (w);
FRAME_WINDOWS_FROZEN (f) = 0;
- shrink_mini_window (w);
- window_height_changed_p = WINDOW_TOTAL_LINES (w) != old_height;
+ shrink_mini_window (w, 1);
+ window_height_changed_p = WINDOW_PIXEL_HEIGHT (w) != old_height;
}
}
else
{
/* Always resize to exact size needed. */
- if (height > WINDOW_TOTAL_LINES (w))
+ if (height > WINDOW_PIXEL_HEIGHT (w))
{
- int old_height = WINDOW_TOTAL_LINES (w);
+ int old_height = WINDOW_PIXEL_HEIGHT (w);
FRAME_WINDOWS_FROZEN (f) = 1;
- grow_mini_window (w, height - WINDOW_TOTAL_LINES (w));
- window_height_changed_p = WINDOW_TOTAL_LINES (w) != old_height;
+ grow_mini_window (w, height - WINDOW_PIXEL_HEIGHT (w), 1);
+ window_height_changed_p = WINDOW_PIXEL_HEIGHT (w) != old_height;
}
- else if (height < WINDOW_TOTAL_LINES (w))
+ else if (height < WINDOW_PIXEL_HEIGHT (w))
{
- int old_height = WINDOW_TOTAL_LINES (w);
+ int old_height = WINDOW_PIXEL_HEIGHT (w);
FRAME_WINDOWS_FROZEN (f) = 0;
- shrink_mini_window (w);
+ shrink_mini_window (w, 1);
if (height)
{
FRAME_WINDOWS_FROZEN (f) = 1;
- grow_mini_window (w, height - WINDOW_TOTAL_LINES (w));
+ grow_mini_window (w, height - WINDOW_PIXEL_HEIGHT (w), 1);
}
- window_height_changed_p = WINDOW_TOTAL_LINES (w) != old_height;
+ window_height_changed_p = WINDOW_PIXEL_HEIGHT (w) != old_height;
}
}
@@ -10685,12 +10897,12 @@ set_message_1 (ptrdiff_t a1, Lisp_Object string)
last displayed. */
void
-clear_message (int current_p, int last_displayed_p)
+clear_message (bool current_p, bool last_displayed_p)
{
if (current_p)
{
echo_area_buffer[0] = Qnil;
- message_cleared_p = 1;
+ message_cleared_p = true;
}
if (last_displayed_p)
@@ -10714,7 +10926,6 @@ clear_garbaged_frames (void)
if (frame_garbaged)
{
Lisp_Object tail, frame;
- int changed_count = 0;
FOR_EACH_FRAME (tail, frame)
{
@@ -10726,15 +10937,13 @@ clear_garbaged_frames (void)
redraw_frame (f);
else
clear_current_matrices (f);
- changed_count++;
- f->garbaged = 0;
- f->resized_p = 0;
+ fset_redisplay (f);
+ f->garbaged = false;
+ f->resized_p = false;
}
}
- frame_garbaged = 0;
- if (changed_count)
- windows_or_buffers_changed = 43;
+ frame_garbaged = false;
}
}
@@ -10775,7 +10984,7 @@ echo_area_display (int update_frame_p)
{
echo_area_window = mini_window;
window_height_changed_p = display_echo_area (w);
- w->must_be_updated_p = 1;
+ w->must_be_updated_p = true;
/* Update the display, unless called from redisplay_internal.
Also don't update the screen during redisplay itself. The
@@ -10791,7 +11000,7 @@ echo_area_display (int update_frame_p)
been called, so that mode lines above the echo area are
garbaged. This looks odd, so we prevent it here. */
if (!display_completed)
- n = redisplay_mode_lines (FRAME_ROOT_WINDOW (f), 0);
+ n = redisplay_mode_lines (FRAME_ROOT_WINDOW (f), false);
if (window_height_changed_p
/* Don't do this if Emacs is shutting down. Redisplay
@@ -10822,11 +11031,11 @@ echo_area_display (int update_frame_p)
redisplay displays the minibuffer, so that the cursor will
be replaced with what the minibuffer wants. */
if (cursor_in_echo_area)
- windows_or_buffers_changed = 45;
+ wset_redisplay (XWINDOW (mini_window));
}
}
else if (!EQ (mini_window, selected_window))
- windows_or_buffers_changed = 46;
+ wset_redisplay (XWINDOW (mini_window));
/* Last displayed message is now the current message. */
echo_area_buffer[1] = echo_area_buffer[0];
@@ -10842,16 +11051,6 @@ echo_area_display (int update_frame_p)
return window_height_changed_p;
}
-/* Nonzero if the current window's buffer is shown in more than one
- window and was modified since last redisplay. */
-
-static int
-buffer_shared_and_changed (void)
-{
- return (buffer_window_count (current_buffer) > 1
- && UNCHANGED_MODIFIED < MODIFF);
-}
-
/* Nonzero if W's buffer was changed but not saved. */
static int
@@ -11164,6 +11363,12 @@ x_consider_frame_title (Lisp_Object frame)
Menu Bars
***********************************************************************/
+/* Non-zero if we will not redisplay all visible windows. */
+#define REDISPLAY_SOME_P() \
+ ((windows_or_buffers_changed == 0 \
+ || windows_or_buffers_changed == REDISPLAY_SOME) \
+ && (update_mode_lines == 0 \
+ || update_mode_lines == REDISPLAY_SOME))
/* Prepare for redisplay by updating menu-bar item lists when
appropriate. This can call eval. */
@@ -11171,9 +11376,9 @@ x_consider_frame_title (Lisp_Object frame)
static void
prepare_menu_bars (void)
{
- int all_windows;
+ bool all_windows = windows_or_buffers_changed || update_mode_lines;
+ bool some_windows = REDISPLAY_SOME_P ();
struct gcpro gcpro1, gcpro2;
- struct frame *f;
Lisp_Object tooltip_frame;
#ifdef HAVE_WINDOW_SYSTEM
@@ -11182,17 +11387,45 @@ prepare_menu_bars (void)
tooltip_frame = Qnil;
#endif
+ if (FUNCTIONP (Vpre_redisplay_function))
+ {
+ Lisp_Object windows = all_windows ? Qt : Qnil;
+ if (all_windows && some_windows)
+ {
+ Lisp_Object ws = window_list ();
+ for (windows = Qnil; CONSP (ws); ws = XCDR (ws))
+ {
+ Lisp_Object this = XCAR (ws);
+ struct window *w = XWINDOW (this);
+ if (w->redisplay
+ || XFRAME (w->frame)->redisplay
+ || XBUFFER (w->contents)->text->redisplay)
+ {
+ windows = Fcons (this, windows);
+ }
+ }
+ }
+ safe_call1 (Vpre_redisplay_function, windows);
+ }
+
/* Update all frame titles based on their buffer names, etc. We do
this before the menu bars so that the buffer-menu will show the
up-to-date frame titles. */
#ifdef HAVE_WINDOW_SYSTEM
- if (windows_or_buffers_changed || update_mode_lines)
+ if (all_windows)
{
Lisp_Object tail, frame;
FOR_EACH_FRAME (tail, frame)
{
- f = XFRAME (frame);
+ struct frame *f = XFRAME (frame);
+ struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f));
+ if (some_windows
+ && !f->redisplay
+ && !w->redisplay
+ && !XBUFFER (w->contents)->text->redisplay)
+ continue;
+
if (!EQ (frame, tooltip_frame)
&& (FRAME_ICONIFIED_P (f)
|| FRAME_VISIBLE_P (f) == 1
@@ -11213,12 +11446,6 @@ prepare_menu_bars (void)
/* Update the menu bar item lists, if appropriate. This has to be
done before any actual redisplay or generation of display lines. */
- all_windows = (update_mode_lines
- || buffer_shared_and_changed ()
- || windows_or_buffers_changed);
-
- if (FUNCTIONP (Vpre_redisplay_function))
- safe_call1 (Vpre_redisplay_function, all_windows ? Qt : Qnil);
if (all_windows)
{
@@ -11232,12 +11459,19 @@ prepare_menu_bars (void)
FOR_EACH_FRAME (tail, frame)
{
- f = XFRAME (frame);
+ struct frame *f = XFRAME (frame);
+ struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f));
/* Ignore tooltip frame. */
if (EQ (frame, tooltip_frame))
continue;
+ if (some_windows
+ && !f->redisplay
+ && !w->redisplay
+ && !XBUFFER (w->contents)->text->redisplay)
+ continue;
+
/* If a window on this frame changed size, report that to
the user and clear the size-change flag. */
if (FRAME_WINDOW_SIZES_CHANGED (f))
@@ -11432,8 +11666,8 @@ update_tool_bar (struct frame *f, int save_match_data)
#if defined (USE_GTK) || defined (HAVE_NS)
int do_update = FRAME_EXTERNAL_TOOL_BAR (f);
#else
- int do_update = WINDOWP (f->tool_bar_window)
- && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window)) > 0;
+ int do_update = (WINDOWP (f->tool_bar_window)
+ && WINDOW_PIXEL_HEIGHT (XWINDOW (f->tool_bar_window)) > 0);
#endif
if (do_update)
@@ -11815,7 +12049,8 @@ display_tool_bar_line (struct it *it, int height)
}
-/* Max tool-bar height. */
+/* Max tool-bar height. Basically, this is what makes all other windows
+ disappear when the frame gets too small. Rethink this! */
#define MAX_FRAME_TOOL_BAR_HEIGHT(f) \
((FRAME_LINE_HEIGHT (f) * FRAME_LINES (f)))
@@ -11825,11 +12060,11 @@ display_tool_bar_line (struct it *it, int height)
returned in *N_ROWS if non-NULL. */
static int
-tool_bar_lines_needed (struct frame *f, int *n_rows)
+tool_bar_height (struct frame *f, int *n_rows, bool pixelwise)
{
struct window *w = XWINDOW (f->tool_bar_window);
struct it it;
- /* tool_bar_lines_needed is called from redisplay_tool_bar after building
+ /* tool_bar_height is called from redisplay_tool_bar after building
the desired matrix, so use (unused) mode-line row as temporary row to
avoid destroying the first tool-bar row. */
struct glyph_row *temp_row = MATRIX_MODE_LINE_ROW (w->desired_matrix);
@@ -11838,6 +12073,7 @@ tool_bar_lines_needed (struct frame *f, int *n_rows)
F->desired_tool_bar_string in the tool-bar window of frame F. */
init_iterator (&it, w, -1, -1, temp_row, TOOL_BAR_FACE_ID);
it.first_visible_x = 0;
+ /* PXW: Use FRAME_PIXEL_WIDTH (f) here? */
it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f);
reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1);
it.paragraph_embedding = L2R;
@@ -11854,39 +12090,44 @@ tool_bar_lines_needed (struct frame *f, int *n_rows)
if (n_rows)
*n_rows = it.vpos > 0 ? it.vpos : -1;
- return (it.current_y + FRAME_LINE_HEIGHT (f) - 1) / FRAME_LINE_HEIGHT (f);
+ if (pixelwise)
+ return it.current_y;
+ else
+ return (it.current_y + FRAME_LINE_HEIGHT (f) - 1) / FRAME_LINE_HEIGHT (f);
}
#endif /* !USE_GTK && !HAVE_NS */
#if defined USE_GTK || defined HAVE_NS
+EXFUN (Ftool_bar_height, 2) ATTRIBUTE_CONST;
EXFUN (Ftool_bar_lines_needed, 1) ATTRIBUTE_CONST;
#endif
-DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed,
- 0, 1, 0,
+DEFUN ("tool-bar-height", Ftool_bar_height, Stool_bar_height,
+ 0, 2, 0,
doc: /* Return the number of lines occupied by the tool bar of FRAME.
-If FRAME is nil or omitted, use the selected frame. */)
- (Lisp_Object frame)
+If FRAME is nil or omitted, use the selected frame. Optional argument
+PIXELWISE non-nil means return the height of the tool bar inpixels. */)
+ (Lisp_Object frame, Lisp_Object pixelwise)
{
- int nlines = 0;
+ int height = 0;
+
#if ! defined (USE_GTK) && ! defined (HAVE_NS)
struct frame *f = decode_any_frame (frame);
- struct window *w;
if (WINDOWP (f->tool_bar_window)
- && (w = XWINDOW (f->tool_bar_window),
- WINDOW_TOTAL_LINES (w) > 0))
+ && WINDOW_PIXEL_HEIGHT (XWINDOW (f->tool_bar_window)) > 0)
{
update_tool_bar (f, 1);
if (f->n_tool_bar_items)
{
build_desired_tool_bar_string (f);
- nlines = tool_bar_lines_needed (f, NULL);
+ height = tool_bar_height (f, NULL, NILP (pixelwise) ? 0 : 1);
}
}
#endif
- return make_number (nlines);
+
+ return make_number (height);
}
@@ -11914,13 +12155,13 @@ redisplay_tool_bar (struct frame *f)
can turn off tool-bars by specifying tool-bar-lines zero. */
if (!WINDOWP (f->tool_bar_window)
|| (w = XWINDOW (f->tool_bar_window),
- WINDOW_TOTAL_LINES (w) == 0))
+ WINDOW_PIXEL_HEIGHT (w) == 0))
return 0;
/* Set up an iterator for the tool-bar window. */
init_iterator (&it, w, -1, -1, w->desired_matrix->rows, TOOL_BAR_FACE_ID);
it.first_visible_x = 0;
- it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f);
+ it.last_visible_x = WINDOW_PIXEL_WIDTH (w);
row = it.glyph_row;
/* Build a string that represents the contents of the tool-bar. */
@@ -11937,24 +12178,22 @@ redisplay_tool_bar (struct frame *f)
if (f->n_tool_bar_rows == 0)
{
- int nlines;
+ int new_height = tool_bar_height (f, &f->n_tool_bar_rows, 1);
- if ((nlines = tool_bar_lines_needed (f, &f->n_tool_bar_rows),
- nlines != WINDOW_TOTAL_LINES (w)))
+ if (new_height != WINDOW_PIXEL_HEIGHT (w))
{
Lisp_Object frame;
- int old_height = WINDOW_TOTAL_LINES (w);
+ int new_lines = ((new_height + FRAME_LINE_HEIGHT (f) - 1)
+ / FRAME_LINE_HEIGHT (f));
XSETFRAME (frame, f);
Fmodify_frame_parameters (frame,
list1 (Fcons (Qtool_bar_lines,
- make_number (nlines))));
- if (WINDOW_TOTAL_LINES (w) != old_height)
- {
- clear_glyph_matrix (w->desired_matrix);
- f->fonts_changed = 1;
- return 1;
- }
+ make_number (new_lines))));
+ /* Always do that now. */
+ clear_glyph_matrix (w->desired_matrix);
+ f->fonts_changed = 1;
+ return 1;
}
}
@@ -12003,6 +12242,7 @@ redisplay_tool_bar (struct frame *f)
if (!NILP (Vauto_resize_tool_bars))
{
+ /* Do we really allow the toolbar to occupy the whole frame? */
int max_tool_bar_height = MAX_FRAME_TOOL_BAR_HEIGHT (f);
int change_height_p = 0;
@@ -12033,29 +12273,29 @@ redisplay_tool_bar (struct frame *f)
if (change_height_p)
{
Lisp_Object frame;
- int old_height = WINDOW_TOTAL_LINES (w);
int nrows;
- int nlines = tool_bar_lines_needed (f, &nrows);
+ int new_height = tool_bar_height (f, &nrows, 1);
change_height_p = ((EQ (Vauto_resize_tool_bars, Qgrow_only)
&& !f->minimize_tool_bar_window_p)
- ? (nlines > old_height)
- : (nlines != old_height));
+ ? (new_height > WINDOW_PIXEL_HEIGHT (w))
+ : (new_height != WINDOW_PIXEL_HEIGHT (w)));
f->minimize_tool_bar_window_p = 0;
if (change_height_p)
{
+ int new_lines = ((new_height + FRAME_LINE_HEIGHT (f) - 1)
+ / FRAME_LINE_HEIGHT (f));
+
XSETFRAME (frame, f);
Fmodify_frame_parameters (frame,
list1 (Fcons (Qtool_bar_lines,
- make_number (nlines))));
- if (WINDOW_TOTAL_LINES (w) != old_height)
- {
- clear_glyph_matrix (w->desired_matrix);
- f->n_tool_bar_rows = nrows;
- f->fonts_changed = 1;
- return 1;
- }
+ make_number (new_lines))));
+ /* Always do that now. */
+ clear_glyph_matrix (w->desired_matrix);
+ f->n_tool_bar_rows = nrows;
+ f->fonts_changed = 1;
+ return 1;
}
}
}
@@ -12384,7 +12624,7 @@ hscroll_window_tree (Lisp_Object window)
/* For left-to-right rows, hscroll when cursor is either
(i) inside the right hscroll margin, or (ii) if it is
inside the left margin and the window is already
- hscrolled. */
+ hscrolled. */
&& ((!row_r2l_p
&& ((w->hscroll
&& w->cursor.x <= h_margin)
@@ -12401,7 +12641,7 @@ hscroll_window_tree (Lisp_Object window)
&& ((cursor_row->enabled_p
/* FIXME: It is confusing to set the
truncated_on_right_p flag when R2L rows
- are actually truncated on the left. */
+ are actually truncated on the left. */
&& cursor_row->truncated_on_right_p
&& w->cursor.x <= h_margin)
|| (w->hscroll
@@ -12860,6 +13100,28 @@ reconsider_clip_changes (struct window *w)
}
}
+static void
+propagate_buffer_redisplay (void)
+{ /* Resetting b->text->redisplay is problematic!
+ We can't just reset it in the case that some window that displays
+ it has not been redisplayed; and such a window can stay
+ unredisplayed for a long time if it's currently invisible.
+ But we do want to reset it at the end of redisplay otherwise
+ its displayed windows will keep being redisplayed over and over
+ again.
+ So we copy all b->text->redisplay flags up to their windows here,
+ such that mark_window_display_accurate can safely reset
+ b->text->redisplay. */
+ Lisp_Object ws = window_list ();
+ for (; CONSP (ws); ws = XCDR (ws))
+ {
+ struct window *thisw = XWINDOW (XCAR (ws));
+ struct buffer *thisb = XBUFFER (thisw->contents);
+ if (thisb->text->redisplay)
+ thisw->redisplay = true;
+ }
+}
+
#define STOP_POLLING \
do { if (! polling_stopped_here) stop_polling (); \
polling_stopped_here = 1; } while (0)
@@ -12956,7 +13218,6 @@ redisplay_internal (void)
/* Since frames on a single ASCII terminal share the same
display area, displaying a different frame means redisplay
the whole thing. */
- windows_or_buffers_changed = 48;
SET_FRAME_GARBAGED (sf);
#ifndef DOS_NT
set_tty_color_mode (FRAME_TTY (sf), sf);
@@ -13005,9 +13266,6 @@ redisplay_internal (void)
if (NILP (Vmemory_full))
prepare_menu_bars ();
- if (windows_or_buffers_changed && !update_mode_lines)
- update_mode_lines = 32;
-
reconsider_clip_changes (w);
/* In most cases selected window displays current buffer. */
@@ -13016,27 +13274,12 @@ redisplay_internal (void)
{
/* Detect case that we need to write or remove a star in the mode line. */
if ((SAVE_MODIFF < MODIFF) != w->last_had_star)
- {
w->update_mode_line = 1;
- if (buffer_shared_and_changed ())
- update_mode_lines = 33;
- }
if (mode_line_update_needed (w))
w->update_mode_line = 1;
}
- consider_all_windows_p = (update_mode_lines
- || buffer_shared_and_changed ());
-
- /* If specs for an arrow have changed, do thorough redisplay
- to ensure we remove any arrow that should no longer exist. */
- if (overlay_arrows_changed_p ())
- {
- consider_all_windows_p = true;
- windows_or_buffers_changed = 49;
- }
-
/* Normally the message* functions will have already displayed and
updated the echo area, but the frame may have been trashed, or
the update may have been preempted, so display the echo area
@@ -13066,8 +13309,6 @@ redisplay_internal (void)
if (window_height_changed_p)
{
- consider_all_windows_p = true;
- update_mode_lines = 34;
windows_or_buffers_changed = 50;
/* If window configuration was changed, frames may have been
@@ -13083,13 +13324,6 @@ redisplay_internal (void)
/* Resized active mini-window to fit the size of what it is
showing if its contents might have changed. */
must_finish = 1;
- /* FIXME: this causes all frames to be updated, which seems unnecessary
- since only the current frame needs to be considered. This function
- needs to be rewritten with two variables, consider_all_windows and
- consider_all_frames. */
- consider_all_windows_p = true;
- windows_or_buffers_changed = 51;
- update_mode_lines = 35;
/* If window configuration was changed, frames may have been
marked garbaged. Clear them or we will experience
@@ -13097,23 +13331,29 @@ redisplay_internal (void)
clear_garbaged_frames ();
}
- if (VECTORP (Vredisplay__all_windows_cause)
- && windows_or_buffers_changed >= 0
- && windows_or_buffers_changed < ASIZE (Vredisplay__all_windows_cause)
- && INTEGERP (AREF (Vredisplay__all_windows_cause,
- windows_or_buffers_changed)))
- ASET (Vredisplay__all_windows_cause, windows_or_buffers_changed,
- make_number (1 + XINT (AREF (Vredisplay__all_windows_cause,
- windows_or_buffers_changed))));
-
- if (VECTORP (Vredisplay__mode_lines_cause)
- && update_mode_lines >= 0
- && update_mode_lines < ASIZE (Vredisplay__mode_lines_cause)
- && INTEGERP (AREF (Vredisplay__mode_lines_cause,
- update_mode_lines)))
- ASET (Vredisplay__mode_lines_cause, update_mode_lines,
- make_number (1 + XINT (AREF (Vredisplay__mode_lines_cause,
- update_mode_lines))));
+ if (windows_or_buffers_changed && !update_mode_lines)
+ /* Code that sets windows_or_buffers_changed doesn't distinguish whether
+ only the windows's contents needs to be refreshed, or whether the
+ mode-lines also need a refresh. */
+ update_mode_lines = (windows_or_buffers_changed == REDISPLAY_SOME
+ ? REDISPLAY_SOME : 32);
+
+ /* If specs for an arrow have changed, do thorough redisplay
+ to ensure we remove any arrow that should no longer exist. */
+ if (overlay_arrows_changed_p ())
+ /* Apparently, this is the only case where we update other windows,
+ without updating other mode-lines. */
+ windows_or_buffers_changed = 49;
+
+ consider_all_windows_p = (update_mode_lines
+ || windows_or_buffers_changed);
+
+#define AINC(a,i) \
+ if (VECTORP (a) && i >= 0 && i < ASIZE (a) && INTEGERP (AREF (a, i))) \
+ ASET (a, i, make_number (1 + XINT (AREF (a, i))))
+
+ AINC (Vredisplay__all_windows_cause, windows_or_buffers_changed);
+ AINC (Vredisplay__mode_lines_cause, update_mode_lines);
/* Optimize the case that only the line containing the cursor in the
selected window has changed. Variables starting with this_ are
@@ -13254,6 +13494,8 @@ redisplay_internal (void)
PT == w->last_point
/* Make sure the cursor was last displayed
in this window. Otherwise we have to reposition it. */
+
+ /* PXW: Must be converted to pixels, probably. */
&& 0 <= w->cursor.vpos
&& w->cursor.vpos < WINDOW_TOTAL_LINES (w))
{
@@ -13330,6 +13572,8 @@ redisplay_internal (void)
FOR_EACH_FRAME (tail, frame)
XFRAME (frame)->updated_p = 0;
+ propagate_buffer_redisplay ();
+
FOR_EACH_FRAME (tail, frame)
{
struct frame *f = XFRAME (frame);
@@ -13344,13 +13588,20 @@ redisplay_internal (void)
if (FRAME_WINDOW_P (f) || FRAME_TERMCAP_P (f) || f == sf)
{
+ bool gcscrollbars
+ /* Only GC scrollbars when we redisplay the whole frame. */
+ = f->redisplay || !REDISPLAY_SOME_P ();
/* Mark all the scroll bars to be removed; we'll redeem
the ones we want when we redisplay their windows. */
- if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook)
+ if (gcscrollbars && FRAME_TERMINAL (f)->condemn_scroll_bars_hook)
FRAME_TERMINAL (f)->condemn_scroll_bars_hook (f);
if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f))
redisplay_windows (FRAME_ROOT_WINDOW (f));
+ /* Remember that the invisible frames need to be redisplayed next
+ time they're visible. */
+ else if (!REDISPLAY_SOME_P ())
+ f->redisplay = true;
/* The X error handler may have deleted that frame. */
if (!FRAME_LIVE_P (f))
@@ -13358,7 +13609,7 @@ redisplay_internal (void)
/* Any scroll bars which redisplay_windows should have
nuked should now go away. */
- if (FRAME_TERMINAL (f)->judge_scroll_bars_hook)
+ if (gcscrollbars && FRAME_TERMINAL (f)->judge_scroll_bars_hook)
FRAME_TERMINAL (f)->judge_scroll_bars_hook (f);
if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f))
@@ -13381,19 +13632,11 @@ redisplay_internal (void)
/* Prevent various kinds of signals during display
update. stdio is not robust about handling
- signals, which can cause an apparent I/O
- error. */
+ signals, which can cause an apparent I/O error. */
if (interrupt_input)
unrequest_sigio ();
STOP_POLLING;
- /* Mark windows on frame F to update. If we decide to
- update all frames but windows_or_buffers_changed is
- zero, we assume that only the windows that shows
- current buffer should be really updated. */
- set_window_update_flags
- (XWINDOW (f->root_window),
- (windows_or_buffers_changed ? NULL : current_buffer), 1);
pending |= update_frame (f, 0, 0);
f->cursor_type_changed = 0;
f->updated_p = 1;
@@ -13413,6 +13656,7 @@ redisplay_internal (void)
struct frame *f = XFRAME (frame);
if (f->updated_p)
{
+ f->redisplay = false;
mark_window_display_accurate (f->root_window, 1);
if (FRAME_TERMINAL (f)->frame_up_to_date_hook)
FRAME_TERMINAL (f)->frame_up_to_date_hook (f);
@@ -13455,7 +13699,7 @@ redisplay_internal (void)
if (hscroll_windows (selected_window))
goto retry;
- XWINDOW (selected_window)->must_be_updated_p = 1;
+ XWINDOW (selected_window)->must_be_updated_p = true;
pending = update_frame (sf, 0, 0);
sf->cursor_type_changed = 0;
}
@@ -13470,7 +13714,7 @@ redisplay_internal (void)
if (mini_frame != sf && FRAME_WINDOW_P (mini_frame))
{
- XWINDOW (mini_window)->must_be_updated_p = 1;
+ XWINDOW (mini_window)->must_be_updated_p = true;
pending |= update_frame (mini_frame, 0, 0);
mini_frame->cursor_type_changed = 0;
if (!pending && hscroll_windows (mini_window))
@@ -13502,6 +13746,11 @@ redisplay_internal (void)
{
/* This has already been done above if
consider_all_windows_p is set. */
+ if (XBUFFER (w->contents)->text->redisplay
+ && buffer_window_count (XBUFFER (w->contents)) > 1)
+ /* This can happen if b->text->redisplay was set during
+ jit-lock. */
+ propagate_buffer_redisplay ();
mark_window_display_accurate_1 (w, 1);
/* Say overlay arrows are up to date. */
@@ -13535,12 +13784,7 @@ redisplay_internal (void)
FOR_EACH_FRAME (tail, frame)
{
- int this_is_visible = 0;
-
if (XFRAME (frame)->visible)
- this_is_visible = 1;
-
- if (this_is_visible)
new_count++;
}
@@ -13578,6 +13822,9 @@ redisplay_internal (void)
#endif /* HAVE_WINDOW_SYSTEM */
end_of_redisplay:
+ if (interrupt_input && interrupts_deferred)
+ request_sigio ();
+
unbind_to (count, Qnil);
RESUME_POLLING;
}
@@ -13639,8 +13886,13 @@ mark_window_display_accurate_1 (struct window *w, int accurate_p)
if (accurate_p)
{
- b->clip_changed = 0;
- b->prevent_redisplay_optimizations_p = 0;
+ b->clip_changed = false;
+ b->prevent_redisplay_optimizations_p = false;
+ eassert (buffer_window_count (b) > 0);
+ /* Resetting b->text->redisplay is problematic!
+ In order to make it safer to do it here, redisplay_internal must
+ have copied all b->text->redisplay to their respective windows. */
+ b->text->redisplay = false;
BUF_UNCHANGED_MODIFIED (b) = BUF_MODIFF (b);
BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b);
@@ -13659,9 +13911,11 @@ mark_window_display_accurate_1 (struct window *w, int accurate_p)
else
w->last_point = marker_position (w->pointm);
- w->window_end_valid = 1;
- w->update_mode_line = 0;
+ w->window_end_valid = true;
+ w->update_mode_line = false;
}
+
+ w->redisplay = !accurate_p;
}
@@ -13764,7 +14018,7 @@ static Lisp_Object
redisplay_window_0 (Lisp_Object window)
{
if (displayed_buffer->display_error_modiff < BUF_MODIFF (displayed_buffer))
- redisplay_window (window, 0);
+ redisplay_window (window, false);
return Qnil;
}
@@ -13772,7 +14026,7 @@ static Lisp_Object
redisplay_window_1 (Lisp_Object window)
{
if (displayed_buffer->display_error_modiff < BUF_MODIFF (displayed_buffer))
- redisplay_window (window, 1);
+ redisplay_window (window, true);
return Qnil;
}
@@ -14314,9 +14568,9 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
occlude point. Only set w->cursor if we found a better
approximation to the cursor position than we have from previously
examined candidate rows belonging to the same continued line. */
- if (/* we already have a candidate row */
+ if (/* We already have a candidate row. */
w->cursor.vpos >= 0
- /* that candidate is not the row we are processing */
+ /* That candidate is not the row we are processing. */
&& MATRIX_ROW (matrix, w->cursor.vpos) != row
/* Make sure cursor.vpos specifies a row whose start and end
charpos occlude point, and it is valid candidate for being a
@@ -14327,30 +14581,30 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
&& pt_old <= MATRIX_ROW_END_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos))
&& cursor_row_p (MATRIX_ROW (matrix, w->cursor.vpos)))
{
- struct glyph *g1 =
- MATRIX_ROW_GLYPH_START (matrix, w->cursor.vpos) + w->cursor.hpos;
+ struct glyph *g1
+ = MATRIX_ROW_GLYPH_START (matrix, w->cursor.vpos) + w->cursor.hpos;
/* Don't consider glyphs that are outside TEXT_AREA. */
if (!(row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end))
return 0;
/* Keep the candidate whose buffer position is the closest to
point or has the `cursor' property. */
- if (/* previous candidate is a glyph in TEXT_AREA of that row */
+ if (/* Previous candidate is a glyph in TEXT_AREA of that row. */
w->cursor.hpos >= 0
&& w->cursor.hpos < MATRIX_ROW_USED (matrix, w->cursor.vpos)
&& ((BUFFERP (g1->object)
- && (g1->charpos == pt_old /* an exact match always wins */
+ && (g1->charpos == pt_old /* An exact match always wins. */
|| (BUFFERP (glyph->object)
&& eabs (g1->charpos - pt_old)
< eabs (glyph->charpos - pt_old))))
- /* previous candidate is a glyph from a string that has
- a non-nil `cursor' property */
+ /* Previous candidate is a glyph from a string that has
+ a non-nil `cursor' property. */
|| (STRINGP (g1->object)
&& (!NILP (Fget_char_property (make_number (g1->charpos),
Qcursor, g1->object))
- /* previous candidate is from the same display
+ /* Previous candidate is from the same display
string as this one, and the display string
- came from a text property */
+ came from a text property. */
|| (EQ (g1->object, glyph->object)
&& string_from_text_prop)
/* this candidate is from newline and its
@@ -14793,7 +15047,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
if (! cursor_row_fully_visible_p (w, extra_scroll_margin_lines <= 1, 0)
/* It's possible that the cursor is on the first line of the
buffer, which is partially obscured due to a vscroll
- (Bug#7537). In that case, avoid looping forever . */
+ (Bug#7537). In that case, avoid looping forever. */
&& extra_scroll_margin_lines < w->desired_matrix->nrows - 1)
{
clear_glyph_matrix (w->desired_matrix);
@@ -14848,6 +15102,7 @@ compute_window_start_on_continuation_line (struct window *w)
/* If the line start is "too far" away from the window start,
say it takes too much time to compute a new window start. */
if (CHARPOS (start_pos) - IT_CHARPOS (it)
+ /* PXW: Do we need upper bounds here? */
< WINDOW_TOTAL_LINES (w) * WINDOW_TOTAL_COLS (w))
{
int min_distance, distance;
@@ -15298,7 +15553,7 @@ set_vertical_scroll_bar (struct window *w)
changed on window's frame. In that case, redisplay_internal will retry. */
static void
-redisplay_window (Lisp_Object window, int just_this_one_p)
+redisplay_window (Lisp_Object window, bool just_this_one_p)
{
struct window *w = XWINDOW (window);
struct frame *f = XFRAME (w->frame);
@@ -15309,11 +15564,11 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
int tem;
struct it it;
/* Record it now because it's overwritten. */
- int current_matrix_up_to_date_p = 0;
- int used_current_matrix_p = 0;
+ bool current_matrix_up_to_date_p = false;
+ bool used_current_matrix_p = false;
/* This is less strict than current_matrix_up_to_date_p.
It indicates that the buffer contents and narrowing are unchanged. */
- int buffer_unchanged_p = 0;
+ bool buffer_unchanged_p = false;
int temp_scroll_step = 0;
ptrdiff_t count = SPECPDL_INDEX ();
int rc;
@@ -15329,6 +15584,13 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
*w->desired_matrix->method = 0;
#endif
+ if (!just_this_one_p
+ && REDISPLAY_SOME_P ()
+ && !w->redisplay
+ && !f->redisplay
+ && !buffer->text->redisplay)
+ return;
+
/* Make sure that both W's markers are valid. */
eassert (XMARKER (w->start)->buffer == buffer);
eassert (XMARKER (w->pointm)->buffer == buffer);
@@ -15343,6 +15605,11 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
|| buffer->clip_changed
|| buffer->prevent_redisplay_optimizations_p);
+ if (!just_this_one_p)
+ /* If `just_this_one_p' is set, we apparently set must_be_updated_p more
+ cleverly elsewhere. */
+ w->must_be_updated_p = true;
+
if (MINI_WINDOW_P (w))
{
if (w == XWINDOW (echo_area_window)
@@ -15423,10 +15690,10 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
if (XMARKER (w->start)->buffer == current_buffer)
compute_window_start_on_continuation_line (w);
- w->window_end_valid = 0;
+ w->window_end_valid = false;
/* If so, we also can't rely on current matrix
and should not fool try_cursor_movement below. */
- current_matrix_up_to_date_p = 0;
+ current_matrix_up_to_date_p = false;
}
/* Some sanity checks. */
@@ -16044,7 +16311,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
SET_TEXT_POS_FROM_MARKER (startp, w->start);
w->start_at_line_beg = (CHARPOS (startp) == BEGV
- || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n');
+ || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n');
/* Display the mode line, if we must. */
if ((update_mode_line
@@ -16064,6 +16331,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
&& (WINDOW_WANTS_MODELINE_P (w)
|| WINDOW_WANTS_HEADER_LINE_P (w)))
{
+
display_mode_lines (w);
/* If mode line height has changed, arrange for a thorough
@@ -16129,7 +16397,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
redisplay_tool_bar (f);
#else
if (WINDOWP (f->tool_bar_window)
- && (FRAME_TOOL_BAR_LINES (f) > 0
+ && (FRAME_TOOL_BAR_HEIGHT (f) > 0
|| !NILP (Vauto_resize_tool_bars))
&& redisplay_tool_bar (f))
ignore_mouse_drag_p = 1;
@@ -16147,10 +16415,18 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
update_begin (f);
block_input ();
if (draw_window_fringes (w, 1))
- x_draw_vertical_border (w);
+ {
+ if (WINDOW_RIGHT_DIVIDER_WIDTH (w))
+ x_draw_right_divider (w);
+ else
+ x_draw_vertical_border (w);
+ }
unblock_input ();
update_end (f);
}
+
+ if (WINDOW_BOTTOM_DIVIDER_WIDTH (w))
+ x_draw_bottom_divider (w);
#endif /* HAVE_WINDOW_SYSTEM */
/* We go to this label, with fonts_changed set, if it is
@@ -16184,7 +16460,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
set_buffer_internal_1 (old);
/* Avoid an abort in TEMP_SET_PT_BOTH if the buffer has become
- shorter. This can be caused by log truncation in *Messages*. */
+ shorter. This can be caused by log truncation in *Messages*. */
if (CHARPOS (lpoint) <= ZV)
TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint));
@@ -20453,6 +20729,7 @@ display_menu_bar (struct window *w)
eassert (!FRAME_WINDOW_P (f));
init_iterator (&it, w, -1, -1, f->desired_matrix->rows, MENU_FACE_ID);
it.first_visible_x = 0;
+ /* PXW: Use FRAME_PIXEL_WIDTH (f) here? */
it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f);
#elif defined (HAVE_X_WINDOWS) /* X without toolkit. */
if (FRAME_WINDOW_P (f))
@@ -20464,6 +20741,7 @@ display_menu_bar (struct window *w)
init_iterator (&it, menu_w, -1, -1, menu_w->desired_matrix->rows,
MENU_FACE_ID);
it.first_visible_x = 0;
+ /* PXW: Use FRAME_PIXEL_WIDTH (f) here? */
it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f);
}
else
@@ -20519,7 +20797,6 @@ display_menu_bar (struct window *w)
compute_line_metrics (&it);
}
-#ifdef HAVE_MENUS
/* Deep copy of a glyph row, including the glyphs. */
static void
deep_copy_glyph_row (struct glyph_row *to, struct glyph_row *from)
@@ -20641,7 +20918,6 @@ display_tty_menu_item (const char *item_text, int width, int face_id,
row->full_width_p = saved_width;
row->reversed_p = saved_reversed;
}
-#endif /* HAVE_MENUS */
/***********************************************************************
Mode Line
@@ -20653,7 +20929,7 @@ display_tty_menu_item (const char *item_text, int width, int face_id,
the number of windows whose mode lines were redisplayed. */
static int
-redisplay_mode_lines (Lisp_Object window, int force)
+redisplay_mode_lines (Lisp_Object window, bool force)
{
int nwindows = 0;
@@ -20687,10 +20963,7 @@ redisplay_mode_lines (Lisp_Object window, int force)
/* Display mode lines. */
clear_glyph_matrix (w->desired_matrix);
if (display_mode_lines (w))
- {
- ++nwindows;
- w->must_be_updated_p = 1;
- }
+ ++nwindows;
/* Restore old settings. */
set_buffer_internal_1 (old);
@@ -20746,6 +21019,8 @@ display_mode_lines (struct window *w)
XFRAME (new_frame)->selected_window = old_frame_selected_window;
selected_frame = old_selected_frame;
selected_window = old_selected_window;
+ if (n > 0)
+ w->must_be_updated_p = true;
return n;
}
@@ -23841,7 +24116,8 @@ draw_glyphs (struct window *w, int x, struct glyph_row *row,
/* X is relative to the left edge of W, without scroll bars
or fringes. */
area_left = WINDOW_LEFT_EDGE_X (w);
- last_x = WINDOW_LEFT_EDGE_X (w) + WINDOW_TOTAL_WIDTH (w);
+ last_x = (WINDOW_LEFT_EDGE_X (w) + WINDOW_PIXEL_WIDTH (w)
+ - (row->mode_line_p ? WINDOW_RIGHT_DIVIDER_WIDTH (w) : 0));
}
else
{
@@ -25879,7 +26155,8 @@ x_clear_end_of_line (struct window *w, struct glyph_row *updated_row,
f = XFRAME (w->frame);
if (updated_row->full_width_p)
- max_x = WINDOW_TOTAL_WIDTH (w);
+ max_x = (WINDOW_PIXEL_WIDTH (w)
+ - (updated_row->mode_line_p ? WINDOW_RIGHT_DIVIDER_WIDTH (w) : 0));
else
max_x = window_box_width (w, updated_area);
max_y = window_text_bottom_y (w);
@@ -26796,7 +27073,10 @@ clear_mouse_face (Mouse_HLInfo *hlinfo)
cleared = 1;
}
- reset_mouse_highlight (hlinfo);
+ hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
+ hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
+ hlinfo->mouse_face_window = Qnil;
+ hlinfo->mouse_face_overlay = Qnil;
return cleared;
}
@@ -27720,6 +28000,8 @@ define_frame_cursor1 (struct frame *f, Cursor cursor, Lisp_Object pointer)
cursor = FRAME_X_OUTPUT (f)->text_cursor;
else if (EQ (pointer, intern ("hdrag")))
cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor;
+ else if (EQ (pointer, intern ("nhdrag")))
+ cursor = FRAME_X_OUTPUT (f)->vertical_drag_cursor;
#ifdef HAVE_X_WINDOWS
else if (EQ (pointer, intern ("vdrag")))
cursor = FRAME_DISPLAY_INFO (f)->vertical_scroll_bar_cursor;
@@ -28133,6 +28415,16 @@ note_mouse_highlight (struct frame *f, int x, int y)
cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor;
help_echo_string = build_string ("drag-mouse-1: resize");
}
+ else if (part == ON_RIGHT_DIVIDER)
+ {
+ cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor;
+ help_echo_string = build_string ("drag-mouse-1: resize");
+ }
+ else if (part == ON_BOTTOM_DIVIDER)
+ {
+ cursor = FRAME_X_OUTPUT (f)->vertical_drag_cursor;
+ help_echo_string = build_string ("drag-mouse-1: resize");
+ }
else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE
|| part == ON_SCROLL_BAR)
cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
@@ -28773,7 +29065,7 @@ x_draw_vertical_border (struct window *w)
do it for frames with vertical scroll bars because either the
right scroll bar of a window, or the left scroll bar of its
neighbor will suffice as a border. */
- if (FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (w->frame)))
+ if (FRAME_HAS_VERTICAL_SCROLL_BARS (f) || FRAME_RIGHT_DIVIDER_WIDTH (f))
return;
/* Note: It is necessary to redraw both the left and the right
@@ -28792,6 +29084,7 @@ x_draw_vertical_border (struct window *w)
FRAME_RIF (f)->draw_vertical_window_border (w, x1, y0, y1);
}
+
if (!WINDOW_LEFTMOST_P (w)
&& !WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
{
@@ -28808,6 +29101,44 @@ x_draw_vertical_border (struct window *w)
}
+/* Draw window dividers for window W. */
+
+void
+x_draw_right_divider (struct window *w)
+{
+ struct frame *f = WINDOW_XFRAME (w);
+
+ if (w->mini || w->pseudo_window_p)
+ return;
+ else if (WINDOW_RIGHT_DIVIDER_WIDTH (w))
+ {
+ int x0 = WINDOW_RIGHT_EDGE_X (w) - WINDOW_RIGHT_DIVIDER_WIDTH (w);
+ int x1 = WINDOW_RIGHT_EDGE_X (w);
+ int y0 = WINDOW_TOP_EDGE_Y (w);
+ int y1 = WINDOW_BOTTOM_EDGE_Y (w);
+
+ FRAME_RIF (f)->draw_window_divider (w, x0, x1, y0, y1);
+ }
+}
+
+static void
+x_draw_bottom_divider (struct window *w)
+{
+ struct frame *f = XFRAME (WINDOW_FRAME (w));
+
+ if (w->mini || w->pseudo_window_p)
+ return;
+ else if (WINDOW_BOTTOM_DIVIDER_WIDTH (w))
+ {
+ int x0 = WINDOW_LEFT_EDGE_X (w);
+ int x1 = WINDOW_RIGHT_EDGE_X (w);
+ int y0 = WINDOW_BOTTOM_EDGE_Y (w) - WINDOW_BOTTOM_DIVIDER_WIDTH (w);
+ int y1 = WINDOW_BOTTOM_EDGE_Y (w);
+
+ FRAME_RIF (f)->draw_window_divider (w, x0, x1, y0, y1);
+ }
+}
+
/* Redraw the part of window W intersection rectangle FR. Pixel
coordinates in FR are frame-relative. Call this function with
input blocked. Value is non-zero if the exposure overwrites
@@ -28839,8 +29170,8 @@ expose_window (struct window *w, XRectangle *fr)
/* Frame-relative pixel rectangle of W. */
wr.x = WINDOW_LEFT_EDGE_X (w);
wr.y = WINDOW_TOP_EDGE_Y (w);
- wr.width = WINDOW_TOTAL_WIDTH (w);
- wr.height = WINDOW_TOTAL_HEIGHT (w);
+ wr.width = WINDOW_PIXEL_WIDTH (w);
+ wr.height = WINDOW_PIXEL_HEIGHT (w);
if (x_intersect_rectangles (fr, &wr, &r))
{
@@ -28936,7 +29267,13 @@ expose_window (struct window *w, XRectangle *fr)
fr);
/* Draw border between windows. */
- x_draw_vertical_border (w);
+ if (WINDOW_RIGHT_DIVIDER_WIDTH (w))
+ x_draw_right_divider (w);
+ else
+ x_draw_vertical_border (w);
+
+ if (WINDOW_BOTTOM_DIVIDER_WIDTH (w))
+ x_draw_bottom_divider (w);
/* Turn the cursor on again. */
if (cursor_cleared_p
@@ -29154,13 +29491,14 @@ syms_of_xdisp (void)
defsubr (&Strace_to_stderr);
#endif
#ifdef HAVE_WINDOW_SYSTEM
- defsubr (&Stool_bar_lines_needed);
+ defsubr (&Stool_bar_height);
defsubr (&Slookup_image_map);
#endif
defsubr (&Sline_pixel_height);
defsubr (&Sformat_mode_line);
defsubr (&Sinvisible_p);
defsubr (&Scurrent_bidi_paragraph_direction);
+ defsubr (&Swindow_text_pixel_size);
defsubr (&Smove_point_visually);
DEFSYM (Qmenu_bar_update_hook, "menu-bar-update-hook");
@@ -29788,12 +30126,18 @@ init_xdisp (void)
echo_area_window = minibuf_window;
r->top_line = FRAME_TOP_MARGIN (f);
- r->total_lines = FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f);
+ r->pixel_top = r->top_line * FRAME_LINE_HEIGHT (f);
r->total_cols = FRAME_COLS (f);
+ r->pixel_width = r->total_cols * FRAME_COLUMN_WIDTH (f);
+ r->total_lines = FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f);
+ r->pixel_height = r->total_lines * FRAME_LINE_HEIGHT (f);
m->top_line = FRAME_LINES (f) - 1;
- m->total_lines = 1;
+ m->pixel_top = m->top_line * FRAME_LINE_HEIGHT (f);
m->total_cols = FRAME_COLS (f);
+ m->pixel_width = m->total_cols * FRAME_COLUMN_WIDTH (f);
+ m->total_lines = 1;
+ m->pixel_height = m->total_lines * FRAME_LINE_HEIGHT (f);
scratch_glyph_row.glyphs[TEXT_AREA] = scratch_glyphs;
scratch_glyph_row.glyphs[TEXT_AREA + 1]
diff --git a/src/xfaces.c b/src/xfaces.c
index b9ddddfd9e2..8a74c92b10d 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -323,6 +323,7 @@ Lisp_Object Qheader_line, Qscroll_bar, Qcursor;
static Lisp_Object Qborder, Qmouse, Qmenu;
Lisp_Object Qmode_line_inactive;
static Lisp_Object Qvertical_border;
+static Lisp_Object Qwindow_divider;
/* The symbol `face-alias'. A symbols having that property is an
alias for another face. Value of the property is the name of
@@ -911,8 +912,6 @@ load_pixmap (struct frame *f, Lisp_Object name)
X Colors
***********************************************************************/
-#define NEAR_SAME_COLOR_THRESHOLD 30000
-
/* Parse RGB_LIST, and fill in the RGB fields of COLOR.
RGB_LIST should contain (at least) 3 lisp integers.
Return 0 if there's a problem with RGB_LIST, otherwise return 1. */
@@ -1264,6 +1263,8 @@ load_color (struct frame *f, struct face *face, Lisp_Object name,
#ifdef HAVE_WINDOW_SYSTEM
+#define NEAR_SAME_COLOR_THRESHOLD 30000
+
/* Load colors for face FACE which is used on frame F. Colors are
specified by slots LFACE_BACKGROUND_INDEX and LFACE_FOREGROUND_INDEX
of ATTRS. If the background color specified is not supported on F,
@@ -5246,6 +5247,7 @@ realize_basic_faces (struct frame *f)
realize_named_face (f, Qmouse, MOUSE_FACE_ID);
realize_named_face (f, Qmenu, MENU_FACE_ID);
realize_named_face (f, Qvertical_border, VERTICAL_BORDER_FACE_ID);
+ realize_named_face (f, Qwindow_divider, WINDOW_DIVIDER_FACE_ID);
/* Reflect changes in the `menu' face in menu bars. */
if (FRAME_FACE_CACHE (f)->menu_face_changed_p)
@@ -6448,6 +6450,7 @@ syms_of_xfaces (void)
DEFSYM (Qmouse, "mouse");
DEFSYM (Qmode_line_inactive, "mode-line-inactive");
DEFSYM (Qvertical_border, "vertical-border");
+ DEFSYM (Qwindow_divider, "window-divider");
DEFSYM (Qtty_color_desc, "tty-color-desc");
DEFSYM (Qtty_color_standard_values, "tty-color-standard-values");
DEFSYM (Qtty_color_by_index, "tty-color-by-index");
diff --git a/src/xfns.c b/src/xfns.c
index 46f377042f6..3c8df12f8c5 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -612,7 +612,7 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
struct x_output *x = f->output_data.x;
Display *dpy = FRAME_X_DISPLAY (f);
Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
- Cursor hourglass_cursor, horizontal_drag_cursor;
+ Cursor hourglass_cursor, horizontal_drag_cursor, vertical_drag_cursor;
unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
unsigned long mask_color = FRAME_BACKGROUND_PIXEL (f);
@@ -680,7 +680,7 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
if (!NILP (Vx_window_horizontal_drag_shape))
{
- CHECK_NUMBER (Vx_window_horizontal_drag_shape);
+ CHECK_TYPE_RANGED_INTEGER (unsigned, Vx_window_horizontal_drag_shape);
horizontal_drag_cursor
= XCreateFontCursor (dpy, XINT (Vx_window_horizontal_drag_shape));
}
@@ -688,6 +688,16 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
horizontal_drag_cursor
= XCreateFontCursor (dpy, XC_sb_h_double_arrow);
+ if (!NILP (Vx_window_vertical_drag_shape))
+ {
+ CHECK_NUMBER (Vx_window_vertical_drag_shape);
+ vertical_drag_cursor
+ = XCreateFontCursor (dpy, XINT (Vx_window_vertical_drag_shape));
+ }
+ else
+ vertical_drag_cursor
+ = XCreateFontCursor (dpy, XC_sb_v_double_arrow);
+
/* Check and report errors with the above calls. */
x_check_errors (dpy, "can't set cursor shape: %s");
x_uncatch_errors ();
@@ -745,6 +755,11 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
XFreeCursor (dpy, x->horizontal_drag_cursor);
x->horizontal_drag_cursor = horizontal_drag_cursor;
+ if (vertical_drag_cursor != x->vertical_drag_cursor
+ && x->vertical_drag_cursor != 0)
+ XFreeCursor (dpy, x->vertical_drag_cursor);
+ x->vertical_drag_cursor = vertical_drag_cursor;
+
XFlush (dpy);
unblock_input ();
@@ -963,6 +978,7 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
FRAME_MENU_BAR_LINES (f) = 0;
+ FRAME_MENU_BAR_HEIGHT (f) = 0;
if (nlines)
{
FRAME_EXTERNAL_MENU_BAR (f) = 1;
@@ -980,7 +996,8 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
}
#else /* not USE_X_TOOLKIT && not USE_GTK */
FRAME_MENU_BAR_LINES (f) = nlines;
- resize_frame_windows (f, FRAME_LINES (f), 0);
+ FRAME_MENU_BAR_HEIGHT (f) = nlines * FRAME_LINE_HEIGHT (f);
+ resize_frame_windows (f, FRAME_LINES (f), 0, 0);
/* If the menu bar height gets changed, the internal border below
the top margin has to be cleared. Also, if the menu bar gets
@@ -993,7 +1010,7 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
int y;
/* height can be zero here. */
- if (height > 0 && width > 0)
+ if (FRAME_X_WINDOW (f) && height > 0 && width > 0)
{
y = FRAME_TOP_MARGIN_HEIGHT (f);
@@ -1051,6 +1068,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
#ifdef USE_GTK
FRAME_TOOL_BAR_LINES (f) = 0;
+ FRAME_TOOL_BAR_HEIGHT (f) = 0;
if (nlines)
{
FRAME_EXTERNAL_TOOL_BAR (f) = 1;
@@ -1083,7 +1101,8 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
}
FRAME_TOOL_BAR_LINES (f) = nlines;
- resize_frame_windows (f, FRAME_LINES (f), 0);
+ FRAME_TOOL_BAR_HEIGHT (f) = nlines * FRAME_LINE_HEIGHT (f);
+ resize_frame_windows (f, FRAME_LINES (f), 0, 0);
adjust_frame_glyphs (f);
/* We also have to make sure that the internal border at the top of
@@ -1092,7 +1111,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
below the tool bar if one is displayed, but is below the menu bar
if there isn't a tool bar. The tool bar draws into the area
below the menu bar. */
- if (FRAME_X_WINDOW (f) && FRAME_TOOL_BAR_LINES (f) == 0)
+ if (FRAME_X_WINDOW (f) && FRAME_TOOL_BAR_HEIGHT (f) == 0)
{
clear_frame (f);
clear_current_matrices (f);
@@ -1471,13 +1490,13 @@ x_set_scroll_bar_default_width (struct frame *f)
FRAME_CONFIG_SCROLL_BAR_COLS (f) = (minw + wid - 1) / wid;
FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = minw;
#else
- /* Make the actual width at least 14 pixels and a multiple of a
+ /* Make the actual width 16 pixels and a multiple of a
character width. */
- FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;
+ FRAME_CONFIG_SCROLL_BAR_COLS (f) = (16 + wid - 1) / wid;
/* Use all of that space (aside from required margins) for the
scroll bar. */
- FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = 0;
+ FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = 16;
#endif
}
@@ -3050,6 +3069,22 @@ This function is an internal primitive--use `make-frame' instead. */)
happen. */
init_frame_faces (f);
+#ifdef USE_GTK
+ /* PXW: This is a duplicate from below. We have to do it here since
+ otherwise x_set_tool_bar_lines will work with the character sizes
+ installed by init_frame_faces while the frame's pixel size is still
+ calculated from a character size of 1 and we subsequently hit the
+ eassert (height >= 0) assertion in window_box_height. The
+ non-pixelwise code apparently worked around this because it had one
+ frame line vs one toolbar line which left us with a zero root
+ window height which was obviously wrong as well ... */
+ width = FRAME_TEXT_WIDTH (f);
+ height = FRAME_TEXT_HEIGHT (f);
+ FRAME_TEXT_HEIGHT (f) = 0;
+ SET_FRAME_WIDTH (f, 0);
+ change_frame_size (f, width, height, 1, 0, 0, 1);
+#endif /* USE_GTK */
+
/* Set the menu-bar-lines and tool-bar-lines parameters. We don't
look up the X resources controlling the menu-bar and tool-bar
here; they are processed specially at startup, and reflected in
@@ -3130,12 +3165,11 @@ This function is an internal primitive--use `make-frame' instead. */)
/* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
Change will not be effected unless different from the current
FRAME_LINES (f). */
- width = FRAME_COLS (f);
- height = FRAME_LINES (f);
-
- SET_FRAME_COLS (f, 0);
- FRAME_LINES (f) = 0;
- change_frame_size (f, height, width, 1, 0, 0);
+ width = FRAME_TEXT_WIDTH (f);
+ height = FRAME_TEXT_HEIGHT (f);
+ FRAME_TEXT_HEIGHT (f) = 0;
+ SET_FRAME_WIDTH (f, 0);
+ change_frame_size (f, width, height, 1, 0, 0, 1);
#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
/* Create the menu bar. */
@@ -4918,6 +4952,10 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
x_default_parameter (f, parms, Qinternal_border_width, make_number (1),
"internalBorderWidth", "internalBorderWidth",
RES_TYPE_NUMBER);
+ x_default_parameter (f, parms, Qright_divider_width, make_number (0),
+ NULL, NULL, RES_TYPE_NUMBER);
+ x_default_parameter (f, parms, Qbottom_divider_width, make_number (0),
+ NULL, NULL, RES_TYPE_NUMBER);
/* Also do the stuff which must be set before the window exists. */
x_default_parameter (f, parms, Qforeground_color, build_string ("black"),
@@ -5000,7 +5038,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
height = FRAME_LINES (f);
SET_FRAME_COLS (f, 0);
FRAME_LINES (f) = 0;
- change_frame_size (f, height, width, 1, 0, 0);
+ change_frame_size (f, width, height, 1, 0, 0, 0);
/* Add `tooltip' frame parameter's default value. */
if (NILP (Fframe_parameter (frame, Qtooltip)))
@@ -5260,6 +5298,10 @@ Text larger than the specified size is clipped. */)
parms = Fcons (Fcons (Qinternal_border_width, make_number (3)), parms);
if (NILP (Fassq (Qborder_width, parms)))
parms = Fcons (Fcons (Qborder_width, make_number (1)), parms);
+ if (NILP (Fassq (Qbottom_divider_width, parms)))
+ parms = Fcons (Fcons (Qbottom_divider_width, make_number (0)), parms);
+ if (NILP (Fassq (Qright_divider_width, parms)))
+ parms = Fcons (Fcons (Qright_divider_width, make_number (0)), parms);
if (NILP (Fassq (Qborder_color, parms)))
parms = Fcons (Fcons (Qborder_color, build_string ("lightyellow")), parms);
if (NILP (Fassq (Qbackground_color, parms)))
@@ -5275,6 +5317,8 @@ Text larger than the specified size is clipped. */)
w = XWINDOW (FRAME_ROOT_WINDOW (f));
w->left_col = 0;
w->top_line = 0;
+ w->pixel_left = 0;
+ w->pixel_top = 0;
if (CONSP (Vx_max_tooltip_size)
&& RANGED_INTEGERP (1, XCAR (Vx_max_tooltip_size), INT_MAX)
@@ -5289,6 +5333,9 @@ Text larger than the specified size is clipped. */)
w->total_lines = 40;
}
+ w->pixel_width = w->total_cols * FRAME_COLUMN_WIDTH (f);
+ w->pixel_height = w->total_lines * FRAME_LINE_HEIGHT (f);
+
FRAME_TOTAL_COLS (f) = w->total_cols;
adjust_frame_glyphs (f);
w->pseudo_window_p = 1;
@@ -5355,9 +5402,11 @@ Text larger than the specified size is clipped. */)
{
/* w->total_cols and FRAME_TOTAL_COLS want the width in columns,
not in pixels. */
+ w->pixel_width = width;
width /= WINDOW_FRAME_COLUMN_WIDTH (w);
w->total_cols = width;
FRAME_TOTAL_COLS (f) = width;
+ SET_FRAME_WIDTH (f, width);
adjust_frame_glyphs (f);
clear_glyph_matrix (w->desired_matrix);
clear_glyph_matrix (w->current_matrix);
@@ -5958,6 +6007,8 @@ frame_parm_handler x_frame_parm_handlers[] =
x_set_icon_name,
x_set_icon_type,
x_set_internal_border_width,
+ x_set_right_divider_width,
+ x_set_bottom_divider_width,
x_set_menu_bar_lines,
x_set_mouse_color,
x_explicitly_set_name,
@@ -6041,6 +6092,13 @@ This variable takes effect when you create a new frame
or when you set the mouse color. */);
Vx_window_horizontal_drag_shape = Qnil;
+ DEFVAR_LISP ("x-window-vertical-drag-cursor",
+ Vx_window_vertical_drag_shape,
+ doc: /* Pointer shape to use for indicating a window can be dragged vertically.
+This variable takes effect when you create a new frame
+or when you set the mouse color. */);
+ Vx_window_vertical_drag_shape = Qnil;
+
DEFVAR_LISP ("x-cursor-fore-pixel", Vx_cursor_fore_pixel,
doc: /* A string indicating the foreground color of the cursor box. */);
Vx_cursor_fore_pixel = Qnil;
diff --git a/src/xmenu.c b/src/xmenu.c
index b2c7fb5f073..d587610fdd7 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1168,7 +1168,7 @@ free_frame_menubar (struct frame *f)
if (x1 == 0 && y1 == 0)
XtVaSetValues (f->output_data.x->widget, XtNx, x0, XtNy, y0, NULL);
#endif
- x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
+ x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 1);
}
unblock_input ();
}
@@ -2440,11 +2440,7 @@ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_
doc: /* Return t if a menu or popup dialog is active. */)
(void)
{
-#ifdef HAVE_MENUS
return (popup_activated ()) ? Qt : Qnil;
-#else
- return Qnil;
-#endif /* HAVE_MENUS */
}
void
diff --git a/src/xrdb.c b/src/xrdb.c
index ea823b2b313..7220915e631 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -179,7 +179,7 @@ magic_db (const char *string, ptrdiff_t string_len, const char *class,
else
next = p, next_len = 1;
- /* Do we have room for this component followed by a '\0' ? */
+ /* Do we have room for this component followed by a '\0'? */
if (path_size - path_len <= next_len)
{
if (min (PTRDIFF_MAX, SIZE_MAX) / 2 - 1 - path_len < next_len)
diff --git a/src/xterm.c b/src/xterm.c
index 446b2cf1e45..e8e69c666ee 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -98,7 +98,7 @@ extern void _XEditResCheckMessages (Widget, XtPointer, XEvent *, Boolean *);
#ifdef USE_TOOLKIT_SCROLL_BARS
#if defined USE_MOTIF
-#include <Xm/Xm.h> /* for LESSTIF_VERSION */
+#include <Xm/Xm.h> /* For LESSTIF_VERSION */
#include <Xm/ScrollBar.h>
#else /* !USE_MOTIF i.e. use Xaw */
@@ -165,11 +165,6 @@ static bool toolkit_scroll_bar_interaction;
static Time ignore_next_mouse_click_timeout;
-/* Incremented by XTread_socket whenever it really tries to read
- events. */
-
-static int volatile input_signal_count;
-
/* Used locally within XTread_socket. */
static int x_noop_count;
@@ -214,7 +209,7 @@ enum xembed_message
};
static bool x_alloc_nearest_color_1 (Display *, Colormap, XColor *);
-static void x_set_window_size_1 (struct frame *, int, int, int);
+static void x_set_window_size_1 (struct frame *, int, int, int, bool);
static void x_raise_frame (struct frame *);
static void x_lower_frame (struct frame *);
static const XColor *x_color_cells (Display *, int *);
@@ -253,9 +248,6 @@ static void x_sync_with_move (struct frame *, int, int, int);
static int handle_one_xevent (struct x_display_info *,
const XEvent *, int *,
struct input_event *);
-#ifdef USE_GTK
-static int x_dispatch_event (XEvent *, Display *);
-#endif
/* Don't declare this _Noreturn because we want no
interference with debugging failing X calls. */
static void x_connection_closed (Display *, const char *);
@@ -509,6 +501,23 @@ x_draw_vertical_window_border (struct window *w, int x, int y0, int y1)
f->output_data.x->normal_gc, x, y0, x, y1);
}
+/* Draw a window divider from (x0,y0) to (x1,y1) */
+
+static void
+x_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1)
+{
+ struct frame *f = XFRAME (WINDOW_FRAME (w));
+ struct face *face;
+
+ face = FACE_FROM_ID (f, WINDOW_DIVIDER_FACE_ID);
+ if (face)
+ XSetForeground (FRAME_X_DISPLAY (f), f->output_data.x->normal_gc,
+ face->foreground);
+
+ XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ f->output_data.x->normal_gc, x0, y0, x1 - x0, y1 - y0);
+}
+
/* End update of window W.
Draw vertical borders between horizontally adjacent windows, and
@@ -536,7 +545,12 @@ x_update_window_end (struct window *w, bool cursor_on_p,
w->output_cursor.x, w->output_cursor.y);
if (draw_window_fringes (w, 1))
- x_draw_vertical_border (w);
+ {
+ if (WINDOW_RIGHT_DIVIDER_WIDTH (w))
+ x_draw_right_divider (w);
+ else
+ x_draw_vertical_border (w);
+ }
unblock_input ();
}
@@ -631,10 +645,8 @@ x_draw_fringe_bitmap (struct window *w, struct glyph_row *row, struct draw_fring
/* Must clip because of partially visible lines. */
x_clip_to_row (w, row, ANY_AREA, gc);
- if (!p->overlay_p)
+ if (p->bx >= 0 && !p->overlay_p)
{
- int bx = p->bx, by = p->by, nx = p->nx, ny = p->ny;
-
/* In case the same realized face is used for fringes and
for something displayed in the text (e.g. face `region' on
mono-displays, the fill style may have been changed to
@@ -644,55 +656,8 @@ x_draw_fringe_bitmap (struct window *w, struct glyph_row *row, struct draw_fring
else
XSetForeground (display, face->gc, face->background);
-#ifdef USE_TOOLKIT_SCROLL_BARS
- /* If the fringe is adjacent to the left (right) scroll bar of a
- leftmost (rightmost, respectively) window, then extend its
- background to the gap between the fringe and the bar. */
- if ((WINDOW_LEFTMOST_P (w)
- && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
- || (WINDOW_RIGHTMOST_P (w)
- && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)))
- {
- int sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
-
- if (sb_width > 0)
- {
- int bar_area_x = WINDOW_SCROLL_BAR_AREA_X (w);
- int bar_area_width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
- * FRAME_COLUMN_WIDTH (f));
-
- if (bx < 0)
- {
- /* Bitmap fills the fringe. */
- if (bar_area_x + bar_area_width == p->x)
- bx = bar_area_x + sb_width;
- else if (p->x + p->wd == bar_area_x)
- bx = bar_area_x;
- if (bx >= 0)
- {
- int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w);
-
- nx = bar_area_width - sb_width;
- by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height,
- row->y));
- ny = row->visible_height;
- }
- }
- else
- {
- if (bar_area_x + bar_area_width == bx)
- {
- bx = bar_area_x + sb_width;
- nx += bar_area_width - sb_width;
- }
- else if (bx + nx == bar_area_x)
- nx += bar_area_width - sb_width;
- }
- }
- }
-#endif
- if (bx >= 0 && nx > 0)
- XFillRectangle (display, window, face->gc, bx, by, nx, ny);
+ XFillRectangle (display, window, face->gc,
+ p->bx, p->by, p->nx, p->ny);
if (!face->stipple)
XSetForeground (display, face->gc, face->foreground);
@@ -2947,7 +2912,7 @@ XTflash (struct frame *f)
#endif
{
/* Get the height not including a menu bar widget. */
- int height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, FRAME_LINES (f));
+ int height = FRAME_PIXEL_HEIGHT (f);
/* Height of each line to flash. */
int flash_height = FRAME_LINE_HEIGHT (f);
/* These will be the left and right margins of the rectangles. */
@@ -3107,34 +3072,6 @@ x_scroll_run (struct window *w, struct run *run)
fringe of W. */
window_box (w, ANY_AREA, &x, &y, &width, &height);
-#ifdef USE_TOOLKIT_SCROLL_BARS
- /* If the fringe is adjacent to the left (right) scroll bar of a
- leftmost (rightmost, respectively) window, then extend its
- background to the gap between the fringe and the bar. */
- if ((WINDOW_LEFTMOST_P (w)
- && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
- || (WINDOW_RIGHTMOST_P (w)
- && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)))
- {
- int sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
-
- if (sb_width > 0)
- {
- int bar_area_x = WINDOW_SCROLL_BAR_AREA_X (w);
- int bar_area_width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
- * FRAME_COLUMN_WIDTH (f));
-
- if (bar_area_x + bar_area_width == x)
- {
- x = bar_area_x + sb_width;
- width += bar_area_width - sb_width;
- }
- else if (x + width == bar_area_x)
- width += bar_area_width - sb_width;
- }
- }
-#endif
-
from_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->current_y);
to_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->desired_y);
bottom_y = y + height;
@@ -3528,7 +3465,7 @@ x_detect_focus_change (struct x_display_info *dpyinfo, struct frame *frame,
}
-#if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK
+#if !defined USE_X_TOOLKIT && !defined USE_GTK
/* Handle an event saying the mouse has moved out of an Emacs frame. */
void
@@ -4945,7 +4882,7 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
/* Clear the area of W that will serve as a scroll bar. This is
for the case that a window has been split horizontally. In
this case, no clear_frame is generated to reduce flickering. */
- if (width > 0 && height > 0)
+ if (width > 0 && window_box_height (w) > 0)
x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
left, top, width, window_box_height (w));
@@ -4971,7 +4908,6 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
bar->start = 0;
bar->end = 0;
bar->dragging = -1;
- bar->fringe_extended_p = 0;
#if defined (USE_TOOLKIT_SCROLL_BARS) && defined (USE_LUCID)
bar->last_seen_part = scroll_bar_nowhere;
#endif
@@ -5147,44 +5083,17 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
struct frame *f = XFRAME (w->frame);
Lisp_Object barobj;
struct scroll_bar *bar;
- int top, height, left, sb_left, width, sb_width;
+ int top, height, left, width;
int window_y, window_height;
-#ifdef USE_TOOLKIT_SCROLL_BARS
- bool fringe_extended_p;
-#endif
/* Get window dimensions. */
window_box (w, ANY_AREA, 0, &window_y, 0, &window_height);
top = window_y;
- width = WINDOW_CONFIG_SCROLL_BAR_COLS (w) * FRAME_COLUMN_WIDTH (f);
height = window_height;
- /* Compute the left edge of the scroll bar area. */
+ /* Compute the left edge and the width of the scroll bar area. */
left = WINDOW_SCROLL_BAR_AREA_X (w);
-
- /* Compute the width of the scroll bar which might be less than
- the width of the area reserved for the scroll bar. */
- if (WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) > 0)
- sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
- else
- sb_width = width;
-
- /* Compute the left edge of the scroll bar. */
-#ifdef USE_TOOLKIT_SCROLL_BARS
- if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
- sb_left = left + (WINDOW_RIGHTMOST_P (w) ? width - sb_width : 0);
- else
- sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width);
-#else
- if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
- sb_left = left + width - sb_width;
- else
- sb_left = left;
-#endif
-
-#ifdef USE_TOOLKIT_SCROLL_BARS
- fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (w);
-#endif
+ width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
/* Does the scroll bar exist yet? */
if (NILP (w->vertical_scroll_bar))
@@ -5192,18 +5101,12 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
if (width > 0 && height > 0)
{
block_input ();
-#ifdef USE_TOOLKIT_SCROLL_BARS
- if (fringe_extended_p)
- x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- sb_left, top, sb_width, height);
- else
-#endif
- x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- left, top, width, height);
+ x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ left, top, width, height);
unblock_input ();
}
- bar = x_scroll_bar_create (w, top, sb_left, sb_width, height);
+ bar = x_scroll_bar_create (w, top, left, width, max (height, 1));
}
else
{
@@ -5214,11 +5117,11 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
block_input ();
- if (sb_left != bar->left)
+ if (left != bar->left)
mask |= CWX;
if (top != bar->top)
mask |= CWY;
- if (sb_width != bar->width)
+ if (width != bar->width)
mask |= CWWidth;
if (height != bar->height)
mask |= CWHeight;
@@ -5226,55 +5129,31 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
#ifdef USE_TOOLKIT_SCROLL_BARS
/* Move/size the scroll bar widget. */
- if (mask || bar->fringe_extended_p != fringe_extended_p)
+ if (mask)
{
/* Since toolkit scroll bars are smaller than the space reserved
for them on the frame, we have to clear "under" them. */
if (width > 0 && height > 0)
- {
- if (fringe_extended_p)
- x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- sb_left, top, sb_width, height);
- else
- x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- left, top, width, height);
- }
+ x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ left, top, width, height);
#ifdef USE_GTK
xg_update_scrollbar_pos (f, bar->x_window, top,
- sb_left, sb_width, max (height, 1));
+ left, width, max (height, 1));
#else /* not USE_GTK */
XtConfigureWidget (SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar),
- sb_left, top, sb_width, max (height, 1), 0);
+ left, top, width, max (height, 1), 0);
#endif /* not USE_GTK */
}
#else /* not USE_TOOLKIT_SCROLL_BARS */
- /* Clear areas not covered by the scroll bar because it's not as
- wide as the area reserved for it. This makes sure a
- previous mode line display is cleared after C-x 2 C-x 1, for
- example. */
- {
- int area_width = WINDOW_CONFIG_SCROLL_BAR_COLS (w) * FRAME_COLUMN_WIDTH (f);
- int rest = area_width - sb_width;
- if (rest > 0 && height > 0)
- {
- if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
- x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- left + area_width - rest, top, rest, height);
- else
- x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- left, top, rest, height);
- }
- }
-
/* Move/size the scroll bar window. */
if (mask)
{
XWindowChanges wc;
- wc.x = sb_left;
+ wc.x = left;
wc.y = top;
- wc.width = sb_width;
+ wc.width = width;
wc.height = height;
XConfigureWindow (FRAME_X_DISPLAY (f), bar->x_window,
mask, &wc);
@@ -5283,17 +5162,15 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
#endif /* not USE_TOOLKIT_SCROLL_BARS */
/* Remember new settings. */
- bar->left = sb_left;
+ bar->left = left;
bar->top = top;
- bar->width = sb_width;
+ bar->width = width;
bar->height = height;
unblock_input ();
}
#ifdef USE_TOOLKIT_SCROLL_BARS
- bar->fringe_extended_p = fringe_extended_p;
-
x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole);
#else /* not USE_TOOLKIT_SCROLL_BARS */
/* Set the scroll bar's current state, unless we're currently being
@@ -5774,7 +5651,7 @@ static void xembed_send_message (struct frame *f, Time,
*FINISH is X_EVENT_DROP if event should not be passed to the toolkit.
*EVENT is unchanged unless we're processing KeyPress event.
- We return the number of characters stored into the buffer. */
+ We return the number of characters stored into the buffer. */
static int
handle_one_xevent (struct x_display_info *dpyinfo,
@@ -6202,7 +6079,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
SET_FRAME_GARBAGED (f);
/* Check if fullscreen was specified before we where mapped the
- first time, i.e. from the command line. */
+ first time, i.e. from the command line. */
if (!f->output_data.x->has_been_visible)
x_check_fullscreen (f);
@@ -6722,8 +6599,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
{
#ifndef USE_X_TOOLKIT
#ifndef USE_GTK
- int rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, event->xconfigure.height);
- int columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, event->xconfigure.width);
+ int width = FRAME_PIXEL_TO_TEXT_WIDTH (f, event->xconfigure.width);
+ int height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, event->xconfigure.height);
/* In the toolkit version, change_frame_size
is called by the code that handles resizing
@@ -6732,12 +6609,12 @@ handle_one_xevent (struct x_display_info *dpyinfo,
/* Even if the number of character rows and columns has
not changed, the font size may have changed, so we need
to check the pixel dimensions as well. */
- if (columns != FRAME_COLS (f)
- || rows != FRAME_LINES (f)
+ if (width != FRAME_TEXT_WIDTH (f)
+ || height != FRAME_TEXT_HEIGHT (f)
|| event->xconfigure.width != FRAME_PIXEL_WIDTH (f)
|| event->xconfigure.height != FRAME_PIXEL_HEIGHT (f))
{
- change_frame_size (f, rows, columns, 0, 1, 0);
+ change_frame_size (f, width, height, 0, 1, 0, 1);
SET_FRAME_GARBAGED (f);
cancel_mouse_face (f);
}
@@ -6968,8 +6845,6 @@ handle_one_xevent (struct x_display_info *dpyinfo,
return count;
}
-#if defined USE_GTK || defined USE_X_TOOLKIT
-
/* Handles the XEvent EVENT on display DISPLAY.
This is used for event loops outside the normal event handling,
i.e. looping while a popup menu or a dialog is posted.
@@ -6988,8 +6863,6 @@ x_dispatch_event (XEvent *event, Display *display)
return finish;
}
-#endif
-
/* Read events coming from the X server.
Return as soon as there are no more events to be read.
@@ -7008,9 +6881,6 @@ XTread_socket (struct terminal *terminal, struct input_event *hold_quit)
block_input ();
- /* So people can tell when we have read the available input. */
- input_signal_count++;
-
/* For debugging, this gives a way to fake an I/O error. */
if (dpyinfo == XTread_socket_fake_io_error)
{
@@ -7822,12 +7692,15 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0)
{
int wid = FRAME_COLUMN_WIDTH (f);
+
FRAME_CONFIG_SCROLL_BAR_COLS (f)
= (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid-1) / wid;
}
else
{
int wid = FRAME_COLUMN_WIDTH (f);
+
+ FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = 14;
FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;
}
@@ -7837,7 +7710,8 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
doing it because it's done in Fx_show_tip, and it leads to
problems because the tip frame has no widget. */
if (NILP (tip_frame) || XFRAME (tip_frame) != f)
- x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
+ x_set_window_size (f, 0, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
+ FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 1);
}
#ifdef HAVE_X_I18N
@@ -8652,11 +8526,11 @@ x_wait_for_event (struct frame *f, int eventtype)
size changes. Otherwise we leave the window gravity unchanged. */
static void
-x_set_window_size_1 (struct frame *f, int change_gravity, int cols, int rows)
+x_set_window_size_1 (struct frame *f, int change_gravity, int width, int height, bool pixelwise)
{
int pixelwidth, pixelheight;
- check_frame_size (f, &rows, &cols);
+ check_frame_size (f, &width, &height, pixelwise);
f->scroll_bar_actual_width
= (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)
? 0
@@ -8664,9 +8538,11 @@ x_set_window_size_1 (struct frame *f, int change_gravity, int cols, int rows)
compute_fringe_widths (f, 0);
- pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols)
+ pixelwidth =
+ (pixelwise ? width : FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width))
+ FRAME_TOOLBAR_WIDTH (f);
- pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows)
+ pixelheight =
+ (pixelwise ? height : FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height))
+ FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
if (change_gravity) f->win_gravity = NorthWestGravity;
@@ -8702,7 +8578,7 @@ x_set_window_size_1 (struct frame *f, int change_gravity, int cols, int rows)
x_wait_for_event (f, ConfigureNotify);
else
{
- change_frame_size (f, rows, cols, 0, 1, 0);
+ change_frame_size (f, width, height, 0, 1, 0, 1);
FRAME_PIXEL_WIDTH (f) = pixelwidth;
FRAME_PIXEL_HEIGHT (f) = pixelheight;
x_sync (f);
@@ -8716,17 +8592,19 @@ x_set_window_size_1 (struct frame *f, int change_gravity, int cols, int rows)
Otherwise we leave the window gravity unchanged. */
void
-x_set_window_size (struct frame *f, int change_gravity, int cols, int rows)
+x_set_window_size (struct frame *f, int change_gravity, int width, int height, bool pixelwise)
{
block_input ();
+ check_frame_size (f, &width, &height, pixelwise);
+
if (NILP (tip_frame) || XFRAME (tip_frame) != f)
{
- int r, c;
+ int text_width, text_height;
/* When the frame is maximized/fullscreen or running under for
example Xmonad, x_set_window_size_1 will be a no-op.
- In that case, the right thing to do is extend rows/cols to
+ In that case, the right thing to do is extend rows/width to
the current frame size. We do that first if x_set_window_size_1
turns out to not be a no-op (there is no way to know).
The size will be adjusted again if the frame gets a
@@ -8737,23 +8615,27 @@ x_set_window_size (struct frame *f, int change_gravity, int cols, int rows)
is however. */
pixelh -= FRAME_MENUBAR_HEIGHT (f);
#endif
- r = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelh);
+ text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, FRAME_PIXEL_WIDTH (f));
+ text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, pixelh);
/* Update f->scroll_bar_actual_width because it is used in
FRAME_PIXEL_WIDTH_TO_TEXT_COLS. */
f->scroll_bar_actual_width
= FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
- c = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, FRAME_PIXEL_WIDTH (f));
- change_frame_size (f, r, c, 0, 1, 0);
+ change_frame_size (f, text_width, text_height, 0, 1, 0, 1);
}
#ifdef USE_GTK
if (FRAME_GTK_WIDGET (f))
- xg_frame_set_char_size (f, cols, rows);
+ if (! pixelwise)
+ xg_frame_set_char_size (f, width * FRAME_COLUMN_WIDTH (f),
+ height * FRAME_LINE_HEIGHT (f));
+ else
+ xg_frame_set_char_size (f, width, height);
else
- x_set_window_size_1 (f, change_gravity, cols, rows);
+ x_set_window_size_1 (f, change_gravity, width, height, pixelwise);
#else /* not USE_GTK */
- x_set_window_size_1 (f, change_gravity, cols, rows);
+ x_set_window_size_1 (f, change_gravity, width, height, pixelwise);
#endif /* not USE_GTK */
@@ -8929,9 +8811,6 @@ void
x_make_frame_visible (struct frame *f)
{
int original_top, original_left;
- int retry_count = 2;
-
- retry:
block_input ();
@@ -8980,7 +8859,6 @@ x_make_frame_visible (struct frame *f)
so that incoming events are handled. */
{
Lisp_Object frame;
- int count;
/* This must be before UNBLOCK_INPUT
since events that arrive in response to the actions above
will set it when they are handled. */
@@ -9034,46 +8912,18 @@ x_make_frame_visible (struct frame *f)
XSETFRAME (frame, f);
- /* Wait until the frame is visible. Process X events until a
- MapNotify event has been seen, or until we think we won't get a
- MapNotify at all.. */
- for (count = input_signal_count + 10;
- input_signal_count < count && !FRAME_VISIBLE_P (f);)
+ /* Process X events until a MapNotify event has been seen. */
+ while (!FRAME_VISIBLE_P (f))
{
/* Force processing of queued events. */
x_sync (f);
-
- /* Machines that do polling rather than SIGIO have been
- observed to go into a busy-wait here. So we'll fake an
- alarm signal to let the handler know that there's something
- to be read. We used to raise a real alarm, but it seems
- that the handler isn't always enabled here. This is
- probably a bug. */
- if (input_polling_used ())
+ if (XPending (FRAME_X_DISPLAY (f)))
{
- /* It could be confusing if a real alarm arrives while
- processing the fake one. Turn it off and let the
- handler reset it. */
- int old_poll_suppress_count = poll_suppress_count;
- poll_suppress_count = 1;
- poll_for_input_1 ();
- poll_suppress_count = old_poll_suppress_count;
+ XEvent xev;
+ XNextEvent (FRAME_X_DISPLAY (f), &xev);
+ x_dispatch_event (&xev, FRAME_X_DISPLAY (f));
}
}
-
- /* 2000-09-28: In
-
- (let ((f (selected-frame)))
- (iconify-frame f)
- (raise-frame f))
-
- the frame is not raised with various window managers on
- FreeBSD, GNU/Linux and Solaris. It turns out that, for some
- unknown reason, the call to XtMapWidget is completely ignored.
- Mapping the widget a second time works. */
-
- if (!FRAME_VISIBLE_P (f) && --retry_count != 0)
- goto retry;
}
}
@@ -9439,7 +9289,7 @@ x_wm_set_size_hint (struct frame *f, long flags, bool user_position)
base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0);
base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0);
- check_frame_size (f, &min_rows, &min_cols);
+ check_frame_size (f, &min_cols, &min_rows, 0);
/* The window manager uses the base width hints to calculate the
current number of rows and columns in the frame while
@@ -10352,6 +10202,7 @@ static struct redisplay_interface x_redisplay_interface =
x_clear_frame_area,
x_draw_window_cursor,
x_draw_vertical_window_border,
+ x_draw_window_divider,
x_shift_glyphs_for_insert
};
diff --git a/src/xterm.h b/src/xterm.h
index 753debff1bb..3d954fb8600 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -84,11 +84,6 @@ typedef GtkWidget *xt_or_gtk_widget;
#define WHITE_PIX_DEFAULT(f) \
WhitePixel (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f))
-#define FONT_WIDTH(f) ((f)->max_width)
-#define FONT_HEIGHT(f) ((f)->ascent + (f)->descent)
-#define FONT_BASE(f) ((f)->ascent)
-#define FONT_DESCENT(f) ((f)->descent)
-
/* The mask of events that text windows always want to receive. This
includes mouse movement events, since handling the mouse-font text property
means that we must track mouse motion all the time. */
@@ -549,6 +544,7 @@ struct x_output
Cursor hand_cursor;
Cursor hourglass_cursor;
Cursor horizontal_drag_cursor;
+ Cursor vertical_drag_cursor;
Cursor current_cursor;
/* Window whose cursor is hourglass_cursor. This window is temporarily
@@ -811,10 +807,6 @@ struct scroll_bar
/* Last scroll bar part seen in xaw_jump_callback and xaw_scroll_callback. */
enum scroll_bar_part last_seen_part;
#endif
-
- /* 1 if the background of the fringe that is adjacent to a scroll
- bar is extended to the gap between the fringe and the bar. */
- unsigned fringe_extended_p : 1;
};
/* Turning a lisp vector value into a pointer to a struct scroll_bar. */
@@ -930,7 +922,7 @@ extern void x_check_errors (Display *, const char *)
extern bool x_had_errors_p (Display *);
extern void x_uncatch_errors (void);
extern void x_clear_errors (Display *);
-extern void x_set_window_size (struct frame *, int, int, int);
+extern void x_set_window_size (struct frame *, int, int, int, bool);
extern void x_set_mouse_position (struct frame *, int, int);
extern void x_set_mouse_pixel_position (struct frame *, int, int);
extern void xembed_request_focus (struct frame *);
@@ -949,13 +941,11 @@ extern bool x_alloc_lighter_color_for_widget (Widget, Display *, Colormap,
extern bool x_alloc_nearest_color (struct frame *, Colormap, XColor *);
extern void x_query_color (struct frame *f, XColor *);
extern void x_clear_area (Display *, Window, int, int, int, int);
-#if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK
+#if !defined USE_X_TOOLKIT && !defined USE_GTK
extern void x_mouse_leave (struct x_display_info *);
#endif
-#ifdef USE_X_TOOLKIT
extern int x_dispatch_event (XEvent *, Display *);
-#endif
extern int x_x_to_emacs_modifiers (struct x_display_info *, int);
extern int x_display_pixel_height (struct x_display_info *);
extern int x_display_pixel_width (struct x_display_info *);
@@ -963,7 +953,7 @@ extern int x_display_pixel_width (struct x_display_info *);
extern void x_set_sticky (struct frame *, Lisp_Object, Lisp_Object);
extern void x_wait_for_event (struct frame *, int);
-/* Defined in xselect.c */
+/* Defined in xselect.c. */
extern void x_handle_property_notify (const XPropertyEvent *);
extern void x_handle_selection_notify (const XSelectionEvent *);
diff --git a/test/ChangeLog b/test/ChangeLog
index 79d9ab544e0..bb2caea6a7c 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,95 @@
+2013-12-05 Michael Albinus <michael.albinus@gmx.de>
+
+ * automated/dbus-tests.el: New file.
+
+2013-12-05 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * automated/regexp-tests.el: New file.
+
+2013-11-29 Eli Zaretskii <eliz@gnu.org>
+
+ * automated/reftex-tests.el (reftex-parse-from-file-test):
+ Run temp-dir through file-truename, to make sure the temporary file
+ names are comparable as strings.
+
+ * automated/decoder-tests.el (ert-test-decoder-prefer-utf-8):
+ Force Unix EOLs by using 'utf-8-unix', since the default of
+ 'utf-8' is system-dependent, while the test expects to see Unix EOLs.
+
+2013-11-28 Glenn Morris <rgm@gnu.org>
+
+ * automated/Makefile.in (SEPCHAR): Use in place of PATH_SEP.
+
+2013-11-28 Eli Zaretskii <eliz@gnu.org>
+
+ * automated/Makefile.in (PATH_SEP): Set this instead of PATH_SEPARATOR.
+ (EMACSOPT): Use $(PATH_SEP).
+
+2013-11-28 Michael Albinus <michael.albinus@gmx.de>
+
+ * automated/file-notify-tests.el (auto-revert-stop-on-user-input):
+ Set to nil.
+
+2013-11-27 Michael Albinus <michael.albinus@gmx.de>
+
+ * automated/file-notify-tests.el
+ (file-notify-test-remote-temporary-file-directory):
+ Check $REMOTE_TEMPORARY_FILE_DIRECTORY.
+ (tramp-read-passwd): Check $REMOTE_ALLOW_PASSWORD.
+ (file-notify--deftest-remote): Cleanup connection initially.
+ (file-notify-test03-autorevert): Run also in batch mode. Use a
+ larger timeout for remote files. `sit-for' 1 second; 0.1 second
+ does not work on MS Windows. Call `accept-process-output' for
+ remote files. Apply `string-match' instead of `string-equal', the
+ messages are different on MS Windows.
+
+ * automated/tramp-tests.el (tramp-test-temporary-file-directory):
+ Use $REMOTE_TEMPORARY_FILE_DIRECTORY.
+ (tramp-read-passwd): Check $REMOTE_ALLOW_PASSWORD.
+
+2013-11-23 Glenn Morris <rgm@gnu.org>
+
+ * automated/python-tests.el (python-shell-make-comint-1)
+ (python-shell-make-comint-2, python-shell-get-process-1):
+ Suppress creation of some temp-files.
+
+ * automated/python-tests.el (python-shell-parse-command-1)
+ (python-shell-make-comint-1, python-shell-make-comint-2)
+ (python-shell-get-process-1)
+ (python-shell-internal-get-or-create-process-1):
+ Skip rather than fail if prereqs not found.
+
+ * automated/Makefile.in (emacs):
+ Empty EMACSLOADPATH rather than unsetting.
+
+2013-11-22 Glenn Morris <rgm@gnu.org>
+
+ * automated/ruby-mode-tests.el (ruby-exit!-font-lock):
+ Set expected-result.
+
+2013-11-21 Glenn Morris <rgm@gnu.org>
+
+ * automated/Makefile.in (XARGS_LIMIT): New, set by configure.
+ (compile-main): Pass XARGS_LIMIT to xargs.
+
+ * automated/Makefile.in (PATH_SEPARATOR): New, set by configure.
+ (EMACSOPT): Use PATH_SEPARATOR.
+
+2013-11-20 Bozhidar Batsov <bozhidar@batsov.com>
+
+ * test/automated/ruby-mode-tests.el (ruby-exit!-font-lock):
+ Add a failing test for Bug#15874.
+ * test/automated/ruby-mode-tests.el
+ (ruby--insert-coding-comment-ruby-style)
+ (ruby--insert-coding-comment-emacs-style)
+ (ruby--insert-coding-comment-custom-style):
+ Add a few tests for `ruby--insert-coding-comment'.
+
+2013-11-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ Improve API of recently-added bool vector functions (Bug#15912).
+ * automated/data-tests.el: Adjust to API changes.
+
2013-11-16 Michael Albinus <michael.albinus@gmx.de>
* automated/tramp-tests.el (tramp-test07-file-exists-p)
@@ -29,8 +121,7 @@
(tramp-test22-file-times, tramp-test23-visited-file-modtime)
(tramp-test24-file-name-completion, tramp-test25-load)
(tramp-test26-process-file, tramp-test27-start-file-process):
- (tramp-test28-shell-command): Protect unwindforms with
- `ignore-errors'.
+ (tramp-test28-shell-command): Protect unwindforms with `ignore-errors'.
(tramp-test29-utf8): New test.
2013-11-13 Michael Albinus <michael.albinus@gmx.de>
diff --git a/test/automated/Makefile.in b/test/automated/Makefile.in
index 617768995f1..ede81960237 100644
--- a/test/automated/Makefile.in
+++ b/test/automated/Makefile.in
@@ -22,21 +22,28 @@ SHELL = @SHELL@
srcdir = @srcdir@
VPATH = $(srcdir)
+SEPCHAR = @SEPCHAR@
+
+# Empty for all systems except MinGW, where xargs needs an explicit
+# limitation.
+XARGS_LIMIT = @XARGS_LIMIT@
+
# We never change directory before running Emacs, so a relative file
# name is fine, and makes life easier. If we need to change
# directory, we can use emacs --chdir.
EMACS = ../../src/emacs
# Command line flags for Emacs.
-EMACSOPT = -batch --no-site-file --no-site-lisp -L :$(srcdir)
+# Apparently MSYS bash would convert "-L :" to "-L ;" anyway,
+# but we might as well be explicit.
+EMACSOPT = -batch --no-site-file --no-site-lisp -L "$(SEPCHAR)$(srcdir)"
# Extra flags to pass to the byte compiler.
BYTE_COMPILE_EXTRA_FLAGS =
# The actual Emacs command run in the targets below.
# Prevent any setting of EMACSLOADPATH in user environment causing problems.
-emacs = unset EMACSLOADPATH; \
- LC_ALL=C EMACS_TEST_DIRECTORY=$(srcdir) "$(EMACS)" $(EMACSOPT)
+emacs = EMACSLOADPATH= LC_ALL=C EMACS_TEST_DIRECTORY=$(srcdir) "$(EMACS)" $(EMACSOPT)
# Common command to find subdirectories
setwins=for file in `find $(srcdir) -type d -print`; do \
@@ -72,7 +79,7 @@ compile-main: compile-clean
test -f $$el || continue; \
test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \
echo "$${el}c"; \
- done | xargs echo | \
+ done | xargs $(XARGS_LIMIT) echo | \
while read chunk; do \
$(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \
done
diff --git a/test/automated/data-tests.el b/test/automated/data-tests.el
index d79e1643848..f731b8bf1db 100644
--- a/test/automated/data-tests.el
+++ b/test/automated/data-tests.el
@@ -77,42 +77,40 @@
;; Bool vector tests. Compactly represent bool vectors as hex
;; strings.
-(ert-deftest bool-vector-count-matches-all-0-nil ()
+(ert-deftest bool-vector-count-population-all-0-nil ()
(cl-loop for sz in '(0 45 1 64 9 344)
do (let* ((bv (make-bool-vector sz nil)))
(should
- (eql
- (bool-vector-count-matches bv nil)
- sz)))))
+ (zerop
+ (bool-vector-count-population bv))))))
-(ert-deftest bool-vector-count-matches-all-0-t ()
+(ert-deftest bool-vector-count-population-all-1-t ()
(cl-loop for sz in '(0 45 1 64 9 344)
- do (let* ((bv (make-bool-vector sz nil)))
+ do (let* ((bv (make-bool-vector sz t)))
(should
(eql
- (bool-vector-count-matches bv t)
- 0)))))
+ (bool-vector-count-population bv)
+ sz)))))
-(ert-deftest bool-vector-count-matches-1-nil ()
+(ert-deftest bool-vector-count-population-1-nil ()
(let* ((bv (make-bool-vector 45 nil)))
(aset bv 40 t)
(aset bv 0 t)
(should
(eql
- (bool-vector-count-matches bv t)
- 2)))
- )
+ (bool-vector-count-population bv)
+ 2))))
-(ert-deftest bool-vector-count-matches-1-t ()
- (let* ((bv (make-bool-vector 45 nil)))
- (aset bv 40 t)
- (aset bv 0 t)
+(ert-deftest bool-vector-count-population-1-t ()
+ (let* ((bv (make-bool-vector 45 t)))
+ (aset bv 40 nil)
+ (aset bv 0 nil)
(should
(eql
- (bool-vector-count-matches bv nil)
+ (bool-vector-count-population bv)
43))))
-(defun mock-bool-vector-count-matches-at (a b i)
+(defun mock-bool-vector-count-consecutive (a b i)
(loop for i from i below (length a)
while (eq (aref a i) b)
sum 1))
@@ -147,8 +145,8 @@
(nreverse nibbles)
"")))
-(defun test-bool-vector-count-matches-at-tc (desc)
- "Run a test case for bool-vector-count-matches-at.
+(defun test-bool-vector-count-consecutive-tc (desc)
+ "Run a test case for bool-vector-count-consecutive.
DESC is a string describing the test. It is a sequence of
hexadecimal digits describing the bool vector. We exhaustively
test all counts at all possible positions in the vector by
@@ -158,8 +156,8 @@ comparing the subr with a much slower lisp implementation."
for lf in '(nil t)
do (loop
for pos from 0 upto (length bv)
- for cnt = (mock-bool-vector-count-matches-at bv lf pos)
- for rcnt = (bool-vector-count-matches-at bv lf pos)
+ for cnt = (mock-bool-vector-count-consecutive bv lf pos)
+ for rcnt = (bool-vector-count-consecutive bv lf pos)
unless (eql cnt rcnt)
do (error "FAILED testcase %S %3S %3S %3S"
pos lf cnt rcnt)))))
@@ -182,8 +180,8 @@ comparing the subr with a much slower lisp implementation."
"0000000000000000000000000"
"FFFFFFFFFFFFFFFF1"))
-(ert-deftest bool-vector-count-matches-at ()
- (mapc #'test-bool-vector-count-matches-at-tc
+(ert-deftest bool-vector-count-consecutive ()
+ (mapc #'test-bool-vector-count-consecutive-tc
bool-vector-test-vectors))
(defun test-bool-vector-apply-mock-op (mock a b c)
diff --git a/test/automated/dbus-tests.el b/test/automated/dbus-tests.el
new file mode 100644
index 00000000000..8f604f11f9e
--- /dev/null
+++ b/test/automated/dbus-tests.el
@@ -0,0 +1,136 @@
+;;; dbus-tests.el --- Tests of D-Bus integration into Emacs
+
+;; Copyright (C) 2013 Free Software Foundation, Inc.
+
+;; Author: Michael Albinus <michael.albinus@gmx.de>
+
+;; This program 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.
+;;
+;; This program 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 this program. If not, see `http://www.gnu.org/licenses/'.
+
+;;; Code:
+
+(require 'ert)
+(require 'dbus)
+
+(setq dbus-debug nil)
+
+(defvar dbus--test-enabled-session-bus
+ (and (featurep 'dbusbind)
+ (dbus-ignore-errors (dbus-get-unique-name :session)))
+ "Check, whether we are registered at the session bus.")
+
+(defvar dbus--test-enabled-system-bus
+ (and (featurep 'dbusbind)
+ (dbus-ignore-errors (dbus-get-unique-name :system)))
+ "Check, whether we are registered at the system bus.")
+
+(defun dbus--test-availability (bus)
+ "Test availability of D-Bus BUS."
+ (should (dbus-list-names bus))
+ (should (dbus-list-activatable-names bus))
+ (should (dbus-list-known-names bus))
+ (should (dbus-get-unique-name bus)))
+
+(ert-deftest dbus-test00-availability-session ()
+ "Test availability of D-Bus `:session'."
+ :expected-result (if dbus--test-enabled-session-bus :passed :failed)
+ (dbus--test-availability :session))
+
+(ert-deftest dbus-test00-availability-system ()
+ "Test availability of D-Bus `:system'."
+ :expected-result (if dbus--test-enabled-system-bus :passed :failed)
+ (dbus--test-availability :system))
+
+(ert-deftest dbus-test01-type-conversion ()
+ "Check type conversion functions."
+ (let ((ustr "0123abc_xyz\x01\xff")
+ (mstr "Grüß Göttin"))
+ (should
+ (string-equal
+ (dbus-byte-array-to-string (dbus-string-to-byte-array "")) ""))
+ (should
+ (string-equal
+ (dbus-byte-array-to-string (dbus-string-to-byte-array ustr)) ustr))
+ (should
+ (string-equal
+ (dbus-byte-array-to-string (dbus-string-to-byte-array mstr) 'multibyte)
+ mstr))
+ ;; Should not work for multibyte strings.
+ (should-not
+ (string-equal
+ (dbus-byte-array-to-string (dbus-string-to-byte-array mstr)) mstr))
+
+ (should
+ (string-equal
+ (dbus-unescape-from-identifier (dbus-escape-as-identifier "")) ""))
+ (should
+ (string-equal
+ (dbus-unescape-from-identifier (dbus-escape-as-identifier ustr)) ustr))
+ ;; Should not work for multibyte strings.
+ (should-not
+ (string-equal
+ (dbus-unescape-from-identifier (dbus-escape-as-identifier mstr)) mstr))))
+
+(defun dbus--test-register-service (bus)
+ "Check service registration at BUS."
+ ;; Cleanup.
+ (dbus-ignore-errors (dbus-unregister-service bus dbus-service-emacs))
+
+ ;; Register an own service.
+ (should (eq (dbus-register-service bus dbus-service-emacs) :primary-owner))
+ (should (dbus-ping bus dbus-service-emacs 100))
+ (should (eq (dbus-register-service bus dbus-service-emacs) :already-owner))
+ (should (dbus-ping bus dbus-service-emacs 100))
+
+ ;; Unregister the service.
+ (should (eq (dbus-unregister-service bus dbus-service-emacs) :released))
+ (should-not (dbus-ping bus dbus-service-emacs 100))
+ (should (eq (dbus-unregister-service bus dbus-service-emacs) :non-existent))
+ (should-not (dbus-ping bus dbus-service-emacs 100))
+
+ ;; `dbus-service-dbus' is reserved for the BUS itself.
+ (should-error (dbus-register-service bus dbus-service-dbus))
+ (should-error (dbus-unregister-service bus dbus-service-dbus)))
+
+(ert-deftest dbus-test02-register-service-session ()
+ "Check service registration at `:session'."
+ (skip-unless (and dbus--test-enabled-session-bus
+ (dbus-register-service :session dbus-service-emacs)))
+ (dbus--test-register-service :session)
+
+ (let ((service "org.freedesktop.Notifications"))
+ (when (dbus-ping :session service 100)
+ ;; Cleanup.
+ (dbus-ignore-errors (dbus-unregister-service :session service))
+
+ (should (eq (dbus-register-service :session service) :in-queue))
+ (should (eq (dbus-unregister-service :session service) :released))
+
+ (should
+ (eq (dbus-register-service :session service :do-not-queue) :exists))
+ (should (eq (dbus-unregister-service :session service) :not-owner)))))
+
+(ert-deftest dbus-test02-register-service-system ()
+ "Check service registration at `:system'."
+ (skip-unless (and dbus--test-enabled-system-bus
+ (dbus-register-service :system dbus-service-emacs)))
+ (dbus--test-register-service :system))
+
+(defun dbus-test-all (&optional interactive)
+ "Run all tests for \\[dbus]."
+ (interactive "p")
+ (funcall
+ (if interactive 'ert-run-tests-interactively 'ert-run-tests-batch) "^dbus"))
+
+(provide 'dbus-tests)
+;;; dbus-tests.el ends here
diff --git a/test/automated/decoder-tests.el b/test/automated/decoder-tests.el
index 2e99fd7f115..1326e95e3d6 100644
--- a/test/automated/decoder-tests.el
+++ b/test/automated/decoder-tests.el
@@ -247,7 +247,7 @@
'unix))
(latin (decoder-tests-gen-file "utf-8.el"
(decoder-tests-file-contents 'latin)
- 'utf-8)))
+ 'utf-8-unix)))
(should-not (decoder-tests-prefer-utf-8-read
ascii 'prefer-utf-8-unix nil))
(should-not (decoder-tests-prefer-utf-8-read
diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el
index e0852fb5705..b8d30ecf070 100644
--- a/test/automated/file-notify-tests.el
+++ b/test/automated/file-notify-tests.el
@@ -19,13 +19,17 @@
;;; Commentary:
-;; Some of the tests are intended to run over remote files. Set
-;; `file-notify-test-remote-temporary-file-directory' to a suitable
-;; value. It must NOT require an interactive password prompt, when
-;; running the tests in batch mode.
+;; Some of the tests require access to a remote host files. Set
+;; $REMOTE_TEMPORARY_FILE_DIRECTORY to a suitable value in order
+;; to overwrite the default value. If you want to skip tests
+;; accessing a remote host, set this environment variable to
+;; "/dev/null" or whatever is appropriate on your system.
-;; If you want to skip tests for remote files, set this variable to
-;; `null-device'.
+;; When running the tests in batch mode, it must NOT require an
+;; interactive password prompt unless the environment variable
+;; $REMOTE_ALLOW_PASSWORD is set.
+
+;; A whole test run can be performed calling the command `file-notify-test-all'.
;;; Code:
@@ -34,7 +38,10 @@
;; There is no default value on w32 systems, which could work out of the box.
(defconst file-notify-test-remote-temporary-file-directory
- (if (eq system-type 'windows-nt) null-device "/ssh::/tmp")
+ (cond
+ ((getenv "REMOTE_TEMPORARY_FILE_DIRECTORY"))
+ ((eq system-type 'windows-nt) null-device)
+ (t (format "/ssh::%s" temporary-file-directory)))
"Temporary directory for Tramp tests.")
(defvar file-notify--test-tmpfile nil)
@@ -45,7 +52,11 @@
(require 'tramp)
(setq tramp-verbose 0
tramp-message-show-message nil)
-(when noninteractive (defalias 'tramp-read-passwd 'ignore))
+
+;; Disable interactive passwords in batch mode.
+(when (and noninteractive (not (getenv "REMOTE_ALLOW_PASSWORD")))
+ (defalias 'tramp-read-passwd 'ignore))
+
;; This shall happen on hydra only.
(when (getenv "NIX_STORE")
(add-to-list 'tramp-remote-path 'tramp-own-remote-path))
@@ -96,6 +107,8 @@ being the result.")
;; That's why we skip only for failed local tests.
(skip-unless
(not (ert-test-failed-p (ert-test-most-recent-result ert-test))))
+ (tramp-cleanup-connection
+ (tramp-dissect-file-name temporary-file-directory) nil 'keep-password)
(funcall (ert-test-body ert-test)))))
(ert-deftest file-notify-test00-availability ()
@@ -219,20 +232,21 @@ Save the result in `file-notify--test-results', for later analysis."
(file-notify--deftest-remote file-notify-test02-events
"Check file creation/removal notifications for remote files.")
-;; autorevert runs only in interactive mode.
(defvar auto-revert-remote-files)
-(setq auto-revert-remote-files t)
+(defvar auto-revert-stop-on-user-input)
+(setq auto-revert-remote-files t
+ auto-revert-stop-on-user-input nil)
(require 'autorevert)
(ert-deftest file-notify-test03-autorevert ()
"Check autorevert via file notification.
This test is skipped in batch mode."
(skip-unless (file-notify--test-local-enabled))
- (skip-unless (not noninteractive))
;; `auto-revert-buffers' runs every 5". And we must wait, until the
;; file has been reverted.
- (let ((timeout 10)
- buf)
+ (let* ((remote (file-remote-p temporary-file-directory))
+ (timeout (if remote 60 10))
+ buf)
(unwind-protect
(progn
(setq file-notify--test-tmpfile (file-notify--test-make-temp-name))
@@ -247,7 +261,7 @@ This test is skipped in batch mode."
;; `auto-revert-buffers' runs every 5".
(with-timeout (timeout (ignore))
(while (null auto-revert-notify-watch-descriptor)
- (sit-for 0.1 'nodisplay)))
+ (sit-for 1 'nodisplay)))
;; Check, that file notification has been used.
(should auto-revert-mode)
@@ -269,8 +283,10 @@ This test is skipped in batch mode."
(null (string-match
(format "Reverting buffer `%s'." (buffer-name buf))
(buffer-string)))
- (sit-for 0.1 'nodisplay))))
- (should (string-equal (buffer-string) "another text"))))
+ ;; We must trigger the process filter to run.
+ (when remote (accept-process-output nil 1))
+ (sit-for 1 'nodisplay))))
+ (should (string-match "another text" (buffer-string)))))
;; Exit.
(ignore-errors (kill-buffer buf))
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el
index ef1c0155ab5..76a3add6bda 100644
--- a/test/automated/python-tests.el
+++ b/test/automated/python-tests.el
@@ -1448,9 +1448,7 @@ def f():
"Check the command to execute is calculated correctly.
Using `python-shell-interpreter' and
`python-shell-interpreter-args'."
- :expected-result (if (executable-find python-tests-shell-interpreter)
- :passed
- :failed)
+ (skip-unless (executable-find python-tests-shell-interpreter))
(let ((python-shell-interpreter (executable-find
python-tests-shell-interpreter))
(python-shell-interpreter-args "-B"))
@@ -1522,10 +1520,12 @@ Using `python-shell-interpreter' and
(ert-deftest python-shell-make-comint-1 ()
"Check comint creation for global shell buffer."
- :expected-result (if (executable-find python-tests-shell-interpreter)
- :passed
- :failed)
- (let* ((python-shell-interpreter
+ (skip-unless (executable-find python-tests-shell-interpreter))
+ ;; The interpreter can get killed too quickly to allow it to clean
+ ;; up the tempfiles that the default python-shell-setup-codes create,
+ ;; so it leaves tempfiles behind, which is a minor irritation.
+ (let* ((python-shell-setup-codes nil)
+ (python-shell-interpreter
(executable-find python-tests-shell-interpreter))
(proc-name (python-shell-get-process-name nil))
(shell-buffer
@@ -1544,10 +1544,9 @@ Using `python-shell-interpreter' and
(ert-deftest python-shell-make-comint-2 ()
"Check comint creation for internal shell buffer."
- :expected-result (if (executable-find python-tests-shell-interpreter)
- :passed
- :failed)
- (let* ((python-shell-interpreter
+ (skip-unless (executable-find python-tests-shell-interpreter))
+ (let* ((python-shell-setup-codes nil)
+ (python-shell-interpreter
(executable-find python-tests-shell-interpreter))
(proc-name (python-shell-internal-get-process-name))
(shell-buffer
@@ -1566,12 +1565,11 @@ Using `python-shell-interpreter' and
(ert-deftest python-shell-get-process-1 ()
"Check dedicated shell process preference over global."
- :expected-result (if (executable-find python-tests-shell-interpreter)
- :passed
- :failed)
+ (skip-unless (executable-find python-tests-shell-interpreter))
(python-tests-with-temp-file
""
- (let* ((python-shell-interpreter
+ (let* ((python-shell-setup-codes nil)
+ (python-shell-interpreter
(executable-find python-tests-shell-interpreter))
(global-proc-name (python-shell-get-process-name nil))
(dedicated-proc-name (python-shell-get-process-name t))
@@ -1627,9 +1625,7 @@ Using `python-shell-interpreter' and
(ert-deftest python-shell-internal-get-or-create-process-1 ()
"Check internal shell process creation fallback."
- :expected-result (if (executable-find python-tests-shell-interpreter)
- :passed
- :failed)
+ (skip-unless (executable-find python-tests-shell-interpreter))
(python-tests-with-temp-file
""
(should (not (process-live-p (python-shell-internal-get-process-name))))
diff --git a/test/automated/reftex-tests.el b/test/automated/reftex-tests.el
index de7f36d825a..0eb3be9fec9 100644
--- a/test/automated/reftex-tests.el
+++ b/test/automated/reftex-tests.el
@@ -95,7 +95,14 @@
(ert-deftest reftex-parse-from-file-test ()
"Test `reftex-parse-from-file'."
- (let* ((temp-dir (make-temp-file "reftex-parse" 'dir))
+ ;; Use file-truename to convert 8+3 aliases in $TEMP value on
+ ;; MS-Windows into their long file-name equivalents, which is
+ ;; necessary for the 'equal' and 'string=' comparisons below. This
+ ;; also resolves any symlinks, which cannot be bad for the same
+ ;; reason. (An alternative solution would be to use file-equal-p,
+ ;; but I'm too lazy to do that, as one of the tests compares a
+ ;; list.)
+ (let* ((temp-dir (file-truename (make-temp-file "reftex-parse" 'dir)))
(tex-file (expand-file-name "test.tex" temp-dir))
(bib-file (expand-file-name "ref.bib" temp-dir)))
(with-temp-buffer
diff --git a/test/automated/regexp-tests.el b/test/automated/regexp-tests.el
new file mode 100644
index 00000000000..5c4a3b48a63
--- /dev/null
+++ b/test/automated/regexp-tests.el
@@ -0,0 +1,31 @@
+;;; regexp-tests.el --- Test suite for regular expression handling.
+
+;; Copyright (C) 2013 Free Software Foundation, Inc.
+
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
+;; Keywords: internal
+;; Human-Keywords: internal
+
+;; 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:
+
+(ert-deftest regexp-test-regexp-opt ()
+ "Test the `compilation-error-regexp-alist' regexps.
+The test data is in `compile-tests--test-regexps-data'."
+ (should (string-match (regexp-opt-charset '(?^)) "a^b")))
+
+;;; regexp-tests.el ends here.
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el
index e84f55be93d..9c121169756 100644
--- a/test/automated/ruby-mode-tests.el
+++ b/test/automated/ruby-mode-tests.el
@@ -91,6 +91,9 @@ VALUES-PLIST is a list with alternating index and value elements."
(ert-deftest ruby-no-heredoc-inside-quotes ()
(ruby-assert-state "\"<<\", \"\",\nfoo" 3 nil))
+(ert-deftest ruby-exit!-font-lock ()
+ (ruby-assert-face "exit!" 5 font-lock-builtin-face))
+
(ert-deftest ruby-deep-indent ()
(let ((ruby-deep-arglist nil)
(ruby-deep-indent-paren '(?\( ?\{ ?\[ ?\] t)))
@@ -616,6 +619,26 @@ VALUES-PLIST is a list with alternating index and value elements."
(ruby-backward-sexp)
(should (= 2 (line-number-at-pos)))))
+(ert-deftest ruby--insert-coding-comment-ruby-style ()
+ (with-temp-buffer
+ (let ((ruby-encoding-magic-comment-style 'ruby))
+ (ruby--insert-coding-comment "utf-8")
+ (should (string= "# coding: utf-8\n" (buffer-string))))))
+
+(ert-deftest ruby--insert-coding-comment-emacs-style ()
+ (with-temp-buffer
+ (let ((ruby-encoding-magic-comment-style 'emacs))
+ (ruby--insert-coding-comment "utf-8")
+ (should (string= "# -*- coding: utf-8 -*-\n" (buffer-string))))))
+
+(ert-deftest ruby--insert-coding-comment-custom-style ()
+ (with-temp-buffer
+ (let ((ruby-encoding-magic-comment-style 'custom)
+ (ruby-custom-encoding-magic-comment-template "# encoding: %s\n"))
+ (ruby--insert-coding-comment "utf-8")
+ (should (string= "# encoding: utf-8\n\n" (buffer-string))))))
+
+
(provide 'ruby-mode-tests)
;;; ruby-mode-tests.el ends here
diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el
index 2bb815bda5a..c7087877126 100644
--- a/test/automated/tramp-tests.el
+++ b/test/automated/tramp-tests.el
@@ -22,14 +22,14 @@
;; The tests require a recent ert.el from Emacs 24.4.
;; Some of the tests require access to a remote host files. Set
-;; $TRAMP_TEST_TEMPORARY_FILE_DIRECTORY to a suitable value in order
+;; $REMOTE_TEMPORARY_FILE_DIRECTORY to a suitable value in order
;; to overwrite the default value. If you want to skip tests
;; accessing a remote host, set this environment variable to
;; "/dev/null" or whatever is appropriate on your system.
;; When running the tests in batch mode, it must NOT require an
;; interactive password prompt unless the environment variable
-;; $TRAMP_TEST_ALLOW_PASSWORD is set.
+;; $REMOTE_ALLOW_PASSWORD is set.
;; A whole test run can be performed calling the command `tramp-test-all'.
@@ -41,7 +41,7 @@
;; There is no default value on w32 systems, which could work out of the box.
(defconst tramp-test-temporary-file-directory
(cond
- ((getenv "TRAMP_TEST_TEMPORARY_FILE_DIRECTORY"))
+ ((getenv "REMOTE_TEMPORARY_FILE_DIRECTORY"))
((eq system-type 'windows-nt) null-device)
(t (format "/ssh::%s" temporary-file-directory)))
"Temporary directory for Tramp tests.")
@@ -50,7 +50,7 @@
tramp-message-show-message nil)
;; Disable interactive passwords in batch mode.
-(when (and noninteractive (not (getenv "TRAMP_TEST_ALLOW_PASSWORD")))
+(when (and noninteractive (not (getenv "REMOTE_ALLOW_PASSWORD")))
(defalias 'tramp-read-passwd 'ignore))
;; This shall happen on hydra only.
@@ -1193,6 +1193,12 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
;; * set-file-selinux-context
;; * vc-registered
+;; * Fix `tramp-test17-insert-directory' for
+;; `ls-lisp-insert-directory' ("plink" and friends).
+;; * Fix `tramp-test27-start-file-process' on MS Windows
+;; (`process-send-eof'?).
+;; * Fix `tramp-test29-utf8' on MS Windows.
+
(defun tramp-test-all (&optional interactive)
"Run all tests for \\[tramp]."
(interactive "p")