From 3b807f0d2dfdd28895e3b998bce2c06955faf030 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 13 Aug 2007 13:44:55 +0000 Subject: [PATCH 01/41] Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 242-244) - Update from CVS 2007-08-10 Katsumi Yamaoka * lisp/gnus/nntp.el (nntp-xref-number-is-evil): New server variable. (nntp-find-group-and-number): If it is non-nil, don't trust article numbers in the Xref header. 2007-08-06 Katsumi Yamaoka * lisp/gnus/gnus-ems.el (gnus-x-splash): Bind inhibit-read-only to t. 2007-08-04 Reiner Steib * lisp/gnus/gnus-art.el (article-hide-headers): Bind inhibit-read-only to t. 2007-08-10 Katsumi Yamaoka * man/gnus.texi (NNTP): Mention nntp-xref-number-is-evil. Revision: emacs@sv.gnu.org/emacs--rel--22--patch-92 --- lisp/gnus/ChangeLog | 14 ++++++++++++++ lisp/gnus/gnus-art.el | 2 +- lisp/gnus/gnus-ems.el | 2 +- lisp/gnus/nntp.el | 11 ++++++++++- man/ChangeLog | 4 ++++ man/gnus.texi | 28 ++++++++++++++++++++++++++++ 6 files changed, 58 insertions(+), 3 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 807a853ba56..7fd187a4aeb 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,17 @@ +2007-08-10 Katsumi Yamaoka + + * nntp.el (nntp-xref-number-is-evil): New server variable. + (nntp-find-group-and-number): If it is non-nil, don't trust article + numbers in the Xref header. + +2007-08-06 Katsumi Yamaoka + + * gnus-ems.el (gnus-x-splash): Bind inhibit-read-only to t. + +2007-08-04 Reiner Steib + + * gnus-art.el (article-hide-headers): Bind inhibit-read-only to t. + 2007-08-08 Glenn Morris * gmm-utils.el, gnus-async.el, gnus-msg.el, gnus-score.el diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 40de10187f3..6ccba3b108f 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -1743,7 +1743,7 @@ Initialized from `text-mode-syntax-table.") (interactive) ;; This function might be inhibited. (unless gnus-inhibit-hiding - (let ((inhibit-read-only nil) + (let ((inhibit-read-only t) (case-fold-search t) (max (1+ (length gnus-sorted-header-list))) (inhibit-point-motion-hooks t) diff --git a/lisp/gnus/gnus-ems.el b/lisp/gnus/gnus-ems.el index bacf5581e0d..88190b8085b 100644 --- a/lisp/gnus/gnus-ems.el +++ b/lisp/gnus/gnus-ems.el @@ -179,7 +179,7 @@ (interactive-p)) "*gnus-x-splash*" gnus-group-buffer))) - (let ((inhibit-read-only nil) + (let ((inhibit-read-only t) (file (nnheader-find-etc-directory "images/gnus/x-splash" t)) pixmap fcw fch width height fringes sbars left yoffset top ls) (erase-buffer) diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index 869213c9ae5..2623df58e4d 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el @@ -183,6 +183,14 @@ by one.") If the gap between two consecutive articles is bigger than this variable, split the XOVER request into two requests.") +(defvoo nntp-xref-number-is-evil nil + "*If non-nil, Gnus never trusts article numbers in the Xref header. +Some news servers, e.g., ones running Diablo, run multiple engines +having the same articles but article numbers are not kept synchronized +between them. If you connect to such a server, set this to a non-nil +value, and Gnus never uses article numbers (that appear in the Xref +header and vary by which engine is chosen) to refer to articles.") + (defvoo nntp-prepare-server-hook nil "*Hook run before a server is opened. If can be used to set up a server remotely, for instance. Say you @@ -1632,7 +1640,8 @@ password contained in '~/.nntp-authinfo'." (match-string 1 xref)) (t ""))) (cond - ((and (setq xref (mail-fetch-field "xref")) + ((and (not nntp-xref-number-is-evil) + (setq xref (mail-fetch-field "xref")) (string-match (if group (concat "\\(" (regexp-quote group) "\\):\\([0-9]+\\)") diff --git a/man/ChangeLog b/man/ChangeLog index 39895247477..479f25e7267 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2007-08-10 Katsumi Yamaoka + + * gnus.texi (NNTP): Mention nntp-xref-number-is-evil. + 2007-08-08 Glenn Morris * glossary.texi (Glossary): Deprecate `iff'. diff --git a/man/gnus.texi b/man/gnus.texi index ff8371df46c..94144b65e3f 100644 --- a/man/gnus.texi +++ b/man/gnus.texi @@ -12945,6 +12945,34 @@ network is fast, setting this variable to a really small number means that fetching will probably be slower. If this variable is @code{nil}, @code{nntp} will never split requests. The default is 5. +@item nntp-xref-number-is-evil +@vindex nntp-xref-number-is-evil +When Gnus refers to an article having the @code{Message-ID} that a user +specifies or having the @code{Message-ID} of the parent article of the +current one (@pxref{Finding the Parent}), Gnus sends a @code{HEAD} +command to the @acronym{NNTP} server to know where it is, and the server +returns the data containing the pairs of a group and an article number +in the @code{Xref} header. Gnus normally uses the article number to +refer to the article if the data shows that that article is in the +current group, while it uses the @code{Message-ID} otherwise. However, +some news servers, e.g., ones running Diablo, run multiple engines +having the same articles but article numbers are not kept synchronized +between them. In that case, the article number that appears in the +@code{Xref} header varies by which engine is chosen, so you cannot refer +to the parent article that is in the current group, for instance. If +you connect to such a server, set this variable to a non-@code{nil} +value, and Gnus never uses article numbers. For example: + +@lisp +(setq gnus-select-method + '(nntp "newszilla" + (nntp-address "newszilla.example.com") + (nntp-xref-number-is-evil t) + @dots{})) +@end lisp + +The default value of this server variable is @code{nil}. + @item nntp-prepare-server-hook @vindex nntp-prepare-server-hook A hook run before attempting to connect to an @acronym{NNTP} server. From 6dbb1e769f5ebeba6291fe21b7c6775a621b7504 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 14 Aug 2007 07:41:31 +0000 Subject: [PATCH 02/41] *** empty log message *** --- lisp/ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c26869f1327..923930900b7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2007-08-14 Glenn Morris + + * simple.el (bad-packages-alist): New constant. + (bad-package-check): New function. Together, these two add + elements to `after-load-alist' to check for problematic external + packages. + 2007-08-13 Stephen Leake * pcvs-parse.el (cvs-parse-table): Handle additional instance of From 0b964e141eeb14f92415e418cb7495cf4be49dbd Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 14 Aug 2007 07:45:48 +0000 Subject: [PATCH 03/41] (bad-packages-alist): New constant. (bad-package-check): New function. Together, these two add elements to `after-load-alist' to check for problematic external packages. --- etc/ChangeLog | 4 ++++ lisp/simple.el | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/etc/ChangeLog b/etc/ChangeLog index 26ead74bdbd..f1fd377f633 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2007-08-14 Glenn Morris + + * NEWS: Mention `bad-packages-alist'. + 2007-08-08 Glenn Morris * TODO: `iff' item is dealt with. diff --git a/lisp/simple.el b/lisp/simple.el index b71dffd3c35..eda86856275 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5605,6 +5605,57 @@ works by saving the value of `buffer-invisibility-spec' and setting it to nil." ; 'insert-in-front-hooks '(minibuffer-prompt-insertion))) ; + +;;;; Problematic external packages. + +;; rms says this should be done by specifying symbols that define +;; versions together with bad values. This is therefore not as +;; flexible as it could be. See the thread: +;; http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00300.html +(defconst bad-packages-alist + ;; Not sure exactly which semantic versions have problems. + ;; Definitely 2.0pre3, probably all 2.0pre's before this. + '((semantic semantic-version "2\.0pre[1-3]" + "The version of `semantic' loaded does not work in Emacs 22. +It can cause constant high CPU load. Upgrade to at least 2.0pre4.") + ;; CUA-mode does not work with GNU Emacs version 22.1 and newer. + ;; Except for version 1.2, all of the 1.x and 2.x version of cua-mode + ;; provided the `CUA-mode' feature. Since this is no longer true, + ;; we can warn the user if the `CUA-mode' feature is ever provided. + (CUA-mode t nil +"CUA-mode is now part of the standard GNU Emacs distribution, +so you can now enable CUA via the Options menu or by customizing `cua-mode'. + +You have loaded an older version of CUA-mode which does not work +correctly with this version of Emacs. You should remove the old +version and use the one distributed with Emacs.")) + "Alist of packages known to cause problems in this version of Emacs. +Each element has the form (PACKAGE SYMBOL REGEXP STRING). +PACKAGE is either a regular expression to match file names, or a +symbol (a feature name); see the documentation of +`after-load-alist', to which this variable adds functions. +SYMBOL is either the name of a string variable, or `t'. Upon +loading PACKAGE, if SYMBOL is t or matches REGEXP, display a +warning using STRING as the message.") + +(defun bad-package-check (package) + "Run a check using the element from `bad-packages-alist' matching PACKAGE." + (condition-case nil + (let* ((list (assoc package bad-packages-alist)) + (symbol (nth 1 list))) + (and list + (boundp symbol) + (or (eq symbol t) + (and (stringp (setq symbol (eval symbol))) + (string-match (nth 2 list) symbol))) + (display-warning :warning (nth 3 list)))) + (error nil))) + +(mapc (lambda (elem) + (eval-after-load (car elem) `(bad-package-check ',(car elem)))) + bad-packages-alist) + + (provide 'simple) ;; arch-tag: 24af67c0-2a49-44f6-b3b1-312d8b570dfd From 9000171fa9407a734902b9dfc1a0165e5be8341a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 14 Aug 2007 07:45:58 +0000 Subject: [PATCH 04/41] Mention `bad-packages-alist'. --- etc/NEWS | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 8e4d7f95f1c..c652703bcf1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -28,7 +28,8 @@ any older versions of these packages to ensure that the Emacs 22 version is used. You can use M-x list-load-path-shadows to find such older packages. -Some specific packages that are known to cause problems are: +Some specific packages that are known to cause problems are given +below. Emacs tries to warn you about these through `bad-packages-alist'. ** Semantic (used by CEDET, ECB, JDEE): upgrade to latest version. @@ -40,6 +41,9 @@ Some specific packages that are known to cause problems are: * Changes in Emacs 22.2 +** `bad-packages-alist' will warn about external packages that are known +to cause problems in this version of Emacs. + ** The values of `dired-recursive-deletes' and `dired-recursive-copies' have been changed to `top'. This means that the user is asked once, before deleting/copying the indicated directory recursively. From 290e2424e609c0105ec7db7458eb9eb795ff57cf Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 14 Aug 2007 08:42:11 +0000 Subject: [PATCH 05/41] Move CUA-mode check to `bad-packages-alist'. --- lisp/ChangeLog | 1 + lisp/emulation/cua-base.el | 17 ----------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 923930900b7..994b0b1349c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,6 +4,7 @@ (bad-package-check): New function. Together, these two add elements to `after-load-alist' to check for problematic external packages. + * emulation/cua-base.el: Move CUA-mode check to `bad-packages-alist'. 2007-08-13 Stephen Leake diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el index 9b18bb69d2e..e5410c272ff 100644 --- a/lisp/emulation/cua-base.el +++ b/lisp/emulation/cua-base.el @@ -1596,23 +1596,6 @@ shifted movement key, set `cua-highlight-region-shift-only'." (interactive) (setq cua--debug (not cua--debug))) -;; Install run-time check for older versions of CUA-mode which does not -;; work with GNU Emacs version 22.1 and newer. -;; -;; Except for version 1.2, all of the 1.x and 2.x version of cua-mode -;; provided the `CUA-mode' feature. Since this is no longer true, -;; we can warn the user if the `CUA-mode' feature is ever provided. - -;;;###autoload (eval-after-load 'CUA-mode -;;;###autoload '(error (concat "\n\n" -;;;###autoload "CUA-mode is now part of the standard GNU Emacs distribution, so you may\n" -;;;###autoload "now enable CUA via the Options menu or by customizing option `cua-mode'.\n\n" -;;;###autoload "You have loaded an older version of CUA-mode which does\n" -;;;###autoload "not work correctly with this version of GNU Emacs.\n\n" -;;;###autoload (if user-init-file (concat -;;;###autoload "To correct this, remove the loading and customization of the\n" -;;;###autoload "old version from the " user-init-file " file.\n\n"))))) - (provide 'cua) ;;; arch-tag: 21fb6289-ba25-4fee-bfdc-f9fb351acf05 From f7b949ad26c55deda9848987578fb946d1c52054 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 14 Aug 2007 08:47:44 +0000 Subject: [PATCH 06/41] (bad-packages-alist): Fix regexp typo in previous change. --- lisp/simple.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/simple.el b/lisp/simple.el index eda86856275..1ffa9a9ab23 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5615,7 +5615,7 @@ works by saving the value of `buffer-invisibility-spec' and setting it to nil." (defconst bad-packages-alist ;; Not sure exactly which semantic versions have problems. ;; Definitely 2.0pre3, probably all 2.0pre's before this. - '((semantic semantic-version "2\.0pre[1-3]" + '((semantic semantic-version "2\\.0pre[1-3]" "The version of `semantic' loaded does not work in Emacs 22. It can cause constant high CPU load. Upgrade to at least 2.0pre4.") ;; CUA-mode does not work with GNU Emacs version 22.1 and newer. From 8aa7d70f17c6635edbf69eacfb5745958eaab707 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Tue, 14 Aug 2007 15:37:20 +0000 Subject: [PATCH 07/41] *** empty log message *** --- nt/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nt/ChangeLog b/nt/ChangeLog index ea0cda9c676..ae7284e2772 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2007-08-14 Dhuvra Krishnamurthy (tiny change) + + * makefile.w32-in (bootstrap-nmake): Change directories once more. + 2007-07-25 Glenn Morris * Relicense all FSF files to GPLv3 or later. From e133b9f1a2ddfdd1d4481f5d9f38f96235ddeebd Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 14 Aug 2007 18:33:25 +0000 Subject: [PATCH 08/41] "modification hooks called only once" -- fix is on the trunk. --- admin/FOR-RELEASE | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index a0b54c2f2ea..2a3e31fec74 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -38,19 +38,20 @@ to the hack introduced on 2005-07-01 to fix some other Cleartype problem. ** dak@gnu.org, 30 May: Redraw problem with overlapping frames -** bojohan+news@dd.chalmers.se, 1 Aug: n_schumacher@web.de: modification hooks called only once in - ** ams@gnu.org, 9 July: eshell and external commands ** timh@insightful.com, 25 June: undigestify-rmail-message in emacs 22.1 doesn't split a digest ** andreas.roehler@online.de, 24 Jul: CVS build on Suse 10.0 failed -* FIXES FOR EMACS 22.2 +* FIXES FOR EMACS 22.3 Here we list small fixes that arrived too late for Emacs 22.2, but that should be installed on the release branch after 22.2 is released. +** bojohan+news@dd.chalmers.se, 1 Aug: n_schumacher@web.de: modification hooks called only once in +Fix is on the trunk: 2007-08-13 change to insdel.c by Stefan Monnier. + * DOCUMENTATION ** Check the Emacs Tutorial. From 128c1013107f075bef22468bc8250f8472e9cc85 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Tue, 14 Aug 2007 23:01:03 +0000 Subject: [PATCH 09/41] (bootstrap-nmake): Change directories once more. --- nt/makefile.w32-in | 1 + 1 file changed, 1 insertion(+) diff --git a/nt/makefile.w32-in b/nt/makefile.w32-in index e7a10698ea2..05e9a665879 100644 --- a/nt/makefile.w32-in +++ b/nt/makefile.w32-in @@ -153,6 +153,7 @@ bootstrap-nmake: addsection cmdproxy cd ..\src $(MAKE) $(MFLAGS) bootstrap $(MAKE) $(MFLAGS) bootstrap-clean + cd ..\nt $(CP) $(BLD)/cmdproxy.exe ../bin cd ..\lisp $(MAKE) $(MFLAGS) SHELL=$(SHELLTYPE) bootstrap From 1502ed91e1c725e4c7d9a25a3282ebe814aba556 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 15 Aug 2007 03:08:42 +0000 Subject: [PATCH 10/41] *** empty log message *** --- lisp/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 994b0b1349c..40687712892 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-15 Glenn Morris + + * mail/undigest.el (rmail-digest-parse-rfc1153sloppy): Be even + sloppier, for the sake of GNU Mailman. + (rmail-digest-rfc1153): Initialize `result' correctly. + 2007-08-14 Glenn Morris * simple.el (bad-packages-alist): New constant. From ef831bd0dc9c8567a4f4907cf26b9887bc9f6be1 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 15 Aug 2007 03:09:52 +0000 Subject: [PATCH 11/41] (rmail-digest-parse-rfc1153sloppy): Be even sloppier, for the sake of GNU Mailman. (rmail-digest-rfc1153): Initialize `result' correctly. --- lisp/mail/undigest.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lisp/mail/undigest.el b/lisp/mail/undigest.el index 5b01f711176..5d6f266b3b0 100644 --- a/lisp/mail/undigest.el +++ b/lisp/mail/undigest.el @@ -93,7 +93,15 @@ See rmail-digest-methods." (rmail-digest-rfc1153 "^-\\{55,\\}\n\n" "^\n-\\{27,\\}\n\n" - "^\n-\\{27,\\}\n\nEnd of")) + ;; GNU Mailman knowingly (see comment at line 353 of ToDigest.py in + ;; Mailman source) produces non-conformant rfc 1153 digests, in that + ;; the trailer contains a "digest footer" like this: + ;; _______________________________________________ + ;; + ;; + ;; End of Foo Digest... + ;; ************************************** + "^\nEnd of")) (defun rmail-digest-rfc1153 (prolog-sep message-sep trailer-sep) (goto-char (point-min)) @@ -104,7 +112,7 @@ See rmail-digest-methods." separator result) (move-marker start (match-beginning 0)) (move-marker end (match-end 0)) - (setq result (cons (copy-marker start) (copy-marker end t))) + (setq result (list (cons (copy-marker start) (copy-marker end t)))) (when (re-search-forward message-sep nil t) ;; Ok, at least one message separator found (setq separator (match-string 0)) From 28c595fb5cf801127625109ecb56a6bffb5fb367 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 15 Aug 2007 03:11:58 +0000 Subject: [PATCH 12/41] "undigestify-rmail-message" is fixed. "CVS build" totally unreproducible (I think someone would have noticed if CVS did not build for 3 weeks...). Add some urls. --- admin/FOR-RELEASE | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 2a3e31fec74..2a710ccb478 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -37,12 +37,11 @@ to the hack introduced on 2005-07-01 to fix some other Cleartype problem. * BUGS ** dak@gnu.org, 30 May: Redraw problem with overlapping frames +http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00621.html ** ams@gnu.org, 9 July: eshell and external commands +http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00385.html -** timh@insightful.com, 25 June: undigestify-rmail-message in emacs 22.1 doesn't split a digest - -** andreas.roehler@online.de, 24 Jul: CVS build on Suse 10.0 failed * FIXES FOR EMACS 22.3 @@ -51,6 +50,8 @@ that should be installed on the release branch after 22.2 is released. ** bojohan+news@dd.chalmers.se, 1 Aug: n_schumacher@web.de: modification hooks called only once in Fix is on the trunk: 2007-08-13 change to insdel.c by Stefan Monnier. +http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00457.html + * DOCUMENTATION From 0c9848246b598ebb84af542bbcc3092fcb6ec93b Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 15 Aug 2007 03:19:47 +0000 Subject: [PATCH 13/41] Philippe Waroquiers (tty_default_color_capabilities): Explicitly initialize static variables in file scope, to avoid HPUX compiler problem. --- src/ChangeLog | 5 +++++ src/term.c | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3cfec569bdd..099ad8e8557 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2007-08-15 Philippe Waroquiers + + * term.c (tty_default_color_capabilities): Explicitly initialize + static variables in file scope, to avoid HPUX compiler problem. + 2007-08-13 Jan Dj,Ad(Brv * gtkutil.c (update_frame_tool_bar): Use -1 as index diff --git a/src/term.c b/src/term.c index 0648b960a6d..96697610a9b 100644 --- a/src/term.c +++ b/src/term.c @@ -2169,15 +2169,19 @@ DEFUN ("tty-display-color-cells", Ftty_display_color_cells, #ifndef WINDOWSNT +static int default_max_colors = 0; +static int default_max_pairs = 0; +static int default_no_color_video = 0; +static char *default_orig_pair = NULL; +static char *default_set_foreground = NULL; +static char *default_set_background = NULL; + /* Save or restore the default color-related capabilities of this terminal. */ static void tty_default_color_capabilities (save) int save; { - static char - *default_orig_pair, *default_set_foreground, *default_set_background; - static int default_max_colors, default_max_pairs, default_no_color_video; if (save) { From e7f059db469113378ca89f1e8f1a337fc0757504 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 15 Aug 2007 03:22:22 +0000 Subject: [PATCH 14/41] Comment previous change. --- src/term.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/term.c b/src/term.c index 96697610a9b..380e5b6fbec 100644 --- a/src/term.c +++ b/src/term.c @@ -2169,6 +2169,9 @@ DEFUN ("tty-display-color-cells", Ftty_display_color_cells, #ifndef WINDOWSNT +/* Explicitly initialized here rather than in the function to work + around an HPUX complier bug (?). See + http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00410.html */ static int default_max_colors = 0; static int default_max_pairs = 0; static int default_no_color_video = 0; From 37e479416a2a571253ad9c4340ea9d03550b79ae Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 15 Aug 2007 03:23:23 +0000 Subject: [PATCH 15/41] Typo. --- src/term.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/term.c b/src/term.c index 380e5b6fbec..8b46243a43a 100644 --- a/src/term.c +++ b/src/term.c @@ -2170,7 +2170,7 @@ DEFUN ("tty-display-color-cells", Ftty_display_color_cells, #ifndef WINDOWSNT /* Explicitly initialized here rather than in the function to work - around an HPUX complier bug (?). See + around an HPUX compiler bug (?). See http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00410.html */ static int default_max_colors = 0; static int default_max_pairs = 0; From fba500b6f114b319795ba5cc982ab6d8e46af56d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 15 Aug 2007 21:10:46 +0000 Subject: [PATCH 16/41] Don't fiddle with vc-handled-backend. (vc-bzr-registered): Don't redundantly protect against file-error. Actually use the format-specific code. (vc-bzr-buffer-nonblank-p): Remove. (vc-bzr-status): Change `kindchange' -> `kindchanged'. --- lisp/ChangeLog | 8 +++ lisp/vc-bzr.el | 173 ++++++++++++++++++++----------------------------- 2 files changed, 80 insertions(+), 101 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 40687712892..4e9a0798673 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2007-08-15 Stefan Monnier + + * vc-bzr.el: Don't fiddle with vc-handled-backend. + (vc-bzr-registered): Don't redundantly protect against + file-error. Actually use the format-specific code. + (vc-bzr-buffer-nonblank-p): Remove. + (vc-bzr-status): Change `kindchange' -> `kindchanged'. + 2007-08-15 Glenn Morris * mail/undigest.el (rmail-digest-parse-rfc1153sloppy): Be even diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index a11aa2e7ba8..2978e81ea50 100644 --- a/lisp/vc-bzr.el +++ b/lisp/vc-bzr.el @@ -59,7 +59,7 @@ (defgroup vc-bzr nil "VC bzr backend." -;; :version "22" + :version "22.2" :group 'vc) (defcustom vc-bzr-program "bzr" @@ -130,38 +130,27 @@ format 3' in the first line. If the `checkout/dirstate' file cannot be parsed, fall back to running `vc-bzr-state'." - (condition-case nil - (lexical-let ((root (vc-bzr-root file))) - (and root ; Short cut. - ;; This looks at internal files. May break if they change - ;; their format. - (lexical-let - ((dirstate-file (expand-file-name vc-bzr-admin-dirstate root))) - (if (file-exists-p dirstate-file) - (with-temp-buffer - (insert-file-contents dirstate-file) - (goto-char (point-min)) - (when (looking-at "#bazaar dirstate flat format 3") - (let* ((relfile (file-relative-name file root)) - (reldir (file-name-directory relfile))) - (re-search-forward - (concat "^\0" - (if reldir (regexp-quote (directory-file-name reldir))) - "\0" - (regexp-quote (file-name-nondirectory relfile)) - "\0") - nil t)))) - t)) - (vc-bzr-state file))) ; Expensive. - (file-error nil))) ; vc-bzr-program not found - -(defun vc-bzr-buffer-nonblank-p (&optional buffer) - "Return non-nil if BUFFER contains any non-blank characters." - (or (> (buffer-size buffer) 0) - (save-excursion - (set-buffer (or buffer (current-buffer))) - (goto-char (point-min)) - (re-search-forward "[^ \t\n]" (point-max) t)))) + (lexical-let ((root (vc-bzr-root file))) + (when root ; Short cut. + ;; This looks at internal files. May break if they change + ;; their format. + (lexical-let ((dirstate (expand-file-name vc-bzr-admin-dirstate root))) + (if (not (file-readable-p dirstate)) + (vc-bzr-state file) ; Expensive. + (with-temp-buffer + (insert-file-contents dirstate) + (goto-char (point-min)) + (if (not (looking-at "#bazaar dirstate flat format 3")) + (vc-bzr-state file) ; Some other unknown format? + (let* ((relfile (file-relative-name file root)) + (reldir (file-name-directory relfile))) + (re-search-forward + (concat "^\0" + (if reldir (regexp-quote (directory-file-name reldir))) + "\0" + (regexp-quote (file-name-nondirectory relfile)) + "\0") + nil t))))))))) (defconst vc-bzr-state-words "added\\|ignored\\|kind changed\\|modified\\|removed\\|renamed\\|unknown" @@ -180,61 +169,53 @@ running `vc-bzr-state'." (defun vc-bzr-status (file) "Return FILE status according to Bzr. Return value is a cons (STATUS . WARNING), where WARNING is a -string or nil, and STATUS is one of the symbols: 'added, -'ignored, 'kindchange, 'modified, 'removed, 'renamed, 'unknown, +string or nil, and STATUS is one of the symbols: `added', +`ignored', `kindchanged', `modified', `removed', `renamed', `unknown', which directly correspond to `bzr status' output, or 'unchanged for files whose copy in the working tree is identical to the one in the branch repository, or nil for files that are not registered with Bzr. If any error occurred in running `bzr status', then return nil." - (condition-case nil (with-temp-buffer - (let ((ret (vc-bzr-command "status" t 0 file)) - (status 'unchanged)) - ;; the only secure status indication in `bzr status' output - ;; is a couple of lines following the pattern:: - ;; | : - ;; | - ;; if the file is up-to-date, we get no status report from `bzr', - ;; so if the regexp search for the above pattern fails, we consider - ;; the file to be up-to-date. - (goto-char (point-min)) - (when - (re-search-forward - ;; bzr prints paths relative to the repository root - (concat "^\\(" vc-bzr-state-words "\\):[ \t\n]+" - (regexp-quote (vc-bzr-file-name-relative file)) - (if (file-directory-p file) "/?" "") - "[ \t\n]*$") - (point-max) t) - (let ((start (match-beginning 0)) - (end (match-end 0))) - (goto-char start) + (let ((ret (condition-case nil + (vc-bzr-command "status" t 0 file) + (file-error nil))) ; vc-bzr-program not found. + (status 'unchanged)) + ;; the only secure status indication in `bzr status' output + ;; is a couple of lines following the pattern:: + ;; | : + ;; | + ;; if the file is up-to-date, we get no status report from `bzr', + ;; so if the regexp search for the above pattern fails, we consider + ;; the file to be up-to-date. + (goto-char (point-min)) + (when (re-search-forward + ;; bzr prints paths relative to the repository root. + (concat "^\\(" vc-bzr-state-words "\\):[ \t\n]+" + (regexp-quote (vc-bzr-file-name-relative file)) + (if (file-directory-p file) "/?" "") + "[ \t\n]*$") + nil t) + (let ((status (match-string 1))) + ;; Erase the status text that matched. + (delete-region (match-beginning 0) (match-end 0)) (setq status - (cond - ((not (equal ret 0)) nil) - ((looking-at "added") 'added) - ((looking-at "kind changed") 'kindchange) - ((looking-at "renamed") 'renamed) - ((looking-at "modified") 'modified) - ((looking-at "removed") 'removed) - ((looking-at "ignored") 'ignored) - ((looking-at "unknown") 'unknown))) - ;; erase the status text that matched - (delete-region start end))) - (if status - (cons status - ;; "bzr" will output warnings and informational messages to - ;; stderr; due to Emacs' `vc-do-command' (and, it seems, - ;; `start-process' itself) limitations, we cannot catch stderr - ;; and stdout into different buffers. So, if there's anything - ;; left in the buffer after removing the above status - ;; keywords, let us just presume that any other message from - ;; "bzr" is a user warning, and display it. - (if (vc-bzr-buffer-nonblank-p) - (buffer-substring (point-min) (point-max))))))) - (file-error nil))) ; vc-bzr-program not found + (and (equal ret 0) ; Seems redundant. --Stef + (intern (replace-regexp-in-string " " "" + status)))))) + (when status + (goto-char (point-min)) + (skip-chars-forward " \n\t") ;Throw away spaces. + (cons status + ;; "bzr" will output warnings and informational messages to + ;; stderr; due to Emacs' `vc-do-command' (and, it seems, + ;; `start-process' itself) limitations, we cannot catch stderr + ;; and stdout into different buffers. So, if there's anything + ;; left in the buffer after removing the above status + ;; keywords, let us just presume that any other message from + ;; "bzr" is a user warning, and display it. + (unless (eobp) (buffer-substring (point) (point-max)))))))) (defun vc-bzr-state (file) (lexical-let ((result (vc-bzr-status file))) @@ -243,7 +224,7 @@ If any error occurred in running `bzr status', then return nil." (message "Warnings in `bzr' output: %s" (cdr result))) (cdr (assq (car result) '((added . edited) - (kindchange . edited) + (kindchanged . edited) (renamed . edited) (modified . edited) (removed . edited) @@ -264,7 +245,7 @@ If any error occurred in running `bzr status', then return nil." ;; bzr process. This looks at internal files. May break if they ;; change their format. (if (file-exists-p branch-format-file) - (with-temp-buffer + (with-temp-buffer (insert-file-contents branch-format-file) (goto-char (point-min)) (cond @@ -272,7 +253,7 @@ If any error occurred in running `bzr status', then return nil." (looking-at "Bazaar-NG branch, format 0.0.4") (looking-at "Bazaar-NG branch format 5")) ;; count lines in .bzr/branch/revision-history - (insert-file-contents revhistory-file) + (insert-file-contents revhistory-file) (number-to-string (count-lines (line-end-position) (point-max)))) ((looking-at "Bazaar Branch Format 6 (bzr 0.15)") ;; revno is the first number in .bzr/branch/last-revision @@ -340,10 +321,10 @@ EDITABLE is ignored." (setq destfile (vc-version-backup-file-name file rev))) (let ((coding-system-for-read 'binary) (coding-system-for-write 'binary)) - (with-temp-file destfile - (if rev - (vc-bzr-command "cat" t 0 file "-r" rev) - (vc-bzr-command "cat" t 0 file))))) + (with-temp-file destfile + (if rev + (vc-bzr-command "cat" t 0 file "-r" rev) + (vc-bzr-command "cat" t 0 file))))) (defun vc-bzr-revert (file &optional contents-done) (unless contents-done @@ -376,7 +357,6 @@ EDITABLE is ignored." "Get bzr change log for FILES into specified BUFFER." ;; Fixme: This might need the locale fixing up if things like `revno' ;; got localized, but certainly it shouldn't use LC_ALL=C. - ;; NB. Can't be async -- see `vc-bzr-post-command-function'. (vc-bzr-command "log" buffer 0 files) ;; FIXME: Until Emacs-23, VC was missing a hook to sort out the mode for ;; the buffer, or at least set the regexps right. @@ -400,7 +380,6 @@ EDITABLE is ignored." (setq rev1 nil)) (if (and (not rev1) rev2) (setq rev1 working)) - ;; NB. Can't be async -- see `vc-bzr-post-command-function'. ;; bzr diff produces condition code 1 for some reason. (apply #'vc-bzr-command "diff" (or buffer "*vc-diff*") 1 files "--diff-options" (mapconcat 'identity (vc-diff-switches-list bzr) @@ -462,11 +441,11 @@ property containing author and date information." ;; Definition from Emacs 22 (unless (fboundp 'vc-annotate-convert-time) -(defun vc-annotate-convert-time (time) - "Convert a time value to a floating-point number of days. + (defun vc-annotate-convert-time (time) + "Convert a time value to a floating-point number of days. The argument TIME is a list as returned by `current-time' or `encode-time', only the first two elements of that list are considered." - (/ (+ (* (float (car time)) (lsh 1 16)) (cadr time)) 24 3600))) + (/ (+ (* (float (car time)) (lsh 1 16)) (cadr time)) 24 3600))) (defun vc-bzr-annotate-time () (when (re-search-forward "^ *[0-9]+ |" nil t) @@ -548,7 +527,7 @@ Optional argument LOCALP is always ignored." (setq current-bzr-state 'added)) ((looking-at "^kind changed") (setq current-vc-state 'edited) - (setq current-bzr-state 'kindchange)) + (setq current-bzr-state 'kindchanged)) ((looking-at "^modified") (setq current-vc-state 'edited) (setq current-bzr-state 'modified)) @@ -590,17 +569,9 @@ Optional argument LOCALP is always ignored." ;; else fall back to default vc representation (vc-default-dired-state-info 'Bzr file))))) -;; In case of just `(load "vc-bzr")', but that's probably the wrong -;; way to do it. -(add-to-list 'vc-handled-backends 'Bzr) - (eval-after-load "vc" '(add-to-list 'vc-directory-exclusion-list vc-bzr-admin-dirname t)) -(defconst vc-bzr-unload-hook - (lambda () - (setq vc-handled-backends (delq 'Bzr vc-handled-backends)) - (remove-hook 'vc-post-command-functions 'vc-bzr-post-command-function))) (provide 'vc-bzr) ;; arch-tag: 8101bad8-4e92-4e7d-85ae-d8e08b4e7c06 From fb2336a18b7a6d8aa6a8fbf7fcc4cf46eef98cb5 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 16 Aug 2007 03:13:33 +0000 Subject: [PATCH 17/41] *** empty log message *** --- src/ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 099ad8e8557..42e5866f88c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,7 +1,7 @@ 2007-08-15 Philippe Waroquiers - * term.c (tty_default_color_capabilities): Explicitly initialize - static variables in file scope, to avoid HPUX compiler problem. + * term.c (tty_default_color_capabilities): Declare static + variables in file scope, to avoid HPUX compiler problem. 2007-08-13 Jan Dj,Ad(Brv From af9f81a0de809153d8d39e82417f4cdc72d24f33 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 16 Aug 2007 03:17:12 +0000 Subject: [PATCH 18/41] Tweak previous change (don't init statics). --- lisp/ChangeLog | 4 ++++ src/term.c | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4e9a0798673..067a6291c3e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-08-16 Glenn Morris + + * ps-print.el (ps-font-size): Doc fix. + 2007-08-15 Stefan Monnier * vc-bzr.el: Don't fiddle with vc-handled-backend. diff --git a/src/term.c b/src/term.c index 8b46243a43a..d829332f55c 100644 --- a/src/term.c +++ b/src/term.c @@ -2169,15 +2169,15 @@ DEFUN ("tty-display-color-cells", Ftty_display_color_cells, #ifndef WINDOWSNT -/* Explicitly initialized here rather than in the function to work - around an HPUX compiler bug (?). See +/* Declare here rather than in the function, as in the rest of Emacs, + to work around an HPUX compiler bug (?). See http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00410.html */ -static int default_max_colors = 0; -static int default_max_pairs = 0; -static int default_no_color_video = 0; -static char *default_orig_pair = NULL; -static char *default_set_foreground = NULL; -static char *default_set_background = NULL; +static int default_max_colors; +static int default_max_pairs; +static int default_no_color_video; +static char *default_orig_pair; +static char *default_set_foreground; +static char *default_set_background; /* Save or restore the default color-related capabilities of this terminal. */ From c7c804c288a3ee6be9276bbb9211c55ef37103be Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 16 Aug 2007 03:18:34 +0000 Subject: [PATCH 19/41] (ps-font-size): Doc fix. --- lisp/ps-print.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 4f5f67fd91e..f764d194a68 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -2869,7 +2869,8 @@ uses the fonts resident in your printer." :group 'ps-print-font) (defcustom ps-font-size '(7 . 8.5) - "*Font size, in points, for ordinary text, when generating PostScript." + "*Font size, in points, for ordinary text, when generating PostScript. +Either a float or a cons of floats (LANDSCAPE-SIZE . PORTRAIT-SIZE)." :type '(choice :menu-tag "Ordinary Text Font Size" :tag "Ordinary Text Font Size" (number :tag "Text Size") From 596047b3e7e70e0c71ef1d206fa951b45b32e05d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 16 Aug 2007 03:23:07 +0000 Subject: [PATCH 20/41] Redraw problem is probably a graphics driver bug, not specific to Emacs. --- admin/FOR-RELEASE | 3 --- 1 file changed, 3 deletions(-) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 2a710ccb478..0fb168ff9db 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -36,9 +36,6 @@ to the hack introduced on 2005-07-01 to fix some other Cleartype problem. * BUGS -** dak@gnu.org, 30 May: Redraw problem with overlapping frames -http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00621.html - ** ams@gnu.org, 9 July: eshell and external commands http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00385.html From 4d78a860b9ee2b830d6b9fc67e55c83d516df0c4 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 16 Aug 2007 04:24:57 +0000 Subject: [PATCH 21/41] (cl-transform-lambda): Preserve the match-data. --- lisp/ChangeLog | 4 ++++ lisp/emacs-lisp/cl-macs.el | 22 +++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 067a6291c3e..16edb115181 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-08-16 Stefan Monnier + + * emacs-lisp/cl-macs.el (cl-transform-lambda): Preserve the match-data. + 2007-08-16 Glenn Morris * ps-print.el (ps-font-size): Doc fix. diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 5a79a6424e0..e4a84e44e64 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -266,15 +266,19 @@ its argument list allows full Common Lisp conventions." (nconc (nreverse simple-args) (list '&rest (car (pop bind-lets)))) (nconc (let ((hdr (nreverse header))) - (require 'help-fns) - (cons (help-add-fundoc-usage - (if (stringp (car hdr)) (pop hdr)) - ;; orig-args can contain &cl-defs (an internal CL - ;; thingy that I do not understand), so remove it. - (let ((x (memq '&cl-defs orig-args))) - (if (null x) orig-args - (delq (car x) (remq (cadr x) orig-args))))) - hdr)) + ;; Macro expansion can take place in the middle of + ;; apparently harmless computation, so it should not + ;; touch the match-data. + (save-match-data + (require 'help-fns) + (cons (help-add-fundoc-usage + (if (stringp (car hdr)) (pop hdr)) + ;; orig-args can contain &cl-defs (an internal + ;; CL thingy I don't understand), so remove it. + (let ((x (memq '&cl-defs orig-args))) + (if (null x) orig-args + (delq (car x) (remq (cadr x) orig-args))))) + hdr))) (list (nconc (list 'let* bind-lets) (nreverse bind-forms) body))))))) From ed0e2ad11b2b80f7a8505b72285c7ff041a5b37b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 16 Aug 2007 14:20:37 +0000 Subject: [PATCH 22/41] (perl-font-lock-syntactic-keywords): Correctly match / regexp matchers as first char on a line when fontifying only that line. --- lisp/ChangeLog | 4 ++++ lisp/progmodes/perl-mode.el | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 16edb115181..33b2c21eeed 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2007-08-16 Stefan Monnier + * progmodes/perl-mode.el (perl-font-lock-syntactic-keywords): + Correctly match / regexp matchers as first char on a line when + fontifying only that line. + * emacs-lisp/cl-macs.el (cl-transform-lambda): Preserve the match-data. 2007-08-16 Glenn Morris diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index cfef0eedfe4..f2feff595bb 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -267,8 +267,16 @@ The expansion is entirely correct because it uses the C preprocessor." ("^[ \t]*format.*=[ \t]*\\(\n\\)" (1 '(7))) ;; Funny things in sub arg specifications like `sub myfunc ($$)' ("\\\\s-*\\([^])}> \n\t]\\)" ;; Nasty cases: ;; /foo/m $a->m $#m $m @m %m From de6895115622ceeda27e82ccc254a1e3f57c23d6 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 16 Aug 2007 20:04:36 +0000 Subject: [PATCH 23/41] (smerge-resolve): New arg `safe'. (smerge-resolve-all, smerge-batch-resolve): New function. (smerge-refine): Make sure `diff' returns the expected result. (smerge-parsep-re): New const. (smerge-mode): Use it to adjust paragraph-separate. --- lisp/ChangeLog | 6 ++++++ lisp/smerge-mode.el | 51 ++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 33b2c21eeed..f4cedbb7a22 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2007-08-16 Stefan Monnier + * smerge-mode.el (smerge-resolve): New arg `safe'. + (smerge-resolve-all, smerge-batch-resolve): New function. + (smerge-refine): Make sure `diff' returns the expected result. + (smerge-parsep-re): New const. + (smerge-mode): Use it to adjust paragraph-separate. + * progmodes/perl-mode.el (perl-font-lock-syntactic-keywords): Correctly match / regexp matchers as first char on a line when fontifying only that line. diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el index ef80ef81679..e3484bb0a48 100644 --- a/lisp/smerge-mode.el +++ b/lisp/smerge-mode.el @@ -324,7 +324,8 @@ Can be nil if the style is undecided, or else: (defvar smerge-resolve-function (lambda () (error "Don't know how to resolve")) "Mode-specific merge function. -The function is called with no argument and with the match data set +The function is called with zero or one argument (non-nil if the resolution +function should only apply safe heuristics) and with the match data set according to `smerge-match-conflict'.") (add-to-list 'debug-ignored-errors "Don't know how to resolve") @@ -378,7 +379,7 @@ according to `smerge-match-conflict'.") (smerge-remove-props (or beg (point-min)) (or end (point-max))) (push event unread-command-events))))) -(defun smerge-resolve () +(defun smerge-resolve (&optional safe) "Resolve the conflict at point intelligently. This relies on mode-specific knowledge and thus only works in some major modes. Uses `smerge-resolve-function' to do the actual work." @@ -393,8 +394,10 @@ some major modes. Uses `smerge-resolve-function' to do the actual work." ;; Mode-specific conflict resolution. ((condition-case nil (atomic-change-group - (funcall smerge-resolve-function) - t) + (if safe + (funcall smerge-resolve-function safe) + (funcall smerge-resolve-function)) + t) (error nil)) ;; Nothing to do: the resolution function has done it already. nil) @@ -412,6 +415,31 @@ some major modes. Uses `smerge-resolve-function' to do the actual work." (error "Don't know how to resolve"))) (smerge-auto-leave)) +(defun smerge-resolve-all () + "Perform automatic resolution on all conflicts." + (interactive) + (save-excursion + (goto-char (point-min)) + (while (re-search-forward smerge-begin-re nil t) + (condition-case nil + (progn + (smerge-match-conflict) + (smerge-resolve 'safe)) + (error nil))))) + +(defun smerge-batch-resolve () + ;; command-line-args-left is what is left of the command line. + (if (not noninteractive) + (error "`smerge-batch-resolve' is to be used only with -batch")) + (while command-line-args-left + (let ((file (pop command-line-args-left))) + (message "Resolving conflicts in %s..." file) + (when (file-readable-p file) + (with-current-buffer (find-file-noselect file) + (smerge-resolve-all) + (save-buffer) + (kill-buffer (current-buffer))))))) + (defun smerge-keep-base () "Revert to the base version." (interactive) @@ -677,7 +705,9 @@ Point is moved to the end of the conflict." (unwind-protect (with-temp-buffer (let ((coding-system-for-read 'emacs-mule)) - (call-process diff-command nil t nil file1 file2)) + ;; Don't forget -a to make sure diff treats it as a text file + ;; even if it contains \0 and such. + (call-process diff-command nil t nil "-a" file1 file2)) ;; Process diff's output. (goto-char (point-min)) (while (not (eobp)) @@ -831,6 +861,10 @@ buffer names." (message "Please resolve conflicts now; exit ediff when done"))) +(defconst smerge-parsep-re + (concat smerge-begin-re "\\|" smerge-end-re "\\|" + smerge-base-re "\\|" smerge-other-re "\\|")) + ;;;###autoload (define-minor-mode smerge-mode "Minor mode to simplify editing output from the diff3 program. @@ -845,6 +879,13 @@ buffer names." (while (smerge-find-conflict) (save-excursion (font-lock-fontify-region (match-beginning 0) (match-end 0) nil))))) + (if (string-match (regexp-quote smerge-parsep-re) paragraph-separate) + (unless smerge-mode + (set (make-local-variable 'paragraph-separate) + (replace-match "" t t paragraph-separate))) + (when smerge-mode + (set (make-local-variable 'paragraph-separate) + (concat smerge-parsep-re paragraph-separate)))) (unless smerge-mode (smerge-remove-props (point-min) (point-max)))) From 91fc3f99dbeacc32245ef8e131d63e8dd072d78f Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Thu, 16 Aug 2007 22:28:43 +0000 Subject: [PATCH 24/41] Docstring fix --- lisp/ps-print.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/ps-print.el b/lisp/ps-print.el index f764d194a68..aac74b3b51a 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -2887,7 +2887,8 @@ Either a float or a cons of floats (LANDSCAPE-SIZE . PORTRAIT-SIZE)." :group 'ps-print-font) (defcustom ps-header-font-size '(10 . 12) - "*Font size, in points, for text in the header, when generating PostScript." + "*Font size, in points, for text in the header, when generating PostScript. +Either a float or a cons of floats (LANDSCAPE-SIZE . PORTRAIT-SIZE)." :type '(choice :menu-tag "Header Font Size" :tag "Header Font Size" (number :tag "Header Size") @@ -2898,7 +2899,8 @@ Either a float or a cons of floats (LANDSCAPE-SIZE . PORTRAIT-SIZE)." :group 'ps-print-font) (defcustom ps-header-title-font-size '(12 . 14) - "*Font size, in points, for the top line of text in header, in PostScript." + "*Font size, in points, for the top line of text in header, in PostScript. +Either a float or a cons of floats (LANDSCAPE-SIZE . PORTRAIT-SIZE)." :type '(choice :menu-tag "Header Title Font Size" :tag "Header Title Font Size" (number :tag "Header Title Size") @@ -2915,7 +2917,8 @@ Either a float or a cons of floats (LANDSCAPE-SIZE . PORTRAIT-SIZE)." :group 'ps-print-font) (defcustom ps-footer-font-size '(10 . 12) - "*Font size, in points, for text in the footer, when generating PostScript." + "*Font size, in points, for text in the footer, when generating PostScript. +Either a float or a cons of floats (LANDSCAPE-SIZE . PORTRAIT-SIZE)." :type '(choice :menu-tag "Footer Font Size" :tag "Footer Font Size" (number :tag "Footer Size") @@ -2947,7 +2950,8 @@ Either a float or a cons of floats (LANDSCAPE-SIZE . PORTRAIT-SIZE)." :group 'ps-print-miscellany) (defcustom ps-line-number-font-size 6 - "*Font size, in points, for line number, when generating PostScript." + "*Font size, in points, for line number, when generating PostScript. +Either a float or a cons of floats (LANDSCAPE-SIZE . PORTRAIT-SIZE)." :type '(choice :menu-tag "Line Number Font Size" :tag "Line Number Font Size" (number :tag "Font Size") From 6c8cb7016048ee0d5c5ebc6260a009e2a3ef1e61 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Fri, 17 Aug 2007 01:29:39 +0000 Subject: [PATCH 25/41] Docstring fix --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f4cedbb7a22..c80094ec812 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-16 Vinicius Jose Latorre + + * ps-print.el (ps-header-font-size, ps-header-title-font-size) + (ps-footer-font-size, ps-line-number-font-size): Docstring fix. + 2007-08-16 Stefan Monnier * smerge-mode.el (smerge-resolve): New arg `safe'. From f360c323b15127ac26191b93046dd916e0b52716 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Fri, 17 Aug 2007 01:43:06 +0000 Subject: [PATCH 26/41] Docstring fix --- lisp/ChangeLog | 3 ++- lisp/ps-print.el | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c80094ec812..ee9e1726177 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,8 @@ 2007-08-16 Vinicius Jose Latorre * ps-print.el (ps-header-font-size, ps-header-title-font-size) - (ps-footer-font-size, ps-line-number-font-size): Docstring fix. + (ps-footer-font-size, ps-line-number-font-size, ps-line-spacing) + (ps-paragraph-spacing): Docstring fix. 2007-08-16 Stefan Monnier diff --git a/lisp/ps-print.el b/lisp/ps-print.el index aac74b3b51a..83367a06f60 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -3362,6 +3362,8 @@ By default, this directory is the same as in the variable `data-directory'." (defcustom ps-line-spacing 0 "*Specify line spacing, in points, for ordinary text. +Either a float or a cons of floats (LANDSCAPE-SIZE . PORTRAIT-SIZE). + See also `ps-paragraph-spacing' and `ps-paragraph-regexp'. To get all lines with some spacing set both `ps-line-spacing' and @@ -3378,6 +3380,8 @@ To get all lines with some spacing set both `ps-line-spacing' and (defcustom ps-paragraph-spacing 0 "*Specify paragraph spacing, in points, for ordinary text. +Either a float or a cons of floats (LANDSCAPE-SIZE . PORTRAIT-SIZE). + See also `ps-line-spacing' and `ps-paragraph-regexp'. To get all lines with some spacing set both `ps-line-spacing' and From 33f93af84f40dba3bd1258c052eb737c37cc07b4 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 17 Aug 2007 04:43:27 +0000 Subject: [PATCH 27/41] *** empty log message *** --- admin/FOR-RELEASE | 2 ++ 1 file changed, 2 insertions(+) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 0fb168ff9db..b6f8d38ca1f 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -39,6 +39,8 @@ to the hack introduced on 2005-07-01 to fix some other Cleartype problem. ** ams@gnu.org, 9 July: eshell and external commands http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00385.html +** Check all non-file-scope static vars to make sure they +won't lose on USG or HPUX systems. * FIXES FOR EMACS 22.3 From 5f15401ac7af44eeb7c3865ba57806f66bccaaff Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 17 Aug 2007 07:15:55 +0000 Subject: [PATCH 28/41] *** empty log message *** --- lisp/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ee9e1726177..b4022fef04b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-17 Glenn Morris + + * progmodes/compile.el (compilation-get-file-structure): Make use + of the directory part when checking for an existing entry, to + handle files with same basename in different directories. + 2007-08-16 Vinicius Jose Latorre * ps-print.el (ps-header-font-size, ps-header-title-font-size) From 912651fc0caeb9b205042b627626f97bb8d8caa6 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 17 Aug 2007 07:16:17 +0000 Subject: [PATCH 29/41] (compilation-get-file-structure): Make use of the directory part when checking for an existing entry, to handle files with same basename in different directories. --- lisp/progmodes/compile.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index fcb20ede56d..96ba3f80f3b 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1935,7 +1935,13 @@ The file-structure looks like this: ;; Store it for the possibly unnormalized name (puthash file ;; Retrieve or create file-structure for normalized name - (or (gethash (list filename) compilation-locs) + ;; The gethash used to not use spec-directory, but + ;; this leads to errors when files in different + ;; directories have the same name: + ;; http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00463.html + (or (gethash (cons filename spec-directory) compilation-locs) + ;; TODO should this, without spec-directory, be + ;; done at all? (puthash (list filename) (list (list filename spec-directory) fmt) compilation-locs)) From a33f5759a6c9f28882db8495ccff32748795dfd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Fri, 17 Aug 2007 07:52:08 +0000 Subject: [PATCH 30/41] (handle_one_xevent): Remove check that mouse click is in active frame. --- src/ChangeLog | 5 +++++ src/xterm.c | 40 ++++++++++++++++++++-------------------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 42e5866f88c..89267c92f0a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2007-08-17 Jan Dj,Ad(Brv + + * xterm.c (handle_one_xevent): Remove check that mouse click is in + active frame. + 2007-08-15 Philippe Waroquiers * term.c (tty_default_color_capabilities): Declare static diff --git a/src/xterm.c b/src/xterm.c index 512fff35f50..6c58cc39fd2 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6751,7 +6751,11 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) f = last_mouse_frame; else f = x_window_to_frame (dpyinfo, event.xbutton.window); - + if (event.type == ButtonPress) + { + static int xxx = 0; + fprintf (stderr, "%d, F: %p\n", xxx++, f); + } if (f) { /* Is this in the tool-bar? */ @@ -6777,27 +6781,23 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) } if (!tool_bar_p) - if (!dpyinfo->x_focus_frame - || f == dpyinfo->x_focus_frame) - { #if defined (USE_X_TOOLKIT) || defined (USE_GTK) - if (! popup_activated ()) + if (! popup_activated ()) #endif - { - if (ignore_next_mouse_click_timeout) - { - if (event.type == ButtonPress - && (int)(event.xbutton.time - ignore_next_mouse_click_timeout) > 0) - { - ignore_next_mouse_click_timeout = 0; - construct_mouse_click (&inev.ie, &event.xbutton, f); - } - if (event.type == ButtonRelease) - ignore_next_mouse_click_timeout = 0; - } - else - construct_mouse_click (&inev.ie, &event.xbutton, f); - } + { + if (ignore_next_mouse_click_timeout) + { + if (event.type == ButtonPress + && (int)(event.xbutton.time - ignore_next_mouse_click_timeout) > 0) + { + ignore_next_mouse_click_timeout = 0; + construct_mouse_click (&inev.ie, &event.xbutton, f); + } + if (event.type == ButtonRelease) + ignore_next_mouse_click_timeout = 0; + } + else + construct_mouse_click (&inev.ie, &event.xbutton, f); } } else From b9c2e294883dd15ac0bea63d8f046da505a73c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Fri, 17 Aug 2007 07:53:18 +0000 Subject: [PATCH 31/41] Remove debug fprintf. --- src/xterm.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 6c58cc39fd2..bb25fba5f87 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6751,11 +6751,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) f = last_mouse_frame; else f = x_window_to_frame (dpyinfo, event.xbutton.window); - if (event.type == ButtonPress) - { - static int xxx = 0; - fprintf (stderr, "%d, F: %p\n", xxx++, f); - } + if (f) { /* Is this in the tool-bar? */ From 05927f8c8b1ea6bd82c077783ebece2ac70d32ec Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Fri, 17 Aug 2007 18:58:32 +0000 Subject: [PATCH 32/41] Fix s{a}{b} parsing --- lisp/ChangeLog | 6 ++++++ lisp/progmodes/cperl-mode.el | 13 +++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b4022fef04b..69d753121ea 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-17 Bob Rogers (tiny change) + + * progmode/cperl-mode.el (cperl-look-at-leading-count) + (cperl-find-pods-heres): Fix an error when typing expressions like + `s{a}{b}'. + 2007-08-17 Glenn Morris * progmodes/compile.el (compilation-get-file-structure): Make use diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index cd7dabb8825..5a91141db6c 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -3736,8 +3736,12 @@ Should be called with the point before leading colon of an attribute." (set-syntax-table reset-st)))) (defsubst cperl-look-at-leading-count (is-x-REx e) - (if (re-search-forward (concat "\\=" (if is-x-REx "[ \t\n]*" "") "[{?+*]") - (1- e) t) ; return nil on failure, no moving + (if (and (> (point) e) + ;; return nil on failure, no moving + (re-search-forward (concat "\\=" + (if is-x-REx "[ \t\n]*" "") + "[{?+*]") + (1- e) t)) (if (eq ?\{ (preceding-char)) nil (cperl-postpone-fontification (1- (point)) (point) @@ -3750,7 +3754,7 @@ If `cperl-pod-here-fontify' is not-nil after evaluation, will fontify the sections using `cperl-pod-head-face', `cperl-pod-face', `cperl-here-face'." (interactive) - (or min (setq min (point-min) + (or min (setq min (point-min) cperl-syntax-state nil cperl-syntax-done-to min)) (or max (setq max (point-max))) @@ -4785,7 +4789,8 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', (progn (cperl-postpone-fontification (1- e1) e1 'face my-cperl-delimiters-face) - (if (assoc (char-after b) cperl-starters) + (if (and (not (eobp)) + (assoc (char-after b) cperl-starters)) (progn (cperl-postpone-fontification b1 (1+ b1) 'face my-cperl-delimiters-face) From 91db3c234fce84a34f32c845d91c5afae7445313 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 17 Aug 2007 19:29:52 +0000 Subject: [PATCH 33/41] (Position Info): Add index entry for face at point. Mention that character faces are also displayed by "C-u C-x =". --- man/ChangeLog | 5 +++++ man/basic.texi | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/man/ChangeLog b/man/ChangeLog index 479f25e7267..6c27e3b7bb0 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2007-08-17 Eli Zaretskii + + * basic.texi (Position Info): Add index entry for face at point. + Mention that character faces are also displayed by "C-u C-x =". + 2007-08-10 Katsumi Yamaoka * gnus.texi (NNTP): Mention nntp-xref-number-is-evil. diff --git a/man/basic.texi b/man/basic.texi index 6d19281b089..7c65eba2f01 100644 --- a/man/basic.texi +++ b/man/basic.texi @@ -596,6 +596,7 @@ point=36169 of 36168 (EOB) column=0 @cindex character set of character at point @cindex font of character at point @cindex text properties at point +@cindex face at point @w{@kbd{C-u C-x =}} displays the following additional information about a character. @@ -623,7 +624,8 @@ terminal, the code(s) sent to the terminal. @item The character's text properties (@pxref{Text Properties,,, -elisp, the Emacs Lisp Reference Manual}), and any overlays containing it +elisp, the Emacs Lisp Reference Manual}), including any faces usewd to +display the character, and any overlays containing it (@pxref{Overlays,,, elisp, the same manual}). @end itemize From 578bbaf55b6a34022dd4c8ce3f2eedc96f4fb08a Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 17 Aug 2007 22:04:18 +0000 Subject: [PATCH 34/41] (copyright-update-year, copyright-update) (copyright-fix-years): Fix bug: Handle nil copyright-limit. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/copyright.el | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 69d753121ea..6c64d493124 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-17 Kimit Yada (tiny change) + + * emacs-lisp/copyright.el (copyright-update-year, copyright-update) + (copyright-fix-years): Fix bug: Handle nil copyright-limit. + 2007-08-17 Bob Rogers (tiny change) * progmode/cperl-mode.el (cperl-look-at-leading-count) diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index ed1d01023fb..d3f0056c413 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -84,7 +84,10 @@ When this is `function', only ask when called non-interactively." (defun copyright-update-year (replace noquery) (when (re-search-forward copyright-regexp - (if copyright-limit (+ (point) copyright-limit)) t) + (if copyright-limit + (+ (point) copyright-limit) + t) + t) ;; If the years are continued onto multiple lined ;; that are marked as comments, skip to the end of the years anyway. (while (save-excursion @@ -164,7 +167,10 @@ interactively." "\\(the Free Software Foundation;\ either \\|; a\\^u eldono \\([0-9]+\\)a, ? a\\^u (la\\^u via \\)\ version \\([0-9]+\\), or (at" - (if copyright-limit (+ (point) copyright-limit)) t) + (if copyright-limit + (+ (point) copyright-limit) + t) + t) (not (string= (match-string 3) copyright-current-gpl-version)) (or noquery (y-or-n-p (concat "Replace GPL version by " @@ -187,7 +193,10 @@ Uses heuristic: year >= 50 means 19xx, < 50 means 20xx." (widen) (goto-char (point-min)) (if (re-search-forward copyright-regexp - (if copyright-limit (+ (point) copyright-limit)) t) + (if copyright-limit + (+ (point) copyright-limit) + t) + t) (let ((s (match-beginning 2)) (e (copy-marker (1+ (match-end 2)))) (p (make-marker)) From c2659333c28521b1ca9263d5a9dae88d853e7292 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 17 Aug 2007 22:16:59 +0000 Subject: [PATCH 35/41] Revert last change. --- lisp/ChangeLog | 5 ----- lisp/emacs-lisp/copyright.el | 15 +++------------ 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6c64d493124..69d753121ea 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,8 +1,3 @@ -2007-08-17 Kimit Yada (tiny change) - - * emacs-lisp/copyright.el (copyright-update-year, copyright-update) - (copyright-fix-years): Fix bug: Handle nil copyright-limit. - 2007-08-17 Bob Rogers (tiny change) * progmode/cperl-mode.el (cperl-look-at-leading-count) diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index d3f0056c413..ed1d01023fb 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -84,10 +84,7 @@ When this is `function', only ask when called non-interactively." (defun copyright-update-year (replace noquery) (when (re-search-forward copyright-regexp - (if copyright-limit - (+ (point) copyright-limit) - t) - t) + (if copyright-limit (+ (point) copyright-limit)) t) ;; If the years are continued onto multiple lined ;; that are marked as comments, skip to the end of the years anyway. (while (save-excursion @@ -167,10 +164,7 @@ interactively." "\\(the Free Software Foundation;\ either \\|; a\\^u eldono \\([0-9]+\\)a, ? a\\^u (la\\^u via \\)\ version \\([0-9]+\\), or (at" - (if copyright-limit - (+ (point) copyright-limit) - t) - t) + (if copyright-limit (+ (point) copyright-limit)) t) (not (string= (match-string 3) copyright-current-gpl-version)) (or noquery (y-or-n-p (concat "Replace GPL version by " @@ -193,10 +187,7 @@ Uses heuristic: year >= 50 means 19xx, < 50 means 20xx." (widen) (goto-char (point-min)) (if (re-search-forward copyright-regexp - (if copyright-limit - (+ (point) copyright-limit) - t) - t) + (if copyright-limit (+ (point) copyright-limit)) t) (let ((s (match-beginning 2)) (e (copy-marker (1+ (match-end 2)))) (p (make-marker)) From bef83666556ed398df332e7ded92529b783e43f2 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 18 Aug 2007 08:33:06 +0000 Subject: [PATCH 36/41] (ada-create-syntax-table): Move set-syntax-table from here to ... (ada-mode): ... here. Do not change global value of comment-multi-line. Call new function ada-initialize-syntax-table-properties and add new function ada-handle-syntax-table-properties to font-lock-mode-hook. (ada-deactivate-properties, ada-initialize-properties): Replace by new functions ... (ada-handle-syntax-table-properties) (ada-initialize-syntax-table-properties) (ada-set-syntax-table-properties): ... to set up syntax-table properties uniformly, independently from whether font-lock-mode is enabled or not. Handle read-only buffers and do not change undo-list when setting syntax-table properties. (ada-after-change-function): Use ada-set-syntax-table-properties. --- lisp/ChangeLog | 19 +++++++ lisp/progmodes/ada-mode.el | 113 ++++++++++++++++++++----------------- 2 files changed, 79 insertions(+), 53 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 69d753121ea..027f4193254 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,22 @@ +2007-08-18 Martin Rudalics + + * progmodes/ada-mode.el (ada-create-syntax-table): Move + set-syntax-table from here to ... + (ada-mode): ... here. Do not change global value of + comment-multi-line. Call new function + ada-initialize-syntax-table-properties and add new function + ada-handle-syntax-table-properties to font-lock-mode-hook. + (ada-deactivate-properties, ada-initialize-properties): Replace + by new functions ... + (ada-handle-syntax-table-properties) + (ada-initialize-syntax-table-properties) + (ada-set-syntax-table-properties): ... to set up syntax-table + properties uniformly, independently from whether font-lock-mode + is enabled or not. Handle read-only buffers and do not change + undo-list when setting syntax-table properties. + (ada-after-change-function): Use + ada-set-syntax-table-properties. + 2007-08-17 Bob Rogers (tiny change) * progmode/cperl-mode.el (cperl-look-at-leading-count) diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el index c9a69005eaf..aa3aea0d71b 100644 --- a/lisp/progmodes/ada-mode.el +++ b/lisp/progmodes/ada-mode.el @@ -829,13 +829,12 @@ the 4 file locations can be clicked on and jumped to." ;; Thus their syntax property is changed automatically, and we can still use ;; the standard Emacs functions for sexp (see `ada-in-string-p') ;; -;; On Emacs, this is done through the `syntax-table' text property. The -;; modification is done automatically each time the user as typed a new -;; character. This is already done in `font-lock-mode' (in -;; `font-lock-syntactic-keywords', so we take advantage of the existing -;; mechanism. If font-lock-mode is not activated, we do it by hand in -;; `ada-after-change-function', thanks to `ada-deactivate-properties' and -;; `ada-initialize-properties'. +;; On Emacs, this is done through the `syntax-table' text property. The +;; corresponding action is applied automatically each time the buffer +;; changes. If `font-lock-mode' is enabled (the default) the action is +;; set up by `font-lock-syntactic-keywords'. Otherwise, we do it +;; manually in `ada-after-change-function'. The proper method is +;; installed by `ada-handle-syntax-table-properties'. ;; ;; on XEmacs, the `syntax-table' property does not exist and we have to use a ;; slow advice to `parse-partial-sexp' to do the same thing. @@ -852,7 +851,6 @@ The standard table declares `_' as a symbol constituent, the second one declares it as a word constituent." (interactive) (setq ada-mode-syntax-table (make-syntax-table)) - (set-syntax-table ada-mode-syntax-table) ;; define string brackets (`%' is alternative string bracket, but ;; almost never used as such and throws font-lock and indentation @@ -936,50 +934,59 @@ declares it as a word constituent." (insert (caddar change)) (setq change (cdr change))))))) -(defun ada-deactivate-properties () - "Deactivate Ada mode's properties handling. -This would be a duplicate of font-lock if both are used at the same time." - (remove-hook 'after-change-functions 'ada-after-change-function t)) - -(defun ada-initialize-properties () - "Initialize some special text properties in the whole buffer. -In particular, character constants are said to be strings, #...# are treated -as numbers instead of gnatprep comments." - (save-excursion - (save-restriction - (widen) - (goto-char (point-min)) - (while (re-search-forward "'.'" nil t) - (add-text-properties (match-beginning 0) (match-end 0) - '(syntax-table ("'" . ?\")))) - (goto-char (point-min)) - (while (re-search-forward "^[ \t]*#" nil t) - (add-text-properties (match-beginning 0) (match-end 0) - '(syntax-table (11 . 10)))) - (set-buffer-modified-p nil) - - ;; Setting this only if font-lock is not set won't work - ;; if the user activates or deactivates font-lock-mode, - ;; but will make things faster most of the time - (add-hook 'after-change-functions 'ada-after-change-function nil t) - ))) +(defun ada-set-syntax-table-properties () + "Assign `syntax-table' properties in accessible part of buffer. +In particular, character constants are said to be strings, #...# +are treated as numbers instead of gnatprep comments." + (let ((modified (buffer-modified-p)) + (buffer-undo-list t) + (inhibit-read-only t) + (inhibit-point-motion-hooks t) + (inhibit-modification-hooks t)) + (remove-text-properties (point-min) (point-max) '(syntax-table nil)) + (goto-char (point-min)) + (while (re-search-forward + ;; The following regexp was adapted from + ;; `ada-font-lock-syntactic-keywords'. + "^[ \t]*\\(#\\(?:if\\|else\\|elsif\\|end\\)\\)\\|[^a-zA-Z0-9)]\\('\\)[^'\n]\\('\\)" + nil t) + (if (match-beginning 1) + (put-text-property + (match-beginning 1) (match-end 1) 'syntax-table '(11 . ?\n)) + (put-text-property + (match-beginning 2) (match-end 2) 'syntax-table '(7 . ?')) + (put-text-property + (match-beginning 3) (match-end 3) 'syntax-table '(7 . ?')))) + (unless modified + (restore-buffer-modified-p nil)))) (defun ada-after-change-function (beg end old-len) "Called when the region between BEG and END was changed in the buffer. OLD-LEN indicates what the length of the replaced text was." - (let ((inhibit-point-motion-hooks t) - (eol (point))) + (save-excursion + (save-restriction + (let ((from (progn (goto-char beg) (line-beginning-position))) + (to (progn (goto-char end) (line-end-position)))) + (narrow-to-region from to) + (save-match-data + (ada-set-syntax-table-properties)))))) + +(defun ada-initialize-syntax-table-properties () + "Assign `syntax-table' properties in current buffer." (save-excursion - (save-match-data - (beginning-of-line) - (remove-text-properties (point) eol '(syntax-table nil)) - (while (re-search-forward "'.'" eol t) - (add-text-properties (match-beginning 0) (match-end 0) - '(syntax-table ("'" . ?\")))) - (beginning-of-line) - (if (looking-at "^[ \t]*#") - (add-text-properties (match-beginning 0) (match-end 0) - '(syntax-table (11 . 10)))))))) + (save-restriction + (widen) + (save-match-data + (ada-set-syntax-table-properties)))) + (add-hook 'after-change-functions 'ada-after-change-function nil t)) + +(defun ada-handle-syntax-table-properties () + "Handle `syntax-table' properties." + (if font-lock-mode + ;; `font-lock-mode' will take care of `syntax-table' properties. + (remove-hook 'after-change-functions 'ada-after-change-function t) + ;; Take care of `syntax-table' properties manually. + (ada-initialize-syntax-table-properties))) ;;------------------------------------------------------------------ ;; Testing the grammatical context @@ -1150,6 +1157,8 @@ If you use ada-xref.el: (interactive) (kill-all-local-variables) + + (set-syntax-table ada-mode-syntax-table) (set (make-local-variable 'require-final-newline) mode-require-final-newline) @@ -1340,7 +1349,7 @@ If you use ada-xref.el: (setq which-func-functions '(ada-which-function)) ;; Support for indent-new-comment-line (Especially for XEmacs) - (setq comment-multi-line nil) + (set (make-local-variable 'comment-multi-line) nil) (setq major-mode 'ada-mode mode-name "Ada") @@ -1377,9 +1386,8 @@ If you use ada-xref.el: ;; font-lock-mode (unless (featurep 'xemacs) - (progn - (ada-initialize-properties) - (add-hook 'font-lock-mode-hook 'ada-deactivate-properties nil t))) + (ada-initialize-syntax-table-properties) + (add-hook 'font-lock-mode-hook 'ada-handle-syntax-table-properties nil t)) ;; the following has to be done after running the ada-mode-hook ;; because users might want to set the values of these variable @@ -5200,8 +5208,7 @@ Return nil if no body was found." ;; This sets the properties of the characters, so that ada-in-string-p ;; correctly handles '"' too... '(("[^a-zA-Z0-9)]\\('\\)[^'\n]\\('\\)" (1 (7 . ?')) (2 (7 . ?'))) - ("^[ \t]*\\(#\\(if\\|else\\|elsif\\|end\\)\\)" (1 (11 . ?\n))) - )) + ("^[ \t]*\\(#\\(if\\|else\\|elsif\\|end\\)\\)" (1 (11 . ?\n))))) (defvar ada-font-lock-keywords (eval-when-compile From e8612bf263b21df67717e5767d4b982bd24addb0 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 18 Aug 2007 23:45:58 +0000 Subject: [PATCH 37/41] (scheme-mode-variables): Set font-lock-comment-start-skip. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/scheme.el | 1 + 2 files changed, 6 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 027f4193254..1ac0632ff68 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-18 Glenn Morris + + * progmodes/scheme.el (scheme-mode-variables): Set + font-lock-comment-start-skip. + 2007-08-18 Martin Rudalics * progmodes/ada-mode.el (ada-create-syntax-table): Move diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el index 5bf7cb1e9eb..e5fb8cbc7f8 100644 --- a/lisp/progmodes/scheme.el +++ b/lisp/progmodes/scheme.el @@ -156,6 +156,7 @@ ;; Look within the line for a ; following an even number of backslashes ;; after either a non-backslash or the line beginning. (setq comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+[ \t]*") + (set (make-local-variable 'font-lock-comment-start-skip) ";+ *") (make-local-variable 'comment-column) (setq comment-column 40) (make-local-variable 'parse-sexp-ignore-comments) From 259d15166e113c2ee39769ae79a7f333e698d88a Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 19 Aug 2007 00:17:53 +0000 Subject: [PATCH 38/41] (pure): Round PURESIZE up. --- src/ChangeLog | 4 ++++ src/alloc.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 89267c92f0a..add0663a648 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2007-08-19 Andreas Schwab + + * alloc.c (pure): Round PURESIZE up. + 2007-08-17 Jan Dj,Ad(Brv * xterm.c (handle_one_xevent): Remove check that mouse click is in diff --git a/src/alloc.c b/src/alloc.c index 948b87851a7..bcec8ea4560 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -266,7 +266,7 @@ Lisp_Object Vmemory_full; remapping on more recent systems because this is less important nowadays than in the days of small memories and timesharing. */ -EMACS_INT pure[PURESIZE / sizeof (EMACS_INT)] = {1,}; +EMACS_INT pure[(PURESIZE + sizeof (EMACS_INT) - 1) / sizeof (EMACS_INT)] = {1,}; #define PUREBEG (char *) pure #else /* HAVE_SHM */ From a2d1720359e119558bd1505b34e8076ef13bac0b Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 19 Aug 2007 00:24:41 +0000 Subject: [PATCH 39/41] *** empty log message *** --- lisp/ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1ac0632ff68..e5390ccf057 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2007-08-19 Glenn Morris + + * Makefile.in (custom-deps, finder-data, autoloads, recompile) + (progmodes/cc-mode.elc, mh-e/mh-loaddefs.el): Use $(emacs) rather + than $(EMACS), so that EMACSLOADPATH is set. Prevents any system + shadow files messing up the compilation. + 2007-08-18 Glenn Morris * progmodes/scheme.el (scheme-mode-variables): Set From 7de61ce2d7a4600b35fb4fa5094f538aa9df2548 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 19 Aug 2007 00:24:55 +0000 Subject: [PATCH 40/41] (custom-deps, finder-data, autoloads, recompile) (progmodes/cc-mode.elc, mh-e/mh-loaddefs.el): Use $(emacs) rather than $(EMACS), so that EMACSLOADPATH is set. Prevents any system shadow files messing up the compilation. --- lisp/Makefile.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 81d7b1d184d..59a81d7799d 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -90,12 +90,12 @@ $(lisp)/cus-load.el: custom-deps: $(lisp)/subdirs.el $(lisp)/loaddefs.el $(lisp)/cus-load.el doit wd=$(lisp); $(setwins_almost); \ echo Directories: $$wins; \ - $(EMACS) $(EMACSOPT) -l cus-dep --eval '(setq generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins + $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins finder-data: $(lisp)/subdirs.el $(lisp)/loaddefs.el doit wd=$(lisp); $(setwins_almost); \ echo Directories: $$wins; \ - $(EMACS) $(EMACSOPT) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins + $(emacs) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins $(lisp)/loaddefs.el: echo ";;; loaddefs.el --- automatically extracted autoloads" >> $@ @@ -110,7 +110,7 @@ $(lisp)/loaddefs.el: autoloads: $(lisp)/subdirs.el $(lisp)/loaddefs.el doit wd=$(lisp); $(setwins_almost); \ echo Directories: $$wins; \ - $(EMACS) $(EMACSOPT) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins + $(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins $(lisp)/subdirs.el: $(MAKE) $(MFLAGS) update-subdirs @@ -210,7 +210,7 @@ compile-after-backup: backup-compiled-files compile-always # new ones. recompile: doit mh-autoloads $(lisp)/progmodes/cc-mode.elc - $(EMACS) $(EMACSOPT) --eval "(batch-byte-recompile-directory 0)" $(lisp) + $(emacs) --eval "(batch-byte-recompile-directory 0)" $(lisp) # CC Mode uses a compile time macro system which causes a compile time # dependency in cc-mode.elc on the macros in cc-langs.el and the @@ -219,7 +219,7 @@ $(lisp)/progmodes/cc-mode.elc: \ $(lisp)/progmodes/cc-mode.el \ $(lisp)/progmodes/cc-langs.el \ $(lisp)/progmodes/cc-defs.el - $(EMACS) $(EMACSOPT) -f batch-byte-compile $(lisp)/progmodes/cc-mode.el + $(emacs) -f batch-byte-compile $(lisp)/progmodes/cc-mode.el # Update MH-E internal autoloads. These are not to be confused with # the autoloads for the MH-E entry points, which are already in @@ -256,7 +256,7 @@ $(lisp)/mh-e/mh-loaddefs.el: $(lisp)/subdirs.el $(MH_E_SRC) echo ";; no-update-autoloads: t" >> $@ echo ";; End:" >> $@ echo ";;; mh-loaddefs.el ends here" >> $@ - $(EMACS) $(EMACSOPT) \ + $(emacs) \ -l autoload \ --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \ --eval "(setq generated-autoload-file \"$(lisp)/mh-e/mh-loaddefs.el\")" \ From 30a718e6b77f4f0c422f748dd14ea772b7fa2a1a Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Mon, 20 Aug 2007 15:52:47 +0000 Subject: [PATCH 41/41] preceding-sexp --- lisp/ChangeLog | 6 ++ lisp/emacs-lisp/lisp-mode.el | 105 ++++++++++++++++++----------------- 2 files changed, 60 insertions(+), 51 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e5390ccf057..eefd54257a4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-20 Johannes Weiner (tiny change) + + * emacs-lisp/lisp-mode.el (preceding-sexp): New fun, the code was + extracted from `eval-last-sexp-1'. + (eval-last-sexp-1): Call `preceding-sexp'. + 2007-08-19 Glenn Morris * Makefile.in (custom-deps, finder-data, autoloads, recompile) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index d41c0af3d73..8b3e5a71c61 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -537,62 +537,65 @@ If CHAR is not a character, return nil." string)))) +(defun preceding-sexp () + "Return sexp before the point." + (let ((opoint (point)) + ignore-quotes + expr) + (save-excursion + (with-syntax-table emacs-lisp-mode-syntax-table + ;; If this sexp appears to be enclosed in `...' + ;; then ignore the surrounding quotes. + (setq ignore-quotes + (or (eq (following-char) ?\') + (eq (preceding-char) ?\'))) + (forward-sexp -1) + ;; If we were after `?\e' (or similar case), + ;; use the whole thing, not just the `e'. + (when (eq (preceding-char) ?\\) + (forward-char -1) + (when (eq (preceding-char) ??) + (forward-char -1))) + + ;; Skip over `#N='s. + (when (eq (preceding-char) ?=) + (let (labeled-p) + (save-excursion + (skip-chars-backward "0-9#=") + (setq labeled-p (looking-at "\\(#[0-9]+=\\)+"))) + (when labeled-p + (forward-sexp -1)))) + + (save-restriction + ;; vladimir@cs.ualberta.ca 30-Jul-1997: skip ` in + ;; `variable' so that the value is returned, not the + ;; name + (if (and ignore-quotes + (eq (following-char) ?`)) + (forward-char)) + (narrow-to-region (point-min) opoint) + (setq expr (read (current-buffer))) + ;; If it's an (interactive ...) form, it's more + ;; useful to show how an interactive call would + ;; use it. + (and (consp expr) + (eq (car expr) 'interactive) + (setq expr + (list 'call-interactively + (list 'quote + (list 'lambda + '(&rest args) + expr + 'args))))) + expr))))) + + (defun eval-last-sexp-1 (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in minibuffer. With argument, print output into current buffer." (let ((standard-output (if eval-last-sexp-arg-internal (current-buffer) t))) - (let ((value - (eval (let ((stab (syntax-table)) - (opoint (point)) - ignore-quotes - expr) - (save-excursion - (with-syntax-table emacs-lisp-mode-syntax-table - ;; If this sexp appears to be enclosed in `...' - ;; then ignore the surrounding quotes. - (setq ignore-quotes - (or (eq (following-char) ?\') - (eq (preceding-char) ?\'))) - (forward-sexp -1) - ;; If we were after `?\e' (or similar case), - ;; use the whole thing, not just the `e'. - (when (eq (preceding-char) ?\\) - (forward-char -1) - (when (eq (preceding-char) ??) - (forward-char -1))) + (eval-last-sexp-print-value (eval (preceding-sexp))))) - ;; Skip over `#N='s. - (when (eq (preceding-char) ?=) - (let (labeled-p) - (save-excursion - (skip-chars-backward "0-9#=") - (setq labeled-p (looking-at "\\(#[0-9]+=\\)+"))) - (when labeled-p - (forward-sexp -1)))) - - (save-restriction - ;; vladimir@cs.ualberta.ca 30-Jul-1997: skip ` in - ;; `variable' so that the value is returned, not the - ;; name - (if (and ignore-quotes - (eq (following-char) ?`)) - (forward-char)) - (narrow-to-region (point-min) opoint) - (setq expr (read (current-buffer))) - ;; If it's an (interactive ...) form, it's more - ;; useful to show how an interactive call would - ;; use it. - (and (consp expr) - (eq (car expr) 'interactive) - (setq expr - (list 'call-interactively - (list 'quote - (list 'lambda - '(&rest args) - expr - 'args))))) - expr))))))) - (eval-last-sexp-print-value value)))) (defun eval-last-sexp-print-value (value) (let ((unabbreviated (let ((print-length nil) (print-level nil))