aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-03-13 10:28:15 -0700
committerPaul Eggert2011-03-13 10:28:15 -0700
commit3eca4629203c3038f04db312999ca32d8e292e50 (patch)
tree7dab20a2f6de3e300fd266f51b71efd1d9f52188
parent01e0b5adf4e35c2b00705c212b853936fe218cac (diff)
parentd32df629a23d0e04eb70df9c6e60e821d905c822 (diff)
downloademacs-3eca4629203c3038f04db312999ca32d8e292e50.tar.gz
emacs-3eca4629203c3038f04db312999ca32d8e292e50.zip
Merge from mainline.
-rw-r--r--admin/admin.el230
-rw-r--r--admin/notes/elpa32
-rw-r--r--doc/emacs/ChangeLog5
-rw-r--r--doc/emacs/msdog.texi53
-rw-r--r--doc/misc/ChangeLog23
-rw-r--r--doc/misc/Makefile.in13
-rw-r--r--doc/misc/auth.texi12
-rw-r--r--doc/misc/trampver.texi2
-rw-r--r--lisp/ChangeLog61
-rw-r--r--lisp/allout-widgets.el4
-rw-r--r--lisp/ebuff-menu.el101
-rw-r--r--lisp/emacs-lisp/bytecomp.el11
-rw-r--r--lisp/files.el10
-rw-r--r--lisp/gnus/ChangeLog22
-rw-r--r--lisp/gnus/auth-source.el141
-rw-r--r--lisp/gnus/gnus-sync.el12
-rw-r--r--lisp/gnus/mm-uu.el6
-rw-r--r--lisp/help.el12
-rw-r--r--lisp/net/tramp-sh.el24
-rw-r--r--lisp/net/trampver.el4
-rw-r--r--lisp/progmodes/compile.el49
-rw-r--r--lisp/server.el8
-rw-r--r--lisp/vc/vc-bzr.el9
-rw-r--r--src/ChangeLog73
-rw-r--r--src/buffer.c3
-rw-r--r--src/deps.mk5
-rw-r--r--src/dired.c7
-rw-r--r--src/editfns.c133
-rw-r--r--src/fringe.c8
-rw-r--r--src/makefile.w32-in2
-rw-r--r--src/msdos.c7
-rw-r--r--src/msdos.h2
-rw-r--r--src/systime.h5
-rw-r--r--src/term.c2
-rw-r--r--src/termcap.c18
-rw-r--r--src/termhooks.h3
-rw-r--r--src/unexmacosx.c1
37 files changed, 839 insertions, 274 deletions
diff --git a/admin/admin.el b/admin/admin.el
index 717bfee702d..70958ce1a76 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -212,6 +212,236 @@ Root must be the root of an Emacs source tree."
212 "\\\\def\\\\year{") 212 "\\\\def\\\\year{")
213 "\\([0-9]\\{4\\}\\)}.+%.+copyright year")))))) 213 "\\([0-9]\\{4\\}\\)}.+%.+copyright year"))))))
214 214
215;;; Various bits of magic for generating the web manuals
216
217(defun make-manuals (root)
218 "Generate the web manuals for the Emacs webpage."
219 (interactive "DEmacs root directory: ")
220 (let* ((dest (expand-file-name "manual" root))
221 (html-node-dir (expand-file-name "html_node" dest))
222 (html-mono-dir (expand-file-name "html_mono" dest))
223 (txt-dir (expand-file-name "text" dest))
224 (dvi-dir (expand-file-name "dvi" dest))
225 (ps-dir (expand-file-name "ps" dest)))
226 (when (file-directory-p dest)
227 (if (y-or-n-p (format "Directory %s exists, delete it first?" dest))
228 (delete-directory dest t)
229 (error "Aborted")))
230 (make-directory dest)
231 (make-directory html-node-dir)
232 (make-directory html-mono-dir)
233 (make-directory txt-dir)
234 (make-directory dvi-dir)
235 (make-directory ps-dir)
236 ;; Emacs manual
237 (let ((texi (expand-file-name "doc/emacs/emacs.texi" root)))
238 (manual-html-node texi (expand-file-name "emacs" html-node-dir))
239 (manual-html-mono texi (expand-file-name "emacs.html" html-mono-dir))
240 (manual-txt texi (expand-file-name "emacs.txt" txt-dir))
241 (manual-pdf texi (expand-file-name "emacs.pdf" dest))
242 (manual-dvi texi (expand-file-name "emacs.dvi" dvi-dir)
243 (expand-file-name "emacs.ps" ps-dir)))
244 ;; Lisp manual
245 (let ((texi (expand-file-name "doc/lispref/elisp.texi" root)))
246 (manual-html-node texi (expand-file-name "elisp" html-node-dir))
247 (manual-html-mono texi (expand-file-name "elisp.html" html-mono-dir))
248 (manual-txt texi (expand-file-name "elisp.txt" txt-dir))
249 (manual-pdf texi (expand-file-name "elisp.pdf" dest))
250 (manual-dvi texi (expand-file-name "elisp.dvi" dvi-dir)
251 (expand-file-name "elisp.ps" ps-dir)))
252 (message "Manuals created in %s" dest)))
253
254(defconst manual-doctype-string
255 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
256\"http://www.w3.org/TR/html4/loose.dtd\">\n\n")
257
258(defconst manual-meta-string
259 "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
260<link rev=\"made\" href=\"mailto:webmasters@gnu.org\">
261<link rel=\"icon\" type=\"image/png\" href=\"/graphics/gnu-head-mini.png\">
262<meta name=\"ICBM\" content=\"42.256233,-71.006581\">
263<meta name=\"DC.title\" content=\"gnu.org\">\n\n")
264
265(defconst manual-style-string "<style type=\"text/css\">
266@import url('/style.css');\n</style>\n")
267
268(defun manual-html-mono (texi-file dest)
269 "Run Makeinfo on TEXI-FILE, emitting mono HTML output to DEST.
270This function also edits the HTML files so that they validate as
271HTML 4.01 Transitional, and pulls in the gnu.org stylesheet using
272the @import directive."
273 (call-process "makeinfo" nil nil nil
274 "--html" "--no-split" texi-file "-o" dest)
275 (with-temp-buffer
276 (insert-file-contents dest)
277 (setq buffer-file-name dest)
278 (manual-html-fix-headers)
279 (manual-html-fix-index-1)
280 (manual-html-fix-index-2 t)
281 (manual-html-fix-node-div)
282 (goto-char (point-max))
283 (re-search-backward "</body>[\n \t]*</html>")
284 (insert "</div>\n\n")
285 (save-buffer)))
286
287(defun manual-html-node (texi-file dir)
288 "Run Makeinfo on TEXI-FILE, emitting per-node HTML output to DIR.
289This function also edits the HTML files so that they validate as
290HTML 4.01 Transitional, and pulls in the gnu.org stylesheet using
291the @import directive."
292 (unless (file-exists-p texi-file)
293 (error "Manual file %s not found" texi-file))
294 (call-process "makeinfo" nil nil nil
295 "--html" texi-file "-o" dir)
296 ;; Loop through the node files, fixing them up.
297 (dolist (f (directory-files dir nil "\\.html\\'"))
298 (let (opoint)
299 (with-temp-buffer
300 (insert-file-contents (expand-file-name f dir))
301 (setq buffer-file-name (expand-file-name f dir))
302 (if (looking-at "<meta http-equiv")
303 ;; Ignore those HTML files that are just redirects.
304 (set-buffer-modified-p nil)
305 (manual-html-fix-headers)
306 (if (equal f "index.html")
307 (let (copyright-text)
308 (manual-html-fix-index-1)
309 ;; Move copyright notice to the end.
310 (re-search-forward "[ \t]*<p>Copyright &copy;")
311 (setq opoint (match-beginning 0))
312 (re-search-forward "</blockquote>")
313 (setq copyright-text (buffer-substring opoint (point)))
314 (delete-region opoint (point))
315 (manual-html-fix-index-2)
316 (insert copyright-text "\n</div>\n"))
317 ;; For normal nodes, give the header div a blue bg.
318 (manual-html-fix-node-div))
319 (save-buffer))))))
320
321(defun manual-txt (texi-file dest)
322 "Run Makeinfo on TEXI-FILE, emitting plaintext output to DEST."
323 (call-process "makeinfo" nil nil nil
324 "--plaintext" "--no-split" texi-file "-o" dest)
325 (shell-command (concat "gzip -c " dest " > " (concat dest ".gz"))))
326
327(defun manual-pdf (texi-file dest)
328 "Run texi2pdf on TEXI-FILE, emitting plaintext output to DEST."
329 (call-process "texi2pdf" nil nil nil texi-file "-o" dest))
330
331(defun manual-dvi (texi-file dest ps-dest)
332 "Run texi2dvi on TEXI-FILE, emitting dvi output to DEST.
333Also generate postscript output in PS-DEST."
334 (call-process "texi2dvi" nil nil nil texi-file "-o" dest)
335 (call-process "dvips" nil nil nil dest "-o" ps-dest)
336 (call-process "gzip" nil nil nil dest)
337 (call-process "gzip" nil nil nil ps-dest))
338
339(defun manual-html-fix-headers ()
340 "Fix up HTML headers for the Emacs manual in the current buffer."
341 (let (opoint)
342 (insert manual-doctype-string)
343 (search-forward "<head>\n")
344 (insert manual-meta-string)
345 (search-forward "<meta")
346 (setq opoint (match-beginning 0))
347 (re-search-forward "<!--")
348 (goto-char (match-beginning 0))
349 (delete-region opoint (point))
350 (insert manual-style-string)
351 (search-forward "<meta http-equiv=\"Content-Style")
352 (setq opoint (match-beginning 0))
353 (search-forward "</head>")
354 (delete-region opoint (match-beginning 0))))
355
356(defun manual-html-fix-node-div ()
357 "Fix up HTML \"node\" divs in the current buffer."
358 (let (opoint div-end)
359 (while (search-forward "<div class=\"node\">" nil t)
360 (replace-match
361 "<div class=\"node\" style=\"background-color:#DDDDFF\">"
362 t t)
363 (setq opoint (point))
364 (re-search-forward "</div>")
365 (setq div-end (match-beginning 0))
366 (goto-char opoint)
367 (if (search-forward "<hr>" div-end 'move)
368 (replace-match "" t t)))))
369
370(defun manual-html-fix-index-1 ()
371 (let (opoint)
372 (re-search-forward "<body>\n\\(<h1 class=\"settitle\\)")
373 (setq opoint (match-beginning 1))
374 (search-forward "<h2 class=\"unnumbered")
375 (goto-char (match-beginning 0))
376 (delete-region opoint (point))
377 (insert "<div id=\"content\" class=\"inner\">\n\n")))
378
379(defun manual-html-fix-index-2 (&optional table-workaround)
380 "Replace the index list in the current buffer with a HTML table."
381 (let (done open-td tag desc)
382 ;; Convert the list that Makeinfo made into a table.
383 (search-forward "<ul class=\"menu\">")
384 (replace-match "<table style=\"float:left\" width=\"100%\">")
385 (forward-line 1)
386 (while (not done)
387 (cond
388 ((or (looking-at "<li>\\(<a.+</a>\\):[ \t]+\\(.*\\)$")
389 (looking-at "<li>\\(<a.+</a>\\)$"))
390 (setq tag (match-string 1))
391 (setq desc (match-string 2))
392 (replace-match "" t t)
393 (when open-td
394 (save-excursion
395 (forward-char -1)
396 (skip-chars-backward " ")
397 (delete-region (point) (line-end-position))
398 (insert "</td>\n </tr>")))
399 (insert " <tr>\n ")
400 (if table-workaround
401 ;; This works around a Firefox bug in the mono file.
402 (insert "<td bgcolor=\"white\">")
403 (insert "<td>"))
404 (insert tag "</td>\n <td>" (or desc ""))
405 (setq open-td t))
406 ((eq (char-after) ?\n)
407 (delete-char 1)
408 ;; Negate the following `forward-line'.
409 (forward-line -1))
410 ((looking-at "<!-- ")
411 (search-forward "-->"))
412 ((looking-at "<p>[- ]*The Detailed Node Listing[- \n]*")
413 (replace-match " </td></tr></table>\n
414<h3>Detailed Node Listing</h3>\n\n" t t)
415 (search-forward "<p>")
416 (search-forward "<p>")
417 (goto-char (match-beginning 0))
418 (skip-chars-backward "\n ")
419 (setq open-td nil)
420 (insert "</p>\n\n<table style=\"float:left\" width=\"100%\">"))
421 ((looking-at "</li></ul>")
422 (replace-match "" t t))
423 ((looking-at "<p>")
424 (replace-match "" t t)
425 (when open-td
426 (insert " </td></tr>")
427 (setq open-td nil))
428 (insert " <tr>
429 <th colspan=\"2\" align=\"left\" style=\"text-align:left\">")
430 (re-search-forward "</p>[ \t\n]*<ul class=\"menu\">")
431 (replace-match " </th></tr>"))
432 ((looking-at "[ \t]*</ul>[ \t]*$")
433 (replace-match
434 (if open-td
435 " </td></tr>\n</table>"
436 "</table>") t t)
437 (setq done t))
438 (t
439 (if (eobp)
440 (error "Parse error in %s" f))
441 (unless open-td
442 (setq done t))))
443 (forward-line 1))))
444
215(provide 'admin) 445(provide 'admin)
216 446
217;;; admin.el ends here 447;;; admin.el ends here
diff --git a/admin/notes/elpa b/admin/notes/elpa
index cbea8cc1dfa..db14456fe32 100644
--- a/admin/notes/elpa
+++ b/admin/notes/elpa
@@ -1,24 +1,24 @@
1NOTES ON THE EMACS PACKAGE ARCHIVE 1NOTES ON THE EMACS PACKAGE ARCHIVE
2 2
3The GNU Emacs package archive, at elpa.gnu.org, is managed using Bzr. 3The GNU Emacs package archive, at elpa.gnu.org, is managed using a Bzr
4The Bzr branch is hosted on Savannah, and you can check it out with 4branch named "elpa", hosted on Savannah. To check it out:
5 5
6 bzr branch bzr+ssh://USER@bzr.savannah.gnu.org/emacs/elpa elpa 6 bzr branch bzr+ssh://USER@bzr.savannah.gnu.org/emacs/elpa elpa
7 cd elpa
8 echo "public_branch = bzr+ssh://USER@bzr.savannah.gnu.org/emacs/elpa" >> .bzr/branch/branch.conf
9 bzr bind bzr+ssh://USERNAME@bzr.savannah.gnu.org/emacs/elpa
10 [create task branch for edits, etc.]
7 11
8Changes made to this branch propagate to elpa.gnu.org as follows. 12Changes to this branch propagate to elpa.gnu.org in a semi-manual way.
9There exists a copy of the elpa branch on that machine. Someone with 13There exists a copy of the elpa branch on that machine. Someone with
10access must log in, pull the latest changes from Savannah, and run a 14access logs in, pulls the latest changes from Savannah, and runs a
11"deployment" script that generates the content at the web-visible 15"deployment" script. This script (which is itself kept in the Bzr
12location http://elpa.gnu.org/packages. 16branch) generates the content visible at http://elpa.gnu.org/packages.
13 17
14The reason things are set up this way, instead of using the package 18The reason we set things up this way, instead of using the package
15upload utilities in package-x.el, is so that Emacs hackers can easily 19upload commands in package-x.el, is to let Emacs hackers conveniently
16edit the contents of the Savannah "elpa" branch, with the aid of 20edit the contents of the "elpa" branch. (In particular, multi-file
17version control. (For instance, multi-file packages are stored on the 21packages are stored on the branch in source form, not as tarfiles.)
18Bzr branch in source form, not as tarfiles.) Because deployment is a
19semi-manual process, this allows us some flexibility in making changes
20to the branch on Savannah. Furthermore, one can use the elpa branch
21to deploy a "local" copy of the package archive, for testing.
22 22
23For details on how to use the elpa branch, see that README file in 23It is easy to use the elpa branch to deploy a "local" copy of the
24that branch. 24package archive. For details, see the README file in the elpa branch.
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index a53aa095cc2..a30ffc07971 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,8 @@
12011-03-12 Eli Zaretskii <eliz@gnu.org>
2
3 * msdog.texi (Windows HOME): Fix the wording to clarify how Emacs sets
4 HOME on Windows and where it looks for init files. (Bug#8221)
5
12011-03-10 Eli Zaretskii <eliz@gnu.org> 62011-03-10 Eli Zaretskii <eliz@gnu.org>
2 7
3 * search.texi (Regexp Example): 8 * search.texi (Regexp Example):
diff --git a/doc/emacs/msdog.texi b/doc/emacs/msdog.texi
index 7358773485d..0a454db86bb 100644
--- a/doc/emacs/msdog.texi
+++ b/doc/emacs/msdog.texi
@@ -404,36 +404,45 @@ names, which might cause misalignment of columns in Dired display.
404@dfn{user-specific application data directory}. The actual location 404@dfn{user-specific application data directory}. The actual location
405depends on your Windows version and system configuration; typical values 405depends on your Windows version and system configuration; typical values
406are @file{C:\Documents and Settings\@var{username}\Application Data} on 406are @file{C:\Documents and Settings\@var{username}\Application Data} on
407Windows 2K/XP and later, and either @file{C:\WINDOWS\Application Data} 407Windows 2K/XP/2K3, @file{C:\Users\@var{username}\AppData\Roaming} on
408Windows Vista/7/2K8, and either @file{C:\WINDOWS\Application Data}
408or @file{C:\WINDOWS\Profiles\@var{username}\Application Data} on the 409or @file{C:\WINDOWS\Profiles\@var{username}\Application Data} on the
409older Windows 9X/ME systems. 410older Windows 9X/ME systems. If this directory does not exist or
410 411cannot be accessed, Emacs falls back to @file{C:\} as the default
411 @code{HOME} can also be set in the system registry, for details see 412value of @code{HOME}.
413
414 You can override this default value of @code{HOME} by explicitly
415setting the environment variable @env{HOME} to point to any directory
416on your system. @env{HOME} can be set either from the command shell
417prompt or from the @samp{My Computer}s @samp{Properties} dialog.
418@code{HOME} can also be set in the system registry, for details see
412@ref{MS-Windows Registry}. 419@ref{MS-Windows Registry}.
413 420
414@cindex init file @file{.emacs} on MS-Windows 421 For compatibility with older versions of Emacs@footnote{
415 The home directory is where your init file @file{.emacs} is stored. 422Older versions of Emacs didn't check the application data directory.
416When Emacs starts, it first checks whether the environment variable 423}, if there is a file named @file{.emacs} in @file{C:\}, the root
417@env{HOME} is set. If it is, it looks for the init file in the 424directory of drive @file{C:}, and @env{HOME} is set neither in the
418directory pointed by @env{HOME}. If @env{HOME} is not defined, Emacs 425environment nor in the Registry, Emacs will treat @file{C:\} as the
419checks for an existing @file{.emacs} file in @file{C:\}, the root 426default @code{HOME} location, and will not look in the application
420directory of drive @file{C:}@footnote{ 427data directory, even if it exists. Note that only @file{.emacs} is
421The check in @file{C:\} is for compatibility with older versions of Emacs, 428looked for in @file{C:\}; the older name @file{_emacs} (see below) is
422which didn't check the application data directory. 429not. This use of @file{C:\.emacs} to define @code{HOME} is
423}. If there's no such file in @file{C:\}, Emacs next uses the Windows 430deprecated.
424system calls to find out the exact location of your application data 431
425directory. If that system call fails, Emacs falls back to @file{C:\}. 432 Whatever the final place is, Emacs sets the internal value of the
426 433@env{HOME} environment variable to point to it, and it will use that
427 Whatever the final place is, Emacs sets the value of the @env{HOME} 434location for other files and directories it normally looks for or
428environment variable to point to it, and it will use that location for 435creates in the user's home directory.
429other files and directories it normally creates in the user's home
430directory.
431 436
432 You can always find out where Emacs thinks is your home directory's 437 You can always find out where Emacs thinks is your home directory's
433location by typing @kbd{C-x d ~/ @key{RET}}. This should present the 438location by typing @kbd{C-x d ~/ @key{RET}}. This should present the
434list of files in the home directory, and show its full name on the 439list of files in the home directory, and show its full name on the
435first line. Likewise, to visit your init file, type @kbd{C-x C-f 440first line. Likewise, to visit your init file, type @kbd{C-x C-f
436~/.emacs @key{RET}}. 441~/.emacs @key{RET}} (assuming the file's name is @file{.emacs}).
442
443@cindex init file @file{.emacs} on MS-Windows
444 The home directory is where your init file is stored. It can have
445any name mentioned in @ref{Init File}.
437 446
438@cindex @file{_emacs} init file, MS-Windows 447@cindex @file{_emacs} init file, MS-Windows
439 Because MS-DOS does not allow file names with leading dots, and 448 Because MS-DOS does not allow file names with leading dots, and
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 96a2576355a..db3a944c160 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,26 @@
12011-03-12 Teodor Zlatanov <tzz@lifelogs.com>
2
3 * auth.texi (Help for developers): Update docs to explain that the
4 :save-function will only run the first time.
5
62011-03-12 Glenn Morris <rgm@gnu.org>
7
8 * Makefile.in (emacs-faq.html): Fix some more cross-refs.
9 (emacs-faq.text): New target.
10 (clean): Add emacs-faq.
11
122011-03-12 Michael Albinus <michael.albinus@gmx.de>
13
14 Sync with Tramp 2.2.1.
15
16 * trampver.texi: Update release number.
17
182011-03-11 Glenn Morris <rgm@gnu.org>
19
20 * Makefile.in (HTML_TARGETS): New.
21 (clean): Delete $HTML_TARGETS.
22 (emacs-faq.html): New, for use with the gnu.org Emacs webpage.
23
12011-03-08 Teodor Zlatanov <tzz@lifelogs.com> 242011-03-08 Teodor Zlatanov <tzz@lifelogs.com>
2 25
3 * auth.texi (Help for developers): Show example of using 26 * auth.texi (Help for developers): Show example of using
diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in
index 0a28d417c70..450199a33c5 100644
--- a/doc/misc/Makefile.in
+++ b/doc/misc/Makefile.in
@@ -197,6 +197,8 @@ PDF_TARGETS = \
197 widget.pdf \ 197 widget.pdf \
198 woman.pdf 198 woman.pdf
199 199
200HTML_TARGETS = emacs-faq.html
201
200TEXI2DVI = texi2dvi 202TEXI2DVI = texi2dvi
201TEXI2PDF = texi2pdf 203TEXI2PDF = texi2pdf
202 204
@@ -401,6 +403,15 @@ faq.dvi: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi
401 $(ENVADD) $(TEXI2DVI) $< 403 $(ENVADD) $(TEXI2DVI) $<
402faq.pdf: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi 404faq.pdf: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi
403 $(ENVADD) $(TEXI2PDF) $< 405 $(ENVADD) $(TEXI2PDF) $<
406## This is the name used on the Emacs web-page.
407## sed fixes up links to point to split version of the manual.
408emacs-faq.html: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi
409 $(MAKEINFO) $(MAKEINFO_OPTS) --no-split \
410 --css-ref='/layout.css' --html -o $@ $<
411 sed -i -e 's|a href="\([a-z]*\)\.html#\([^"]*\)"|a href="manual/html_node/\1/\2.html"|g' \
412 -e 's|/Top\.html|/|g' $@
413emacs-faq.text: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi
414 $(MAKEINFO) $(MAKEINFO_OPTS) --plaintext -o $@ $<
404 415
405flymake : $(infodir)/flymake 416flymake : $(infodir)/flymake
406$(infodir)/flymake: flymake.texi 417$(infodir)/flymake: flymake.texi
@@ -684,7 +695,7 @@ mostlyclean:
684 rm -f gnustmp.* 695 rm -f gnustmp.*
685 696
686clean: mostlyclean 697clean: mostlyclean
687 rm -f $(DVI_TARGETS) $(PDF_TARGETS) 698 rm -f $(DVI_TARGETS) $(PDF_TARGETS) $(HTML_TARGETS) emacs-faq.text
688 699
689distclean: clean 700distclean: clean
690# rm -f Makefile 701# rm -f Makefile
diff --git a/doc/misc/auth.texi b/doc/misc/auth.texi
index 85a3f098131..a16da92343e 100644
--- a/doc/misc/auth.texi
+++ b/doc/misc/auth.texi
@@ -289,11 +289,21 @@ Later, after a successful login, @code{nnimal.el} calls the
289 (funcall (nth 2 credentials))) 289 (funcall (nth 2 credentials)))
290@end example 290@end example
291 291
292Which will work whether the @code{:save-function} was provided or not. 292This will work whether the @code{:save-function} was provided or not.
293@code{:save-function} will be provided only when a new entry was 293@code{:save-function} will be provided only when a new entry was
294created, so this effectively says ``after a successful login, save the 294created, so this effectively says ``after a successful login, save the
295authentication information we just used, if it was newly created.'' 295authentication information we just used, if it was newly created.''
296 296
297After the first time it's called, the @code{:save-function} will not
298run again (but it will log something if you have set
299@code{auth-source-debug} to @code{'trivia}). This is so it won't ask
300the same question again, which is annoying. This is so it won't ask
301the same question again, which is annoying. This is so it won't ask
302the same question again, which is annoying.
303
304So the responsibility of the API user that specified @code{:create t}
305is to call the @code{:save-function} if it's provided.
306
297@defun auth-source-delete SPEC 307@defun auth-source-delete SPEC
298 308
299TODO: how to include docstring? 309TODO: how to include docstring?
diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi
index 437b1372c11..e4c444980c8 100644
--- a/doc/misc/trampver.texi
+++ b/doc/misc/trampver.texi
@@ -8,7 +8,7 @@
8@c In the Tramp CVS, the version number is auto-frobbed from 8@c In the Tramp CVS, the version number is auto-frobbed from
9@c configure.ac, so you should edit that file and run 9@c configure.ac, so you should edit that file and run
10@c "autoconf && ./configure" to change the version number. 10@c "autoconf && ./configure" to change the version number.
11@set trampver 2.2.1-pre 11@set trampver 2.2.1
12 12
13@c Other flags from configuration 13@c Other flags from configuration
14@set instprefix /usr/local 14@set instprefix /usr/local
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ca24dcff4a7..1f50ee9ebe6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,53 @@
12011-03-13 Juanma Barranquero <lekktu@gmail.com>
2
3 * help.el (describe-mode): Link to the mode's definition (bug#8185).
4
52011-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
6
7 * ebuff-menu.el (electric-buffer-menu-mode-map): Move initialization
8 into declaration. Remove redundant and harmful binding.
9
102011-03-12 Eli Zaretskii <eliz@gnu.org>
11
12 * files.el (file-ownership-preserved-p): Pass `integer' as an
13 explicit 2nd argument to `file-attributes'. If the file's owner
14 is the Administrators group on Windows, and the current user is
15 Administrator, consider that a match.
16
17 * server.el (server-ensure-safe-dir): Consider server directory
18 safe on MS-Windows if its owner is the Administrators group while
19 the current Emacs user is Administrator. Use `=' to compare
20 numerical UIDs, since they could be integers or floats.
21
222011-03-12 Juanma Barranquero <lekktu@gmail.com>
23
24 * vc/vc-bzr.el (vc-bzr-state): Handle bzr 2.3.0 (follow-up to bug#8170).
25
262011-03-12 Michael Albinus <michael.albinus@gmx.de>
27
28 Sync with Tramp 2.2.1.
29
30 * net/tramp-sh.el (tramp-methods): Exchange "%k" marker with options.
31
32 * net/trampver.el: Update release number.
33
342011-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
35
36 * progmodes/compile.el (compilation--previous-directory): Fix up
37 various nil/dead-marker mismatches (bug#8014).
38 (compilation-directory-properties, compilation-error-properties):
39 Don't call it at a position past the one we're about to change.
40
41 * emacs-lisp/bytecomp.el (byte-compile-make-obsolete-variable):
42 Disable obsolescence warnings in the file that declares it.
43
442011-03-11 Ken Manheimer <ken.manheimer@gmail.com>
45
46 * allout-widgets.el (allout-widgets-tally): Initialize
47 allout-widgets-tally as a hash table rather than nil to prevent
48 mode-line redisplay warnings.
49 Also, clarify the module description and fix a comment typo.
50
12011-03-11 Juanma Barranquero <lekktu@gmail.com> 512011-03-11 Juanma Barranquero <lekktu@gmail.com>
2 52
3 * help-fns.el (describe-variable): Don't complete keywords. 53 * help-fns.el (describe-variable): Don't complete keywords.
@@ -47,7 +97,7 @@
47 preserves the existing header prefix, rebulleting it if necessary, 97 preserves the existing header prefix, rebulleting it if necessary,
48 rather than replacing it. This is necessary for proper operation 98 rather than replacing it. This is necessary for proper operation
49 of cooperative addons like allout-widgets. 99 of cooperative addons like allout-widgets.
50 (allout-make-topic-prefix) (allout-rebullet-heading): Change 100 (allout-make-topic-prefix, allout-rebullet-heading): Change
51 SOLICIT arg to INSTEAD, and interpret additionally a string value 101 SOLICIT arg to INSTEAD, and interpret additionally a string value
52 as alternate bullet to be used, instead of prompting the user for 102 as alternate bullet to be used, instead of prompting the user for
53 a bullet character. 103 a bullet character.
@@ -883,7 +933,7 @@
8832011-02-17 Ken Manheimer <ken.manheimer@gmail.com> 9332011-02-17 Ken Manheimer <ken.manheimer@gmail.com>
884 934
885 * lisp/allout-widgets.el (allout-widgets-icons-light-subdir) 935 * lisp/allout-widgets.el (allout-widgets-icons-light-subdir)
886 (allout-widgets-icons-dark-subdir): Track relocations of icons 936 (allout-widgets-icons-dark-subdir): Track relocations of icons.
887 * lisp/allout.el: Remove commentary about remove encryption 937 * lisp/allout.el: Remove commentary about remove encryption
888 passphrase mnemonic support and verification. 938 passphrase mnemonic support and verification.
889 (allout-encrypt-string): Recognize epg failure to decrypt gpg2 939 (allout-encrypt-string): Recognize epg failure to decrypt gpg2
@@ -1260,10 +1310,9 @@
1260 1310
1261 (allout-auto-activation-helper, allout-setup): New autoloads 1311 (allout-auto-activation-helper, allout-setup): New autoloads
1262 implement new custom set procedure for allout-auto-activation. 1312 implement new custom set procedure for allout-auto-activation.
1263 Also, explicitly invoke 1313 Also, explicitly invoke (allout-setup) after allout-auto-activation
1264 (allout-setup) after allout-auto-activation is custom-defined, to 1314 is custom-defined, to affect the settings in emacs sessions besides
1265 effect the settings in emacs sessions besides the few where 1315 the few where allout-auto-activation customization is done.
1266 allout-auto-activation customization is donea.
1267 (allout-auto-activation): Use allout-auto-activation-helper to 1316 (allout-auto-activation): Use allout-auto-activation-helper to
1268 :set. Revise the docstring. 1317 :set. Revise the docstring.
1269 (allout-init): Reduce functionality to just customizing 1318 (allout-init): Reduce functionality to just customizing
diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el
index cc5fd6d96fa..47f181ab76b 100644
--- a/lisp/allout-widgets.el
+++ b/lisp/allout-widgets.el
@@ -1,4 +1,4 @@
1;; allout-widgets.el --- Show allout outline structure with graphical widgets. 1;; allout-widgets.el --- Visually highlight allout outline structure.
2 2
3;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ken Manheimer 3;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ken Manheimer
4 4
@@ -238,7 +238,7 @@ buffer, and tracking increases as new widgets are added and
238decreases as obsolete widgets are garbage collected." 238decreases as obsolete widgets are garbage collected."
239 :type 'boolean 239 :type 'boolean
240 :group 'allout-widgets-developer) 240 :group 'allout-widgets-developer)
241(defvar allout-widgets-tally nil 241(defvar allout-widgets-tally (make-hash-table :test 'eq :weakness 'key)
242 "Hash-table of existing allout widgets, for debugging. 242 "Hash-table of existing allout widgets, for debugging.
243 243
244Table is maintained iff `allout-widgets-maintain-tally' is non-nil. 244Table is maintained iff `allout-widgets-maintain-tally' is non-nil.
diff --git a/lisp/ebuff-menu.el b/lisp/ebuff-menu.el
index dd589cb58f7..a906cf8516a 100644
--- a/lisp/ebuff-menu.el
+++ b/lisp/ebuff-menu.el
@@ -34,7 +34,56 @@
34;; this depends on the format of list-buffers (from src/buffer.c) and 34;; this depends on the format of list-buffers (from src/buffer.c) and
35;; on stuff in lisp/buff-menu.el 35;; on stuff in lisp/buff-menu.el
36 36
37(defvar electric-buffer-menu-mode-map nil) 37(defvar electric-buffer-menu-mode-map
38 (let ((map (make-keymap)))
39 (fillarray (car (cdr map)) 'Electric-buffer-menu-undefined)
40 (define-key map "\e" nil)
41 (define-key map "\C-z" 'suspend-frame)
42 (define-key map "v" 'Electric-buffer-menu-mode-view-buffer)
43 (define-key map (char-to-string help-char) 'Helper-help)
44 (define-key map "?" 'Helper-describe-bindings)
45 (define-key map "\C-c" nil)
46 (define-key map "\C-c\C-c" 'Electric-buffer-menu-quit)
47 (define-key map "\C-]" 'Electric-buffer-menu-quit)
48 (define-key map "q" 'Electric-buffer-menu-quit)
49 (define-key map " " 'Electric-buffer-menu-select)
50 (define-key map "\C-m" 'Electric-buffer-menu-select)
51 (define-key map "\C-l" 'recenter)
52 (define-key map "s" 'Buffer-menu-save)
53 (define-key map "d" 'Buffer-menu-delete)
54 (define-key map "k" 'Buffer-menu-delete)
55 (define-key map "\C-d" 'Buffer-menu-delete-backwards)
56 ;; (define-key map "\C-k" 'Buffer-menu-delete)
57 (define-key map "\177" 'Buffer-menu-backup-unmark)
58 (define-key map "~" 'Buffer-menu-not-modified)
59 (define-key map "u" 'Buffer-menu-unmark)
60 (let ((i ?0))
61 (while (<= i ?9)
62 (define-key map (char-to-string i) 'digit-argument)
63 (define-key map (concat "\e" (char-to-string i)) 'digit-argument)
64 (setq i (1+ i))))
65 (define-key map "-" 'negative-argument)
66 (define-key map "\e-" 'negative-argument)
67 (define-key map "m" 'Buffer-menu-mark)
68 (define-key map "\C-u" 'universal-argument)
69 (define-key map "\C-p" 'previous-line)
70 (define-key map "\C-n" 'next-line)
71 (define-key map "p" 'previous-line)
72 (define-key map "n" 'next-line)
73 (define-key map "\C-v" 'scroll-up)
74 (define-key map "\ev" 'scroll-down)
75 (define-key map ">" 'scroll-right)
76 (define-key map "<" 'scroll-left)
77 (define-key map "\e\C-v" 'scroll-other-window)
78 (define-key map "\e>" 'end-of-buffer)
79 (define-key map "\e<" 'beginning-of-buffer)
80 (define-key map "\e\e" nil)
81 (define-key map "\e\e\e" 'Electric-buffer-menu-quit)
82 ;; This binding prevents the "escape => ESC" function-key-map mapping from
83 ;; kicking in!
84 ;; (define-key map [escape escape escape] 'Electric-buffer-menu-quit)
85 (define-key map [mouse-2] 'Electric-buffer-menu-mouse-select)
86 map))
38 87
39(defvar electric-buffer-menu-mode-hook nil 88(defvar electric-buffer-menu-mode-hook nil
40 "Normal hook run by `electric-buffer-list'.") 89 "Normal hook run by `electric-buffer-list'.")
@@ -167,55 +216,7 @@ Entry to this mode via command `electric-buffer-list' calls the value of
167;; generally the same as Buffer-menu-mode-map 216;; generally the same as Buffer-menu-mode-map
168;; (except we don't indirect to global-map) 217;; (except we don't indirect to global-map)
169(put 'Electric-buffer-menu-undefined 'suppress-keymap t) 218(put 'Electric-buffer-menu-undefined 'suppress-keymap t)
170(if electric-buffer-menu-mode-map 219
171 nil
172 (let ((map (make-keymap)))
173 (fillarray (car (cdr map)) 'Electric-buffer-menu-undefined)
174 (define-key map "\e" nil)
175 (define-key map "\C-z" 'suspend-frame)
176 (define-key map "v" 'Electric-buffer-menu-mode-view-buffer)
177 (define-key map (char-to-string help-char) 'Helper-help)
178 (define-key map "?" 'Helper-describe-bindings)
179 (define-key map "\C-c" nil)
180 (define-key map "\C-c\C-c" 'Electric-buffer-menu-quit)
181 (define-key map "\C-]" 'Electric-buffer-menu-quit)
182 (define-key map "q" 'Electric-buffer-menu-quit)
183 (define-key map " " 'Electric-buffer-menu-select)
184 (define-key map "\C-m" 'Electric-buffer-menu-select)
185 (define-key map "\C-l" 'recenter)
186 (define-key map "s" 'Buffer-menu-save)
187 (define-key map "d" 'Buffer-menu-delete)
188 (define-key map "k" 'Buffer-menu-delete)
189 (define-key map "\C-d" 'Buffer-menu-delete-backwards)
190 ;(define-key map "\C-k" 'Buffer-menu-delete)
191 (define-key map "\177" 'Buffer-menu-backup-unmark)
192 (define-key map "~" 'Buffer-menu-not-modified)
193 (define-key map "u" 'Buffer-menu-unmark)
194 (let ((i ?0))
195 (while (<= i ?9)
196 (define-key map (char-to-string i) 'digit-argument)
197 (define-key map (concat "\e" (char-to-string i)) 'digit-argument)
198 (setq i (1+ i))))
199 (define-key map "-" 'negative-argument)
200 (define-key map "\e-" 'negative-argument)
201 (define-key map "m" 'Buffer-menu-mark)
202 (define-key map "\C-u" 'universal-argument)
203 (define-key map "\C-p" 'previous-line)
204 (define-key map "\C-n" 'next-line)
205 (define-key map "p" 'previous-line)
206 (define-key map "n" 'next-line)
207 (define-key map "\C-v" 'scroll-up)
208 (define-key map "\ev" 'scroll-down)
209 (define-key map ">" 'scroll-right)
210 (define-key map "<" 'scroll-left)
211 (define-key map "\e\C-v" 'scroll-other-window)
212 (define-key map "\e>" 'end-of-buffer)
213 (define-key map "\e<" 'beginning-of-buffer)
214 (define-key map "\e\e" nil)
215 (define-key map "\e\e\e" 'Electric-buffer-menu-quit)
216 (define-key map [escape escape escape] 'Electric-buffer-menu-quit)
217 (define-key map [mouse-2] 'Electric-buffer-menu-mouse-select)
218 (setq electric-buffer-menu-mode-map map)))
219 220
220(defun Electric-buffer-menu-exit () 221(defun Electric-buffer-menu-exit ()
221 (interactive) 222 (interactive)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 2f113dfb479..5e24b80ac5a 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -3840,6 +3840,17 @@ that suppresses all warnings during execution of BODY."
3840 ,@decls 3840 ,@decls
3841 ',(nth 1 form))))) 3841 ',(nth 1 form)))))
3842 3842
3843;; If foo.el declares `toto' as obsolete, it is likely that foo.el will
3844;; actually use `toto' in order for this obsolete variable to still work
3845;; correctly, so paradoxically, while byte-compiling foo.el, the presence
3846;; of a make-obsolete-variable call for `toto' is an indication that `toto'
3847;; should not trigger obsolete-warnings in foo.el.
3848(byte-defop-compiler-1 make-obsolete-variable)
3849(defun byte-compile-make-obsolete-variable (form)
3850 (when (eq 'quote (car-safe (nth 1 form)))
3851 (push (nth 1 (nth 1 form)) byte-compile-not-obsolete-vars))
3852 (byte-compile-normal-call form))
3853
3843(defun byte-compile-defvar (form) 3854(defun byte-compile-defvar (form)
3844 ;; This is not used for file-level defvar/consts with doc strings. 3855 ;; This is not used for file-level defvar/consts with doc strings.
3845 (when (and (symbolp (nth 1 form)) 3856 (when (and (symbolp (nth 1 form))
diff --git a/lisp/files.el b/lisp/files.el
index ffc0b33119f..198d5ca87de 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3895,11 +3895,17 @@ See also `file-name-version-regexp'."
3895 (let ((handler (find-file-name-handler file 'file-ownership-preserved-p))) 3895 (let ((handler (find-file-name-handler file 'file-ownership-preserved-p)))
3896 (if handler 3896 (if handler
3897 (funcall handler 'file-ownership-preserved-p file) 3897 (funcall handler 'file-ownership-preserved-p file)
3898 (let ((attributes (file-attributes file))) 3898 (let ((attributes (file-attributes file 'integer)))
3899 ;; Return t if the file doesn't exist, since it's true that no 3899 ;; Return t if the file doesn't exist, since it's true that no
3900 ;; information would be lost by an (attempted) delete and create. 3900 ;; information would be lost by an (attempted) delete and create.
3901 (or (null attributes) 3901 (or (null attributes)
3902 (= (nth 2 attributes) (user-uid))))))) 3902 (= (nth 2 attributes) (user-uid))
3903 ;; Files created on Windows by Administrator (RID=500)
3904 ;; have the Administrators group (RID=544) recorded as
3905 ;; their owner. Rewriting them will still preserve the
3906 ;; owner.
3907 (and (eq system-type 'windows-nt)
3908 (= (user-uid) 500) (= (nth 2 attributes) 544)))))))
3903 3909
3904(defun file-name-sans-extension (filename) 3910(defun file-name-sans-extension (filename)
3905 "Return FILENAME sans final \"extension\". 3911 "Return FILENAME sans final \"extension\".
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index dbd52c5fece..ec12faada98 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,25 @@
12011-03-12 Teodor Zlatanov <tzz@lifelogs.com>
2
3 * auth-source.el (auth-source-format-prompt): Always convert the value
4 to a string to avoid evaluating non-string arguments.
5 (auth-source-netrc-create): Offer default properly, not as initial
6 content in `read-string'.
7 (auth-source-netrc-saver): Use a cache keyed by file name and MD5 hash
8 of line to determine if we've been run before. If so, don't run again,
9 but print a trivial message to indicate the cache was hit instead.
10
112011-03-11 Teodor Zlatanov <tzz@lifelogs.com>
12
13 * gnus-sync.el (gnus-sync-install-hooks, gnus-sync-unload-hook): Don't
14 install `gnus-sync-read' to any hooks by default. It's buggy. The
15 user will have to run `gnus-sync-read' manually and wait for Cloudy
16 Gnus.
17
182011-03-11 Julien Danjou <julien@danjou.info>
19
20 * mm-uu.el (mm-uu-type-alist): Add support for diff starting with "===
21 modified file".
22
12011-03-09 Teodor Zlatanov <tzz@lifelogs.com> 232011-03-09 Teodor Zlatanov <tzz@lifelogs.com>
2 24
3 * auth-source.el (auth-source-read-char-choice): New function to read a 25 * auth-source.el (auth-source-read-char-choice): New function to read a
diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el
index b7e0c97ce50..0fb153ad09b 100644
--- a/lisp/gnus/auth-source.el
+++ b/lisp/gnus/auth-source.el
@@ -54,6 +54,8 @@
54(autoload 'secrets-list-collections "secrets") 54(autoload 'secrets-list-collections "secrets")
55(autoload 'secrets-search-items "secrets") 55(autoload 'secrets-search-items "secrets")
56 56
57(autoload 'rfc2104-hash "rfc2104")
58
57(defvar secrets-enabled) 59(defvar secrets-enabled)
58 60
59(defgroup auth-source nil 61(defgroup auth-source nil
@@ -770,7 +772,9 @@ while \(:host t) would find all host entries."
770 (let ((c (nth 0 cell)) 772 (let ((c (nth 0 cell))
771 (v (nth 1 cell))) 773 (v (nth 1 cell)))
772 (when (and c v) 774 (when (and c v)
773 (setq prompt (replace-regexp-in-string (format "%%%c" c) v prompt))))) 775 (setq prompt (replace-regexp-in-string (format "%%%c" c)
776 (format "%s" v)
777 prompt)))))
774 prompt) 778 prompt)
775 779
776(defun auth-source-ensure-strings (values) 780(defun auth-source-ensure-strings (values)
@@ -1096,7 +1100,7 @@ See `auth-source-search' for details on SPEC."
1096 ;; special case prompt for passwords 1100 ;; special case prompt for passwords
1097 (read-passwd prompt)) 1101 (read-passwd prompt))
1098 ((null data) 1102 ((null data)
1099 (read-string prompt default)) 1103 (read-string prompt nil nil default))
1100 (t (or data default)))) 1104 (t (or data default))))
1101 1105
1102 (when data 1106 (when data
@@ -1138,70 +1142,79 @@ See `auth-source-search' for details on SPEC."
1138 1142
1139 (list artificial))) 1143 (list artificial)))
1140 1144
1141;;(funcall (plist-get (nth 0 (auth-source-search :host '("nonesuch") :user "tzz" :port "imap" :create t :max 1)) :save-function)) 1145;;(funcall (plist-get (nth 0 (auth-source-search :host '("nonesuch2") :user "tzz" :port "imap" :create t :max 1)) :save-function))
1142(defun auth-source-netrc-saver (file add) 1146(defun auth-source-netrc-saver (file add)
1143 "Save a line ADD in FILE, prompting along the way. 1147 "Save a line ADD in FILE, prompting along the way.
1144Respects `auth-source-save-behavior'." 1148Respects `auth-source-save-behavior'. Uses
1145 (with-temp-buffer 1149`auth-source-netrc-cache' to avoid prompting more than once."
1146 (when (file-exists-p file) 1150 (let* ((key (format "%s %s" file (rfc2104-hash 'md5 64 16 file add)))
1147 (insert-file-contents file)) 1151 (cached (assoc key auth-source-netrc-cache)))
1148 (when auth-source-gpg-encrypt-to 1152
1149 ;; (see bug#7487) making `epa-file-encrypt-to' local to 1153 (if cached
1150 ;; this buffer lets epa-file skip the key selection query 1154 (auth-source-do-trivia
1151 ;; (see the `local-variable-p' check in 1155 "auth-source-netrc-saver: found previous run for key %s, returning"
1152 ;; `epa-file-write-region'). 1156 key)
1153 (unless (local-variable-p 'epa-file-encrypt-to (current-buffer)) 1157 (with-temp-buffer
1154 (make-local-variable 'epa-file-encrypt-to)) 1158 (when (file-exists-p file)
1155 (if (listp auth-source-gpg-encrypt-to) 1159 (insert-file-contents file))
1156 (setq epa-file-encrypt-to auth-source-gpg-encrypt-to))) 1160 (when auth-source-gpg-encrypt-to
1157 ;; we want the new data to be found first, so insert at beginning 1161 ;; (see bug#7487) making `epa-file-encrypt-to' local to
1158 (goto-char (point-min)) 1162 ;; this buffer lets epa-file skip the key selection query
1159 1163 ;; (see the `local-variable-p' check in
1160 ;; ask AFTER we've successfully opened the file 1164 ;; `epa-file-write-region').
1161 (let ((prompt (format "Save auth info to file %s? " file)) 1165 (unless (local-variable-p 'epa-file-encrypt-to (current-buffer))
1162 (done (not (eq auth-source-save-behavior 'ask))) 1166 (make-local-variable 'epa-file-encrypt-to))
1163 (bufname "*auth-source Help*") 1167 (if (listp auth-source-gpg-encrypt-to)
1164 k) 1168 (setq epa-file-encrypt-to auth-source-gpg-encrypt-to)))
1165 (while (not done) 1169 ;; we want the new data to be found first, so insert at beginning
1166 (setq k (auth-source-read-char-choice prompt '(?y ?n ?N ?e ??))) 1170 (goto-char (point-min))
1167 (case k 1171
1168 (?y (setq done t)) 1172 ;; ask AFTER we've successfully opened the file
1169 (?? (save-excursion 1173 (let ((prompt (format "Save auth info to file %s? " file))
1170 (with-output-to-temp-buffer bufname 1174 (done (not (eq auth-source-save-behavior 'ask)))
1171 (princ 1175 (bufname "*auth-source Help*")
1172 (concat "(y)es, save\n" 1176 k)
1173 "(n)o but use the info\n" 1177 (while (not done)
1174 "(N)o and don't ask to save again\n" 1178 (setq k (auth-source-read-char-choice prompt '(?y ?n ?N ?e ??)))
1175 "(e)dit the line\n" 1179 (case k
1176 "(?) for help as you can see.\n")) 1180 (?y (setq done t))
1177 (set-buffer standard-output) 1181 (?? (save-excursion
1178 (help-mode)))) 1182 (with-output-to-temp-buffer bufname
1179 (?n (setq add "" 1183 (princ
1180 done t)) 1184 (concat "(y)es, save\n"
1181 (?N (setq add "" 1185 "(n)o but use the info\n"
1182 done t 1186 "(N)o and don't ask to save again\n"
1183 auth-source-save-behavior nil)) 1187 "(e)dit the line\n"
1184 (?e (setq add (read-string "Line to add: " add))) 1188 "(?) for help as you can see.\n"))
1185 (t nil))) 1189 (set-buffer standard-output)
1186 1190 (help-mode))))
1187 (when (get-buffer-window bufname) 1191 (?n (setq add ""
1188 (delete-window (get-buffer-window bufname))) 1192 done t))
1189 1193 (?N (setq add ""
1190 ;; make sure the info is not saved 1194 done t
1191 (when (null auth-source-save-behavior) 1195 auth-source-save-behavior nil))
1192 (setq add "")) 1196 (?e (setq add (read-string "Line to add: " add)))
1193 1197 (t nil)))
1194 (when (< 0 (length add)) 1198
1195 (progn 1199 (when (get-buffer-window bufname)
1196 (unless (bolp) 1200 (delete-window (get-buffer-window bufname)))
1197 (insert "\n")) 1201
1198 (insert add "\n") 1202 ;; make sure the info is not saved
1199 (write-region (point-min) (point-max) file nil 'silent) 1203 (when (null auth-source-save-behavior)
1200 (auth-source-do-debug 1204 (setq add ""))
1201 "auth-source-netrc-create: wrote 1 new line to %s" 1205
1202 file) 1206 (when (< 0 (length add))
1203 (message "Saved new authentication information to %s" file) 1207 (progn
1204 nil))))) 1208 (unless (bolp)
1209 (insert "\n"))
1210 (insert add "\n")
1211 (write-region (point-min) (point-max) file nil 'silent)
1212 (auth-source-do-debug
1213 "auth-source-netrc-create: wrote 1 new line to %s"
1214 file)
1215 (message "Saved new authentication information to %s" file)
1216 nil))))
1217 (aput 'auth-source-netrc-cache key "ran"))))
1205 1218
1206;;; Backend specific parsing: Secrets API backend 1219;;; Backend specific parsing: Secrets API backend
1207 1220
diff --git a/lisp/gnus/gnus-sync.el b/lisp/gnus/gnus-sync.el
index 892b10a0d0e..fbdacdd2fbe 100644
--- a/lisp/gnus/gnus-sync.el
+++ b/lisp/gnus/gnus-sync.el
@@ -25,7 +25,8 @@
25;; This is the gnus-sync.el package. 25;; This is the gnus-sync.el package.
26 26
27;; It's due for a rewrite using gnus-after-set-mark-hook and 27;; It's due for a rewrite using gnus-after-set-mark-hook and
28;; gnus-before-update-mark-hook. Until then please consider it 28;; gnus-before-update-mark-hook, and my plan is to do this once No
29;; Gnus development is done. Until then please consider it
29;; experimental. 30;; experimental.
30 31
31;; Put this in your startup file (~/.gnus.el for instance) 32;; Put this in your startup file (~/.gnus.el for instance)
@@ -42,7 +43,8 @@
42 43
43;; TODO: 44;; TODO:
44 45
45;; - after gnus-sync-read, the message counts are wrong 46;; - after gnus-sync-read, the message counts are wrong. So it's not
47;; run automatically, you have to call it with M-x gnus-sync-read
46 48
47;; - use gnus-after-set-mark-hook and gnus-before-update-mark-hook to 49;; - use gnus-after-set-mark-hook and gnus-before-update-mark-hook to
48;; catch the mark updates 50;; catch the mark updates
@@ -220,13 +222,13 @@ synchronized, I believe). Also see `gnus-variable-list'."
220 "Install the sync hooks." 222 "Install the sync hooks."
221 (interactive) 223 (interactive)
222 ;; (add-hook 'gnus-get-new-news-hook 'gnus-sync-read) 224 ;; (add-hook 'gnus-get-new-news-hook 'gnus-sync-read)
223 (add-hook 'gnus-save-newsrc-hook 'gnus-sync-save) 225 ;; (add-hook 'gnus-read-newsrc-el-hook 'gnus-sync-read)
224 (add-hook 'gnus-read-newsrc-el-hook 'gnus-sync-read)) 226 (add-hook 'gnus-save-newsrc-hook 'gnus-sync-save))
225 227
226(defun gnus-sync-unload-hook () 228(defun gnus-sync-unload-hook ()
227 "Uninstall the sync hooks." 229 "Uninstall the sync hooks."
228 (interactive) 230 (interactive)
229 ;; (remove-hook 'gnus-get-new-news-hook 'gnus-sync-read) 231 (remove-hook 'gnus-get-new-news-hook 'gnus-sync-read)
230 (remove-hook 'gnus-save-newsrc-hook 'gnus-sync-save) 232 (remove-hook 'gnus-save-newsrc-hook 'gnus-sync-save)
231 (remove-hook 'gnus-read-newsrc-el-hook 'gnus-sync-read)) 233 (remove-hook 'gnus-read-newsrc-el-hook 'gnus-sync-read))
232 234
diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el
index 14b44198303..96dce48a774 100644
--- a/lisp/gnus/mm-uu.el
+++ b/lisp/gnus/mm-uu.el
@@ -158,6 +158,12 @@ This can be either \"inline\" or \"attachment\".")
158 mm-uu-diff-extract 158 mm-uu-diff-extract
159 nil 159 nil
160 mm-uu-diff-test) 160 mm-uu-diff-test)
161 (diff
162 "^=== modified file "
163 nil
164 mm-uu-diff-extract
165 nil
166 mm-uu-diff-test)
161 (git-format-patch 167 (git-format-patch
162 "^diff --git " 168 "^diff --git "
163 "^-- " 169 "^-- "
diff --git a/lisp/help.el b/lisp/help.el
index 9fcb06c559f..e148e5ef6ab 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -871,7 +871,17 @@ whose documentation describes the minor mode."
871 (let ((start (point))) 871 (let ((start (point)))
872 (insert (format-mode-line mode nil nil buffer)) 872 (insert (format-mode-line mode nil nil buffer))
873 (add-text-properties start (point) '(face bold))))) 873 (add-text-properties start (point) '(face bold)))))
874 (princ " mode:\n") 874 (princ " mode")
875 (let* ((mode major-mode)
876 (file-name (find-lisp-object-file-name mode nil)))
877 (when file-name
878 (princ (concat " defined in `" (file-name-nondirectory file-name) "'"))
879 ;; Make a hyperlink to the library.
880 (with-current-buffer standard-output
881 (save-excursion
882 (re-search-backward "`\\([^`']+\\)'" nil t)
883 (help-xref-button 1 'help-function-def mode file-name)))))
884 (princ ":\n")
875 (princ (documentation major-mode))))) 885 (princ (documentation major-mode)))))
876 ;; For the sake of IELM and maybe others 886 ;; For the sake of IELM and maybe others
877 nil) 887 nil)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index ec75ea78fe1..ec5c46b2897 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -90,7 +90,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
90 (tramp-login-args (("%h") ("-l" "%u"))) 90 (tramp-login-args (("%h") ("-l" "%u")))
91 (tramp-remote-sh "/bin/sh") 91 (tramp-remote-sh "/bin/sh")
92 (tramp-copy-program "rcp") 92 (tramp-copy-program "rcp")
93 (tramp-copy-args (("%k" "-p") ("-r"))) 93 (tramp-copy-args (("-p" "%k") ("-r")))
94 (tramp-copy-keep-date t) 94 (tramp-copy-keep-date t)
95 (tramp-copy-recursive t))) 95 (tramp-copy-recursive t)))
96;;;###tramp-autoload 96;;;###tramp-autoload
@@ -100,7 +100,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
100 (tramp-login-args (("%h") ("-l" "%u"))) 100 (tramp-login-args (("%h") ("-l" "%u")))
101 (tramp-remote-sh "/bin/sh") 101 (tramp-remote-sh "/bin/sh")
102 (tramp-copy-program "rcp") 102 (tramp-copy-program "rcp")
103 (tramp-copy-args (("%k" "-p"))) 103 (tramp-copy-args (("-p" "%k")))
104 (tramp-copy-keep-date t))) 104 (tramp-copy-keep-date t)))
105;;;###tramp-autoload 105;;;###tramp-autoload
106(add-to-list 'tramp-methods 106(add-to-list 'tramp-methods
@@ -110,7 +110,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
110 (tramp-async-args (("-q"))) 110 (tramp-async-args (("-q")))
111 (tramp-remote-sh "/bin/sh") 111 (tramp-remote-sh "/bin/sh")
112 (tramp-copy-program "scp") 112 (tramp-copy-program "scp")
113 (tramp-copy-args (("-P" "%p") ("%k" "-p") ("-q") ("-r"))) 113 (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")))
114 (tramp-copy-keep-date t) 114 (tramp-copy-keep-date t)
115 (tramp-copy-recursive t) 115 (tramp-copy-recursive t)
116 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") 116 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -126,7 +126,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
126 (tramp-async-args (("-q"))) 126 (tramp-async-args (("-q")))
127 (tramp-remote-sh "/bin/sh") 127 (tramp-remote-sh "/bin/sh")
128 (tramp-copy-program "scp") 128 (tramp-copy-program "scp")
129 (tramp-copy-args (("-1") ("-P" "%p") ("%k" "-p") ("-q") ("-r"))) 129 (tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k") ("-q") ("-r")))
130 (tramp-copy-keep-date t) 130 (tramp-copy-keep-date t)
131 (tramp-copy-recursive t) 131 (tramp-copy-recursive t)
132 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") 132 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -142,7 +142,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
142 (tramp-async-args (("-q"))) 142 (tramp-async-args (("-q")))
143 (tramp-remote-sh "/bin/sh") 143 (tramp-remote-sh "/bin/sh")
144 (tramp-copy-program "scp") 144 (tramp-copy-program "scp")
145 (tramp-copy-args (("-2") ("-P" "%p") ("%k" "-p") ("-q") ("-r"))) 145 (tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k") ("-q") ("-r")))
146 (tramp-copy-keep-date t) 146 (tramp-copy-keep-date t)
147 (tramp-copy-recursive t) 147 (tramp-copy-recursive t)
148 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") 148 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -160,7 +160,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
160 (tramp-async-args (("-q"))) 160 (tramp-async-args (("-q")))
161 (tramp-remote-sh "/bin/sh") 161 (tramp-remote-sh "/bin/sh")
162 (tramp-copy-program "scp") 162 (tramp-copy-program "scp")
163 (tramp-copy-args (("-P" "%p") ("%k" "-p") ("-q") ("-r") 163 (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")
164 ("-o" "ControlPath=%t.%%r@%%h:%%p") 164 ("-o" "ControlPath=%t.%%r@%%h:%%p")
165 ("-o" "ControlMaster=auto"))) 165 ("-o" "ControlMaster=auto")))
166 (tramp-copy-keep-date t) 166 (tramp-copy-keep-date t)
@@ -179,7 +179,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
179 (tramp-async-args (("-q"))) 179 (tramp-async-args (("-q")))
180 (tramp-remote-sh "/bin/sh") 180 (tramp-remote-sh "/bin/sh")
181 (tramp-copy-program "scp") 181 (tramp-copy-program "scp")
182 (tramp-copy-args (("-P" "%p") ("%k" "-p") ("-q") ("-r"))) 182 (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")))
183 (tramp-copy-keep-date t) 183 (tramp-copy-keep-date t)
184 (tramp-copy-recursive t) 184 (tramp-copy-recursive t)
185 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") 185 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -202,7 +202,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
202 (tramp-async-args (("-q"))) 202 (tramp-async-args (("-q")))
203 (tramp-remote-sh "/bin/sh") 203 (tramp-remote-sh "/bin/sh")
204 (tramp-copy-program "rsync") 204 (tramp-copy-program "rsync")
205 (tramp-copy-args (("-e" "ssh") ("%k" "-t") ("-r"))) 205 (tramp-copy-args (("-e" "ssh") ("-t" "%k") ("-r")))
206 (tramp-copy-keep-date t) 206 (tramp-copy-keep-date t)
207 (tramp-copy-keep-tmpfile t) 207 (tramp-copy-keep-tmpfile t)
208 (tramp-copy-recursive t))) 208 (tramp-copy-recursive t)))
@@ -217,7 +217,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
217 (tramp-async-args (("-q"))) 217 (tramp-async-args (("-q")))
218 (tramp-remote-sh "/bin/sh") 218 (tramp-remote-sh "/bin/sh")
219 (tramp-copy-program "rsync") 219 (tramp-copy-program "rsync")
220 (tramp-copy-args (("%k" "-t") ("-r"))) 220 (tramp-copy-args (("-t" "%k") ("-r")))
221 (tramp-copy-env (("RSYNC_RSH") 221 (tramp-copy-env (("RSYNC_RSH")
222 (,(concat 222 (,(concat
223 "ssh" 223 "ssh"
@@ -353,7 +353,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
353 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h"))) 353 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h")))
354 (tramp-remote-sh "/bin/sh") 354 (tramp-remote-sh "/bin/sh")
355 (tramp-copy-program "pscp") 355 (tramp-copy-program "pscp")
356 (tramp-copy-args (("-P" "%p") ("-scp") ("%k" "-p") 356 (tramp-copy-args (("-P" "%p") ("-scp") ("-p" "%k")
357 ("-q") ("-r"))) 357 ("-q") ("-r")))
358 (tramp-copy-keep-date t) 358 (tramp-copy-keep-date t)
359 (tramp-copy-recursive t) 359 (tramp-copy-recursive t)
@@ -366,7 +366,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
366 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h"))) 366 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h")))
367 (tramp-remote-sh "/bin/sh") 367 (tramp-remote-sh "/bin/sh")
368 (tramp-copy-program "pscp") 368 (tramp-copy-program "pscp")
369 (tramp-copy-args (("-P" "%p") ("-sftp") ("%k" "-p") 369 (tramp-copy-args (("-P" "%p") ("-sftp") ("-p" "%k")
370 ("-q") ("-r"))) 370 ("-q") ("-r")))
371 (tramp-copy-keep-date t) 371 (tramp-copy-keep-date t)
372 (tramp-copy-recursive t) 372 (tramp-copy-recursive t)
@@ -378,7 +378,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
378 (tramp-login-args (("%h") ("-l" "%u") ("sh" "-i"))) 378 (tramp-login-args (("%h") ("-l" "%u") ("sh" "-i")))
379 (tramp-remote-sh "/bin/sh -i") 379 (tramp-remote-sh "/bin/sh -i")
380 (tramp-copy-program "fcp") 380 (tramp-copy-program "fcp")
381 (tramp-copy-args (("%k" "-p"))) 381 (tramp-copy-args (("-p" "%k")))
382 (tramp-copy-keep-date t))) 382 (tramp-copy-keep-date t)))
383 383
384;;;###tramp-autoload 384;;;###tramp-autoload
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index 1f3064c7066..462b8f11397 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -31,7 +31,7 @@
31;; should be changed only there. 31;; should be changed only there.
32 32
33;;;###tramp-autoload 33;;;###tramp-autoload
34(defconst tramp-version "2.2.1-pre" 34(defconst tramp-version "2.2.1"
35 "This version of Tramp.") 35 "This version of Tramp.")
36 36
37;;;###tramp-autoload 37;;;###tramp-autoload
@@ -44,7 +44,7 @@
44 (= emacs-major-version 21) 44 (= emacs-major-version 21)
45 (>= emacs-minor-version 4))) 45 (>= emacs-minor-version 4)))
46 "ok" 46 "ok"
47 (format "Tramp 2.2.1-pre is not fit for %s" 47 (format "Tramp 2.2.1 is not fit for %s"
48 (when (string-match "^.*$" (emacs-version)) 48 (when (string-match "^.*$" (emacs-version))
49 (match-string 0 (emacs-version))))))) 49 (match-string 0 (emacs-version)))))))
50 (unless (string-match "\\`ok\\'" x) (error "%s" x))) 50 (unless (string-match "\\`ok\\'" x) (error "%s" x)))
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 88f418f934a..40383c6bc31 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -860,27 +860,29 @@ POS and RES.")
860 (car compilation--previous-directory-cache))) 860 (car compilation--previous-directory-cache)))
861 (prev 861 (prev
862 (previous-single-property-change 862 (previous-single-property-change
863 pos 'compilation-directory nil cache))) 863 pos 'compilation-directory nil cache))
864 (cond 864 (res
865 ((null cache) 865 (cond
866 (setq compilation--previous-directory-cache 866 ((null cache)
867 (cons (copy-marker pos) (copy-marker prev))) 867 (setq compilation--previous-directory-cache
868 prev) 868 (cons (copy-marker pos) (if prev (copy-marker prev))))
869 ((eq prev cache) 869 prev)
870 (if cache 870 ((and prev (= prev cache))
871 (set-marker (car compilation--previous-directory-cache) pos) 871 (if cache
872 (setq compilation--previous-directory-cache 872 (set-marker (car compilation--previous-directory-cache) pos)
873 (cons (copy-marker pos) nil))) 873 (setq compilation--previous-directory-cache
874 (cdr compilation--previous-directory-cache)) 874 (cons (copy-marker pos) nil)))
875 (t 875 (cdr compilation--previous-directory-cache))
876 (if cache 876 (t
877 (progn 877 (if cache
878 (set-marker (car compilation--previous-directory-cache) pos) 878 (progn
879 (setcdr compilation--previous-directory-cache 879 (set-marker cache pos)
880 (copy-marker prev))) 880 (setcdr compilation--previous-directory-cache
881 (setq compilation--previous-directory-cache 881 (copy-marker prev)))
882 (cons (copy-marker pos) (copy-marker prev)))) 882 (setq compilation--previous-directory-cache
883 prev))))) 883 (cons (copy-marker pos) (if prev (copy-marker prev)))))
884 prev))))
885 (if (markerp res) (marker-position res) res))))
884 886
885;; Internal function for calculating the text properties of a directory 887;; Internal function for calculating the text properties of a directory
886;; change message. The compilation-directory property is important, because it 888;; change message. The compilation-directory property is important, because it
@@ -889,7 +891,7 @@ POS and RES.")
889(defun compilation-directory-properties (idx leave) 891(defun compilation-directory-properties (idx leave)
890 (if leave (setq leave (match-end leave))) 892 (if leave (setq leave (match-end leave)))
891 ;; find previous stack, and push onto it, or if `leave' pop it 893 ;; find previous stack, and push onto it, or if `leave' pop it
892 (let ((dir (compilation--previous-directory (point)))) 894 (let ((dir (compilation--previous-directory (match-beginning 0))))
893 (setq dir (if dir (or (get-text-property (1- dir) 'compilation-directory) 895 (setq dir (if dir (or (get-text-property (1- dir) 'compilation-directory)
894 (get-text-property dir 'compilation-directory)))) 896 (get-text-property dir 'compilation-directory))))
895 `(font-lock-face ,(if leave 897 `(font-lock-face ,(if leave
@@ -948,7 +950,8 @@ POS and RES.")
948 (match-string-no-properties file)))) 950 (match-string-no-properties file))))
949 (let ((dir 951 (let ((dir
950 (unless (file-name-absolute-p file) 952 (unless (file-name-absolute-p file)
951 (let ((pos (compilation--previous-directory (point)))) 953 (let ((pos (compilation--previous-directory
954 (match-beginning 0))))
952 (when pos 955 (when pos
953 (or (get-text-property (1- pos) 'compilation-directory) 956 (or (get-text-property (1- pos) 'compilation-directory)
954 (get-text-property pos 'compilation-directory))))))) 957 (get-text-property pos 'compilation-directory)))))))
diff --git a/lisp/server.el b/lisp/server.el
index df8cae0a6af..cb1903ad96c 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -485,7 +485,13 @@ See variable `server-auth-dir' for details."
485 (file-name-as-directory dir)) 485 (file-name-as-directory dir))
486 :warning) 486 :warning)
487 (throw :safe t)) 487 (throw :safe t))
488 (unless (eql uid (user-uid)) ; is the dir ours? 488 (unless (or (= uid (user-uid)) ; is the dir ours?
489 (and w32
490 ;; Files created on Windows by
491 ;; Administrator (RID=500) have
492 ;; the Administrators (RID=544)
493 ;; group recorded as the owner.
494 (= uid 544) (= (user-uid) 500)))
489 (throw :safe nil)) 495 (throw :safe nil))
490 (when w32 ; on NTFS? 496 (when w32 ; on NTFS?
491 (throw :safe t)) 497 (throw :safe t))
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index a0a16601ed7..21cb86a9840 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -435,8 +435,13 @@ If any error occurred in running `bzr status', then return nil."
435(defun vc-bzr-state (file) 435(defun vc-bzr-state (file)
436 (lexical-let ((result (vc-bzr-status file))) 436 (lexical-let ((result (vc-bzr-status file)))
437 (when (consp result) 437 (when (consp result)
438 (when (cdr result) 438 (let ((warnings (cdr result)))
439 (message "Warnings in `bzr' output: %s" (cdr result))) 439 (when warnings
440 ;; bzr 2.3.0 returns info about shelves, which is not really a warning
441 (when (string-match "[1-9]+ shel\\(f\\|ves\\) exists?\\..*?\n" warnings)
442 (setq warnings (replace-match "" nil nil warnings)))
443 (unless (string= warnings "")
444 (message "Warnings in `bzr' output: %s" warnings))))
440 (cdr (assq (car result) 445 (cdr (assq (car result)
441 '((added . added) 446 '((added . added)
442 (kindchanged . edited) 447 (kindchanged . edited)
diff --git a/src/ChangeLog b/src/ChangeLog
index 0097626c463..e840bb3c036 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,7 @@
12011-03-13 Paul Eggert <eggert@cs.ucla.edu> 12011-03-13 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Fix more problems found by GCC 4.5.2's static checks.
4
3 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char * 5 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
4 to unsigned char * to avoid compiler diagnostic. 6 to unsigned char * to avoid compiler diagnostic.
5 (xg_free_frame_widgets): Make it clear that a local variable is 7 (xg_free_frame_widgets): Make it clear that a local variable is
@@ -22,8 +24,6 @@
22 Mark another local as initialized. 24 Mark another local as initialized.
23 (my_png_error, my_error_exit): Mark with NO_RETURN. 25 (my_png_error, my_error_exit): Mark with NO_RETURN.
24 26
252011-03-11 Paul Eggert <eggert@cs.ucla.edu>
26
27 * image.c (clear_image_cache): Now static. 27 * image.c (clear_image_cache): Now static.
28 (DIM, HAVE_STDLIB_H_1): Remove unused macros. 28 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
29 (xpm_load): Redo to avoid "discards qualifiers" gcc warning. 29 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
@@ -35,6 +35,75 @@
35 35
362011-03-11 Paul Eggert <eggert@cs.ucla.edu> 362011-03-11 Paul Eggert <eggert@cs.ucla.edu>
37 37
38 Improve quality of tests for time stamp overflow.
39 For example, without this patch (encode-time 0 0 0 1 1
40 1152921504606846976) returns the obviously-bogus value (-948597
41 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
42 reports time overflow. See
43 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
44 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
45 * editfns.c: Include limits.h and intprops.h.
46 (TIME_T_MIN, TIME_T_MAX): New macros.
47 (time_overflow): Move earlier, to before first use.
48 (hi_time, lo_time): New functions, for an accurate test for
49 out-of-range times.
50 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
51 (Fget_internal_run_time): Don't assume time_t fits in int.
52 (make_time): Use list2 instead of Fcons twice.
53 (Fdecode_time): More accurate test for out-of-range times.
54 (check_tm_member): New function.
55 (Fencode_time): Use it, to test for out-of-range times.
56 (lisp_time_argument): Don't rely on undefined left-shift and
57 right-shift behavior when checking for time stamp overflow.
58
59 * editfns.c (time_overflow): New function, refactoring common code.
60 (Fformat_time_string, Fdecode_time, Fencode_time):
61 (Fcurrent_time_string): Use it.
62
63 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
64 * dired.c (make_time): Move to ...
65 * editfns.c (make_time): ... here.
66 * systime.h: Note the move.
67
682011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
69
70 * fringe.c (update_window_fringes): Remove unused variables.
71
72 * unexmacosx.c (copy_data_segment): Also copy __got section.
73 (Bug#8223)
74
752011-03-12 Eli Zaretskii <eliz@gnu.org>
76
77 * termcap.c [MSDOS]: Include "msdos.h.
78 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
79 Constify `char *' arguments and their references according to
80 prototypes in tparam.h.
81
82 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
83
84 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
85 Adapt all references accordingly.
86
87 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
88
892011-03-11 Tom Tromey <tromey@redhat.com>
90
91 * buffer.c (syms_of_buffer): Remove obsolete comment.
92
932011-03-11 Eli Zaretskii <eliz@gnu.org>
94
95 * termhooks.h (encode_terminal_code): Declare prototype.
96
97 * msdos.c (encode_terminal_code): Don't declare prototype.
98
99 * term.c (encode_terminal_code): Now external again, used by
100 w32console.c and msdos.c.
101
102 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)): Depend
103 on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
104
1052011-03-11 Paul Eggert <eggert@cs.ucla.edu>
106
38 Fix some minor problems found by GCC 4.5.2's static checks. 107 Fix some minor problems found by GCC 4.5.2's static checks.
39 108
40 * fringe.c (update_window_fringes): Mark locals as initialized 109 * fringe.c (update_window_fringes): Mark locals as initialized
diff --git a/src/buffer.c b/src/buffer.c
index c95fbb5f516..448c9236387 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5332,9 +5332,6 @@ syms_of_buffer (void)
5332 Fput (Qprotected_field, Qerror_message, 5332 Fput (Qprotected_field, Qerror_message,
5333 make_pure_c_string ("Attempt to modify a protected field")); 5333 make_pure_c_string ("Attempt to modify a protected field"));
5334 5334
5335 /* All these use DEFVAR_LISP_NOPRO because the slots in
5336 buffer_defaults will all be marked via Vbuffer_defaults. */
5337
5338 DEFVAR_BUFFER_DEFAULTS ("default-mode-line-format", 5335 DEFVAR_BUFFER_DEFAULTS ("default-mode-line-format",
5339 mode_line_format, 5336 mode_line_format,
5340 doc: /* Default value of `mode-line-format' for buffers that don't override it. 5337 doc: /* Default value of `mode-line-format' for buffers that don't override it.
diff --git a/src/deps.mk b/src/deps.mk
index 2b162b07bb8..80a5721cf39 100644
--- a/src/deps.mk
+++ b/src/deps.mk
@@ -87,7 +87,8 @@ dosfns.o: buffer.h termchar.h termhooks.h frame.h blockinput.h window.h \
87 msdos.h dosfns.h dispextern.h charset.h coding.h atimer.h systime.h \ 87 msdos.h dosfns.h dispextern.h charset.h coding.h atimer.h systime.h \
88 lisp.h $(config_h) 88 lisp.h $(config_h)
89editfns.o: editfns.c window.h buffer.h systime.h $(INTERVALS_H) character.h \ 89editfns.o: editfns.c window.h buffer.h systime.h $(INTERVALS_H) character.h \
90 coding.h frame.h blockinput.h atimer.h ../lib/unistd.h ../lib/strftime.h \ 90 coding.h frame.h blockinput.h atimer.h \
91 ../lib/intprops.h ../lib/strftime.h ../lib/unistd.h \
91 lisp.h globals.h $(config_h) 92 lisp.h globals.h $(config_h)
92emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \ 93emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \
93 termhooks.h buffer.h atimer.h systime.h $(INTERVALS_H) lisp.h $(config_h) \ 94 termhooks.h buffer.h atimer.h systime.h $(INTERVALS_H) lisp.h $(config_h) \
@@ -191,7 +192,7 @@ term.o: term.c termchar.h termhooks.h termopts.h lisp.h globals.h $(config_h) \
191 cm.h frame.h disptab.h keyboard.h character.h charset.h coding.h ccl.h \ 192 cm.h frame.h disptab.h keyboard.h character.h charset.h coding.h ccl.h \
192 xterm.h msdos.h window.h keymap.h blockinput.h atimer.h systime.h \ 193 xterm.h msdos.h window.h keymap.h blockinput.h atimer.h systime.h \
193 systty.h syssignal.h tparam.h $(INTERVALS_H) buffer.h ../lib/unistd.h 194 systty.h syssignal.h tparam.h $(INTERVALS_H) buffer.h ../lib/unistd.h
194termcap.o: termcap.c lisp.h $(config_h) 195termcap.o: termcap.c lisp.h tparam.h msdos.h $(config_h)
195terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \ 196terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \
196 keyboard.h lisp.h globals.h $(config_h) dispextern.h composite.h systime.h \ 197 keyboard.h lisp.h globals.h $(config_h) dispextern.h composite.h systime.h \
197 msdos.h 198 msdos.h
diff --git a/src/dired.c b/src/dired.c
index 96063680d4d..d201418d78b 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -848,13 +848,6 @@ file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_ad
848 return value; 848 return value;
849} 849}
850 850
851Lisp_Object
852make_time (time_t time)
853{
854 return Fcons (make_number (time >> 16),
855 Fcons (make_number (time & 0177777), Qnil));
856}
857
858static char * 851static char *
859stat_uname (struct stat *st) 852stat_uname (struct stat *st)
860{ 853{
diff --git a/src/editfns.c b/src/editfns.c
index 28690e7c76d..d92d3482d09 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -45,6 +45,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
45#endif 45#endif
46 46
47#include <ctype.h> 47#include <ctype.h>
48#include <limits.h>
49#include <intprops.h>
48#include <strftime.h> 50#include <strftime.h>
49 51
50#include "intervals.h" 52#include "intervals.h"
@@ -87,6 +89,7 @@ extern char **environ;
87extern Lisp_Object w32_get_internal_run_time (void); 89extern Lisp_Object w32_get_internal_run_time (void);
88#endif 90#endif
89 91
92static void time_overflow (void) NO_RETURN;
90static int tm_diff (struct tm *, struct tm *); 93static int tm_diff (struct tm *, struct tm *);
91static void find_field (Lisp_Object, Lisp_Object, Lisp_Object, 94static void find_field (Lisp_Object, Lisp_Object, Lisp_Object,
92 EMACS_INT *, Lisp_Object, EMACS_INT *); 95 EMACS_INT *, Lisp_Object, EMACS_INT *);
@@ -1414,6 +1417,49 @@ DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0,
1414 return make_number (getpid ()); 1417 return make_number (getpid ());
1415} 1418}
1416 1419
1420
1421
1422#ifndef TIME_T_MIN
1423# define TIME_T_MIN TYPE_MINIMUM (time_t)
1424#endif
1425#ifndef TIME_T_MAX
1426# define TIME_T_MAX TYPE_MAXIMUM (time_t)
1427#endif
1428
1429/* Report that a time value is out of range for Emacs. */
1430static void
1431time_overflow (void)
1432{
1433 error ("Specified time is not representable");
1434}
1435
1436/* Return the upper part of the time T (everything but the bottom 16 bits),
1437 making sure that it is representable. */
1438static EMACS_INT
1439hi_time (time_t t)
1440{
1441 time_t hi = t >> 16;
1442
1443 /* Check for overflow, helping the compiler for common cases where
1444 no runtime check is needed, and taking care not to convert
1445 negative numbers to unsigned before comparing them. */
1446 if (! ((! TYPE_SIGNED (time_t)
1447 || MOST_NEGATIVE_FIXNUM <= TIME_T_MIN >> 16
1448 || MOST_NEGATIVE_FIXNUM <= hi)
1449 && (TIME_T_MAX >> 16 <= MOST_POSITIVE_FIXNUM
1450 || hi <= MOST_POSITIVE_FIXNUM)))
1451 time_overflow ();
1452
1453 return hi;
1454}
1455
1456/* Return the bottom 16 bits of the time T. */
1457static EMACS_INT
1458lo_time (time_t t)
1459{
1460 return t & ((1 << 16) - 1);
1461}
1462
1417DEFUN ("current-time", Fcurrent_time, Scurrent_time, 0, 0, 0, 1463DEFUN ("current-time", Fcurrent_time, Scurrent_time, 0, 0, 0,
1418 doc: /* Return the current time, as the number of seconds since 1970-01-01 00:00:00. 1464 doc: /* Return the current time, as the number of seconds since 1970-01-01 00:00:00.
1419The time is returned as a list of three integers. The first has the 1465The time is returned as a list of three integers. The first has the
@@ -1428,8 +1474,8 @@ resolution finer than a second. */)
1428 EMACS_TIME t; 1474 EMACS_TIME t;
1429 1475
1430 EMACS_GET_TIME (t); 1476 EMACS_GET_TIME (t);
1431 return list3 (make_number ((EMACS_SECS (t) >> 16) & 0xffff), 1477 return list3 (make_number (hi_time (EMACS_SECS (t))),
1432 make_number ((EMACS_SECS (t) >> 0) & 0xffff), 1478 make_number (lo_time (EMACS_SECS (t))),
1433 make_number (EMACS_USECS (t))); 1479 make_number (EMACS_USECS (t)));
1434} 1480}
1435 1481
@@ -1448,7 +1494,8 @@ on systems that do not provide resolution finer than a second. */)
1448{ 1494{
1449#ifdef HAVE_GETRUSAGE 1495#ifdef HAVE_GETRUSAGE
1450 struct rusage usage; 1496 struct rusage usage;
1451 int secs, usecs; 1497 time_t secs;
1498 int usecs;
1452 1499
1453 if (getrusage (RUSAGE_SELF, &usage) < 0) 1500 if (getrusage (RUSAGE_SELF, &usage) < 0)
1454 /* This shouldn't happen. What action is appropriate? */ 1501 /* This shouldn't happen. What action is appropriate? */
@@ -1463,8 +1510,8 @@ on systems that do not provide resolution finer than a second. */)
1463 secs++; 1510 secs++;
1464 } 1511 }
1465 1512
1466 return list3 (make_number ((secs >> 16) & 0xffff), 1513 return list3 (make_number (hi_time (secs)),
1467 make_number ((secs >> 0) & 0xffff), 1514 make_number (lo_time (secs)),
1468 make_number (usecs)); 1515 make_number (usecs));
1469#else /* ! HAVE_GETRUSAGE */ 1516#else /* ! HAVE_GETRUSAGE */
1470#ifdef WINDOWSNT 1517#ifdef WINDOWSNT
@@ -1476,6 +1523,19 @@ on systems that do not provide resolution finer than a second. */)
1476} 1523}
1477 1524
1478 1525
1526/* Make a Lisp list that represents the time T. */
1527Lisp_Object
1528make_time (time_t t)
1529{
1530 return list2 (make_number (hi_time (t)),
1531 make_number (lo_time (t)));
1532}
1533
1534/* Decode a Lisp list SPECIFIED_TIME that represents a time.
1535 If SPECIFIED_TIME is nil, use the current time.
1536 Set *RESULT to seconds since the Epoch.
1537 If USEC is not null, set *USEC to the microseconds component.
1538 Return nonzero if successful. */
1479int 1539int
1480lisp_time_argument (Lisp_Object specified_time, time_t *result, int *usec) 1540lisp_time_argument (Lisp_Object specified_time, time_t *result, int *usec)
1481{ 1541{
@@ -1496,6 +1556,7 @@ lisp_time_argument (Lisp_Object specified_time, time_t *result, int *usec)
1496 else 1556 else
1497 { 1557 {
1498 Lisp_Object high, low; 1558 Lisp_Object high, low;
1559 EMACS_INT hi;
1499 high = Fcar (specified_time); 1560 high = Fcar (specified_time);
1500 CHECK_NUMBER (high); 1561 CHECK_NUMBER (high);
1501 low = Fcdr (specified_time); 1562 low = Fcdr (specified_time);
@@ -1519,8 +1580,21 @@ lisp_time_argument (Lisp_Object specified_time, time_t *result, int *usec)
1519 else if (usec) 1580 else if (usec)
1520 *usec = 0; 1581 *usec = 0;
1521 CHECK_NUMBER (low); 1582 CHECK_NUMBER (low);
1522 *result = (XINT (high) << 16) + (XINT (low) & 0xffff); 1583 hi = XINT (high);
1523 return *result >> 16 == XINT (high); 1584
1585 /* Check for overflow, helping the compiler for common cases
1586 where no runtime check is needed, and taking care not to
1587 convert negative numbers to unsigned before comparing them. */
1588 if (! ((TYPE_SIGNED (time_t)
1589 ? (TIME_T_MIN >> 16 <= MOST_NEGATIVE_FIXNUM
1590 || TIME_T_MIN >> 16 <= hi)
1591 : 0 <= hi)
1592 && (MOST_POSITIVE_FIXNUM <= TIME_T_MAX >> 16
1593 || hi <= TIME_T_MAX >> 16)))
1594 return 0;
1595
1596 *result = (hi << 16) + (XINT (low) & 0xffff);
1597 return 1;
1524 } 1598 }
1525} 1599}
1526 1600
@@ -1674,7 +1748,7 @@ For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */)
1674 tm = ut ? gmtime (&value) : localtime (&value); 1748 tm = ut ? gmtime (&value) : localtime (&value);
1675 UNBLOCK_INPUT; 1749 UNBLOCK_INPUT;
1676 if (! tm) 1750 if (! tm)
1677 error ("Specified time is not representable"); 1751 time_overflow ();
1678 1752
1679 synchronize_system_time_locale (); 1753 synchronize_system_time_locale ();
1680 1754
@@ -1732,8 +1806,10 @@ DOW and ZONE.) */)
1732 BLOCK_INPUT; 1806 BLOCK_INPUT;
1733 decoded_time = localtime (&time_spec); 1807 decoded_time = localtime (&time_spec);
1734 UNBLOCK_INPUT; 1808 UNBLOCK_INPUT;
1735 if (! decoded_time) 1809 if (! (decoded_time
1736 error ("Specified time is not representable"); 1810 && MOST_NEGATIVE_FIXNUM - TM_YEAR_BASE <= decoded_time->tm_year
1811 && decoded_time->tm_year <= MOST_POSITIVE_FIXNUM - TM_YEAR_BASE))
1812 time_overflow ();
1737 XSETFASTINT (list_args[0], decoded_time->tm_sec); 1813 XSETFASTINT (list_args[0], decoded_time->tm_sec);
1738 XSETFASTINT (list_args[1], decoded_time->tm_min); 1814 XSETFASTINT (list_args[1], decoded_time->tm_min);
1739 XSETFASTINT (list_args[2], decoded_time->tm_hour); 1815 XSETFASTINT (list_args[2], decoded_time->tm_hour);
@@ -1757,6 +1833,20 @@ DOW and ZONE.) */)
1757 return Flist (9, list_args); 1833 return Flist (9, list_args);
1758} 1834}
1759 1835
1836/* Return OBJ - OFFSET, checking that OBJ is a valid fixnum and that
1837 the result is representable as an int. Assume OFFSET is small and
1838 nonnegative. */
1839static int
1840check_tm_member (Lisp_Object obj, int offset)
1841{
1842 EMACS_INT n;
1843 CHECK_NUMBER (obj);
1844 n = XINT (obj);
1845 if (! (INT_MIN + offset <= n && n - offset <= INT_MAX))
1846 time_overflow ();
1847 return n - offset;
1848}
1849
1760DEFUN ("encode-time", Fencode_time, Sencode_time, 6, MANY, 0, 1850DEFUN ("encode-time", Fencode_time, Sencode_time, 6, MANY, 0,
1761 doc: /* Convert SECOND, MINUTE, HOUR, DAY, MONTH, YEAR and ZONE to internal time. 1851 doc: /* Convert SECOND, MINUTE, HOUR, DAY, MONTH, YEAR and ZONE to internal time.
1762This is the reverse operation of `decode-time', which see. 1852This is the reverse operation of `decode-time', which see.
@@ -1785,19 +1875,12 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
1785 struct tm tm; 1875 struct tm tm;
1786 Lisp_Object zone = (nargs > 6 ? args[nargs - 1] : Qnil); 1876 Lisp_Object zone = (nargs > 6 ? args[nargs - 1] : Qnil);
1787 1877
1788 CHECK_NUMBER (args[0]); /* second */ 1878 tm.tm_sec = check_tm_member (args[0], 0);
1789 CHECK_NUMBER (args[1]); /* minute */ 1879 tm.tm_min = check_tm_member (args[1], 0);
1790 CHECK_NUMBER (args[2]); /* hour */ 1880 tm.tm_hour = check_tm_member (args[2], 0);
1791 CHECK_NUMBER (args[3]); /* day */ 1881 tm.tm_mday = check_tm_member (args[3], 0);
1792 CHECK_NUMBER (args[4]); /* month */ 1882 tm.tm_mon = check_tm_member (args[4], 1);
1793 CHECK_NUMBER (args[5]); /* year */ 1883 tm.tm_year = check_tm_member (args[5], TM_YEAR_BASE);
1794
1795 tm.tm_sec = XINT (args[0]);
1796 tm.tm_min = XINT (args[1]);
1797 tm.tm_hour = XINT (args[2]);
1798 tm.tm_mday = XINT (args[3]);
1799 tm.tm_mon = XINT (args[4]) - 1;
1800 tm.tm_year = XINT (args[5]) - TM_YEAR_BASE;
1801 tm.tm_isdst = -1; 1884 tm.tm_isdst = -1;
1802 1885
1803 if (CONSP (zone)) 1886 if (CONSP (zone))
@@ -1846,7 +1929,7 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
1846 } 1929 }
1847 1930
1848 if (time == (time_t) -1) 1931 if (time == (time_t) -1)
1849 error ("Specified time is not representable"); 1932 time_overflow ();
1850 1933
1851 return make_time (time); 1934 return make_time (time);
1852} 1935}
@@ -1881,7 +1964,7 @@ but this is considered obsolete. */)
1881 tm = localtime (&value); 1964 tm = localtime (&value);
1882 UNBLOCK_INPUT; 1965 UNBLOCK_INPUT;
1883 if (! (tm && TM_YEAR_IN_ASCTIME_RANGE (tm->tm_year) && (tem = asctime (tm)))) 1966 if (! (tm && TM_YEAR_IN_ASCTIME_RANGE (tm->tm_year) && (tem = asctime (tm))))
1884 error ("Specified time is not representable"); 1967 time_overflow ();
1885 1968
1886 /* Remove the trailing newline. */ 1969 /* Remove the trailing newline. */
1887 tem[strlen (tem) - 1] = '\0'; 1970 tem[strlen (tem) - 1] = '\0';
diff --git a/src/fringe.c b/src/fringe.c
index 82fc38aee8a..ce75df766ee 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -954,18 +954,10 @@ update_window_fringes (struct window *w, int keep_current_p)
954 y < yb && rn < nrows; 954 y < yb && rn < nrows;
955 y += row->height, ++rn) 955 y += row->height, ++rn)
956 { 956 {
957 unsigned indicate_bob_p, indicate_top_line_p;
958 unsigned indicate_eob_p, indicate_bottom_line_p;
959
960 row = w->desired_matrix->rows + rn; 957 row = w->desired_matrix->rows + rn;
961 if (!row->enabled_p) 958 if (!row->enabled_p)
962 row = w->current_matrix->rows + rn; 959 row = w->current_matrix->rows + rn;
963 960
964 indicate_bob_p = row->indicate_bob_p;
965 indicate_top_line_p = row->indicate_top_line_p;
966 indicate_eob_p = row->indicate_eob_p;
967 indicate_bottom_line_p = row->indicate_bottom_line_p;
968
969 row->indicate_bob_p = row->indicate_top_line_p = 0; 961 row->indicate_bob_p = row->indicate_top_line_p = 0;
970 row->indicate_eob_p = row->indicate_bottom_line_p = 0; 962 row->indicate_eob_p = row->indicate_bottom_line_p = 0;
971 963
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index 7a702fd45bf..81f758f1b5f 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -1466,6 +1466,7 @@ $(BLD)/term.$(O) : \
1466 $(SRC)/termchar.h \ 1466 $(SRC)/termchar.h \
1467 $(SRC)/termhooks.h \ 1467 $(SRC)/termhooks.h \
1468 $(SRC)/termopts.h \ 1468 $(SRC)/termopts.h \
1469 $(SRC)/tparam.h \
1469 $(SRC)/w32gui.h \ 1470 $(SRC)/w32gui.h \
1470 $(SRC)/window.h 1471 $(SRC)/window.h
1471 1472
@@ -1498,6 +1499,7 @@ $(BLD)/textprop.$(O) : \
1498 1499
1499$(BLD)/tparam.$(O) : \ 1500$(BLD)/tparam.$(O) : \
1500 $(SRC)/tparam.c \ 1501 $(SRC)/tparam.c \
1502 $(SRC)/tparam.h \
1501 $(CONFIG_H) \ 1503 $(CONFIG_H) \
1502 $(LISP_H) 1504 $(LISP_H)
1503 1505
diff --git a/src/msdos.c b/src/msdos.c
index 261a09ac859..b0bf5c4fdd9 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -844,6 +844,7 @@ IT_set_face (int face)
844 844
845extern unsigned char *encode_terminal_code (struct glyph *, int, 845extern unsigned char *encode_terminal_code (struct glyph *, int,
846 struct coding_system *); 846 struct coding_system *);
847
847static void 848static void
848IT_write_glyphs (struct frame *f, struct glyph *str, int str_len) 849IT_write_glyphs (struct frame *f, struct glyph *str, int str_len)
849{ 850{
@@ -2998,17 +2999,17 @@ XMenuCreate (Display *foo1, Window foo2, char *foo3)
2998 to do. */ 2999 to do. */
2999 3000
3000int 3001int
3001XMenuAddPane (Display *foo, XMenu *menu, char *txt, int enable) 3002XMenuAddPane (Display *foo, XMenu *menu, const char *txt, int enable)
3002{ 3003{
3003 int len; 3004 int len;
3004 char *p; 3005 const char *p;
3005 3006
3006 if (!enable) 3007 if (!enable)
3007 abort (); 3008 abort ();
3008 3009
3009 IT_menu_make_room (menu); 3010 IT_menu_make_room (menu);
3010 menu->submenu[menu->count] = IT_menu_create (); 3011 menu->submenu[menu->count] = IT_menu_create ();
3011 menu->text[menu->count] = txt; 3012 menu->text[menu->count] = (char *)txt;
3012 menu->panenumber[menu->count] = ++menu->panecount; 3013 menu->panenumber[menu->count] = ++menu->panecount;
3013 menu->help_text[menu->count] = NULL; 3014 menu->help_text[menu->count] = NULL;
3014 menu->count++; 3015 menu->count++;
diff --git a/src/msdos.h b/src/msdos.h
index 4bbe9b134de..5051f2f3837 100644
--- a/src/msdos.h
+++ b/src/msdos.h
@@ -105,7 +105,7 @@ typedef struct x_menu_struct
105} XMenu; 105} XMenu;
106 106
107XMenu *XMenuCreate (Display *, Window, char *); 107XMenu *XMenuCreate (Display *, Window, char *);
108int XMenuAddPane (Display *, XMenu *, char *, int); 108int XMenuAddPane (Display *, XMenu *, const char *, int);
109int XMenuAddSelection (Display *, XMenu *, int, int, char *, int, char *); 109int XMenuAddSelection (Display *, XMenu *, int, int, char *, int, char *);
110void XMenuLocate (Display *, XMenu *, int, int, int, int, 110void XMenuLocate (Display *, XMenu *, int, int, int, int,
111 int *, int *, int *, int *); 111 int *, int *, int *, int *);
diff --git a/src/systime.h b/src/systime.h
index eae302904fa..cb1ea230f7d 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -144,10 +144,8 @@ extern void set_waiting_for_input (EMACS_TIME *);
144 happen when this files is used outside the src directory). 144 happen when this files is used outside the src directory).
145 Use GCPRO1 to determine if lisp.h was included. */ 145 Use GCPRO1 to determine if lisp.h was included. */
146#ifdef GCPRO1 146#ifdef GCPRO1
147/* defined in dired.c */
148extern Lisp_Object make_time (time_t);
149
150/* defined in editfns.c*/ 147/* defined in editfns.c*/
148extern Lisp_Object make_time (time_t);
151extern int lisp_time_argument (Lisp_Object, time_t *, int *); 149extern int lisp_time_argument (Lisp_Object, time_t *, int *);
152#endif 150#endif
153 151
@@ -172,4 +170,3 @@ extern int lisp_time_argument (Lisp_Object, time_t *, int *);
172#define EMACS_TIME_LE(T1, T2) (EMACS_TIME_CMP (T1, T2) <= 0) 170#define EMACS_TIME_LE(T1, T2) (EMACS_TIME_CMP (T1, T2) <= 0)
173 171
174#endif /* EMACS_SYSTIME_H */ 172#endif /* EMACS_SYSTIME_H */
175
diff --git a/src/term.c b/src/term.c
index e78e2e68814..e84bbe125f8 100644
--- a/src/term.c
+++ b/src/term.c
@@ -501,7 +501,7 @@ static int encode_terminal_dst_size;
501 Set CODING->produced to the byte-length of the resulting byte 501 Set CODING->produced to the byte-length of the resulting byte
502 sequence, and return a pointer to that byte sequence. */ 502 sequence, and return a pointer to that byte sequence. */
503 503
504static unsigned char * 504unsigned char *
505encode_terminal_code (struct glyph *src, int src_len, struct coding_system *coding) 505encode_terminal_code (struct glyph *src, int src_len, struct coding_system *coding)
506{ 506{
507 struct glyph *src_end = src + src_len; 507 struct glyph *src_end = src + src_len;
diff --git a/src/termcap.c b/src/termcap.c
index 69ce56d93b3..27a20a67ae1 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -25,6 +25,10 @@ Boston, MA 02110-1301, USA. */
25#include <unistd.h> 25#include <unistd.h>
26 26
27#include "lisp.h" 27#include "lisp.h"
28#include "tparam.h"
29#ifdef MSDOS
30#include "msdos.h"
31#endif
28 32
29#ifndef NULL 33#ifndef NULL
30#define NULL (char *) 0 34#define NULL (char *) 0
@@ -65,7 +69,7 @@ static char *tgetst1 (char *ptr, char **area);
65 0 if not found. */ 69 0 if not found. */
66 70
67static char * 71static char *
68find_capability (register char *bp, register char *cap) 72find_capability (register char *bp, register const char *cap)
69{ 73{
70 for (; *bp; bp++) 74 for (; *bp; bp++)
71 if (bp[0] == ':' 75 if (bp[0] == ':'
@@ -76,7 +80,7 @@ find_capability (register char *bp, register char *cap)
76} 80}
77 81
78int 82int
79tgetnum (char *cap) 83tgetnum (const char *cap)
80{ 84{
81 register char *ptr = find_capability (term_entry, cap); 85 register char *ptr = find_capability (term_entry, cap);
82 if (!ptr || ptr[-1] != '#') 86 if (!ptr || ptr[-1] != '#')
@@ -85,7 +89,7 @@ tgetnum (char *cap)
85} 89}
86 90
87int 91int
88tgetflag (char *cap) 92tgetflag (const char *cap)
89{ 93{
90 register char *ptr = find_capability (term_entry, cap); 94 register char *ptr = find_capability (term_entry, cap);
91 return ptr && ptr[-1] == ':'; 95 return ptr && ptr[-1] == ':';
@@ -97,7 +101,7 @@ tgetflag (char *cap)
97 If AREA is null, space is allocated with `malloc'. */ 101 If AREA is null, space is allocated with `malloc'. */
98 102
99char * 103char *
100tgetstr (char *cap, char **area) 104tgetstr (const char *cap, char **area)
101{ 105{
102 register char *ptr = find_capability (term_entry, cap); 106 register char *ptr = find_capability (term_entry, cap);
103 if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~')) 107 if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~'))
@@ -263,7 +267,7 @@ tgetst1 (char *ptr, char **area)
263char PC; 267char PC;
264 268
265void 269void
266tputs (register char *str, int nlines, register int (*outfun) (/* ??? */)) 270tputs (register const char *str, int nlines, int (*outfun) (int))
267{ 271{
268 register int padcount = 0; 272 register int padcount = 0;
269 register int speed; 273 register int speed;
@@ -355,7 +359,7 @@ valid_filename_p (fn)
355 in it, and some other value otherwise. */ 359 in it, and some other value otherwise. */
356 360
357int 361int
358tgetent (char *bp, char *name) 362tgetent (char *bp, const char *name)
359{ 363{
360 register char *termcap_name; 364 register char *termcap_name;
361 register int fd; 365 register int fd;
@@ -442,7 +446,7 @@ tgetent (char *bp, char *name)
442 buf.size = BUFSIZE; 446 buf.size = BUFSIZE;
443 /* Add 1 to size to ensure room for terminating null. */ 447 /* Add 1 to size to ensure room for terminating null. */
444 buf.beg = (char *) xmalloc (buf.size + 1); 448 buf.beg = (char *) xmalloc (buf.size + 1);
445 term = indirect ? indirect : name; 449 term = indirect ? indirect : (char *)name;
446 450
447 if (!bp) 451 if (!bp)
448 { 452 {
diff --git a/src/termhooks.h b/src/termhooks.h
index b147f6ed0a1..0ccd2dac9e1 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -654,6 +654,9 @@ extern void delete_terminal (struct terminal *);
654/* The initial terminal device, created by initial_term_init. */ 654/* The initial terminal device, created by initial_term_init. */
655extern struct terminal *initial_terminal; 655extern struct terminal *initial_terminal;
656 656
657extern unsigned char *encode_terminal_code (struct glyph *, int,
658 struct coding_system *);
659
657#ifdef HAVE_GPM 660#ifdef HAVE_GPM
658extern void close_gpm (int gpm_fd); 661extern void close_gpm (int gpm_fd);
659#endif 662#endif
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 7a55498085d..2e46c063e95 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -828,6 +828,7 @@ copy_data_segment (struct load_command *lc)
828 } 828 }
829 else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0 829 else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0
830 || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0 830 || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0
831 || strncmp (sectp->sectname, "__got", 16) == 0
831 || strncmp (sectp->sectname, "__la_sym_ptr2", 16) == 0 832 || strncmp (sectp->sectname, "__la_sym_ptr2", 16) == 0
832 || strncmp (sectp->sectname, "__dyld", 16) == 0 833 || strncmp (sectp->sectname, "__dyld", 16) == 0
833 || strncmp (sectp->sectname, "__const", 16) == 0 834 || strncmp (sectp->sectname, "__const", 16) == 0