aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaroly Lorentey2005-09-11 08:23:50 +0000
committerKaroly Lorentey2005-09-11 08:23:50 +0000
commit26cbc0482aa9ff3ad74430e3f6a56e831a831aff (patch)
tree4db9b173720de80d72f0d9bdc6d625d03c9515b8
parent9148bda213c00500b9cfc0dca9e64be85dd88a12 (diff)
parentf9962371041b25c0772a35b0fcbfd313bcffdb87 (diff)
downloademacs-26cbc0482aa9ff3ad74430e3f6a56e831a831aff.tar.gz
emacs-26cbc0482aa9ff3ad74430e3f6a56e831a831aff.zip
Merged in changes from CVS trunk.
Patches applied: * lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-6 Update from CVS * lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-7 Sync with miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-539. * lorentey@elte.hu--2004/emacs--cvs-trunk--0--version-0 Branch closed. Use miles@gnu.org--gnu-2005/emacs--cvs-trunk--0 instead. * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-475 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-476 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-477 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-478 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-479 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-480 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-481 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-482 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-483 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-484 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-485 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-486 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-487 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-488 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-489 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-490 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-491 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-492 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-493 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-494 Update from CVS: lisp/startup.el (command-line): Fix typo. * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-495 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-496 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-497 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-498 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-499 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-500 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-501 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-502 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-503 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-504 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-505 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-506 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-507 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-508 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-509 Update from CVS: .cvsignore: Add `lock'. * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-510 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-511 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-513 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-514 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-515 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-516 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-517 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-518 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-519 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-520 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-521 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-522 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-523 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-524 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-525 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-526 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-527 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-528 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-529 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-530 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-531 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-532 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-533 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-534 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-535 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-536 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-537 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-538 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-539 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-88 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-89 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-90 Update FSF's address in GPL notices * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-91 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-92 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-93 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-94 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-95 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-96 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-97 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-98 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-99 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-100 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-101 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-102 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-103 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-104 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-105 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-106 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-107 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-108 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-109 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-110 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-111 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-112 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-113 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-114 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-416
-rw-r--r--ChangeLog7
-rw-r--r--admin/FOR-RELEASE4
-rwxr-xr-xconfigure3
-rw-r--r--configure.in2
-rw-r--r--etc/NEWS6
-rw-r--r--lisp/ChangeLog45
-rw-r--r--lisp/menu-bar.el76
-rw-r--r--lisp/progmodes/octave-inf.el6
-rw-r--r--lisp/textmodes/ispell.el5
-rw-r--r--lisp/textmodes/page.el2
-rw-r--r--lisp/vc.el5
-rw-r--r--lisp/woman.el98
-rw-r--r--lispref/ChangeLog4
-rw-r--r--lispref/files.texi2
-rw-r--r--msdos/ChangeLog5
-rw-r--r--msdos/sed3v2.inp2
-rw-r--r--nt/ChangeLog4
-rw-r--r--nt/config.nt1
-rw-r--r--src/ChangeLog32
-rw-r--r--src/buffer.c45
-rw-r--r--src/config.in3
-rw-r--r--src/lisp.h3
-rw-r--r--src/sysdep.c77
-rw-r--r--src/xsmfns.c19
24 files changed, 307 insertions, 149 deletions
diff --git a/ChangeLog b/ChangeLog
index e188220fd57..110a2b0300a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
12005-09-10 Giuseppe Scrivano <gscrivano@gmail.com>
2
3 Remove the MAXPATHLEN limitations:
4
5 * configure.in (AC_CHECK_FUNCS): Check for get_current_dir_name.
6 * configure: Regenerated.
7
12005-09-09 Eli Zaretskii <eliz@fencepost.gnu.org> 82005-09-09 Eli Zaretskii <eliz@fencepost.gnu.org>
2 9
3 * configure.in <lynxsos*>: Support for LynxOS on PPC. 10 * configure.in <lynxsos*>: Support for LynxOS on PPC.
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index f16c8b8de4c..fe1bad8241c 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -27,10 +27,6 @@ face name prefixes should be in it for good results.
27 27
28* NEW FEATURES 28* NEW FEATURES
29 29
30** Make VC-over-Tramp work where possible, or at least fail
31gracefully if something isn't supported over Tramp.
32To be done by Andre Spiegel <spiegel@gnu.org>.
33
34** Update Speedbar. 30** Update Speedbar.
35 31
36* FATAL ERRORS 32* FATAL ERRORS
diff --git a/configure b/configure
index a7a013c9ada..e408d35b14a 100755
--- a/configure
+++ b/configure
@@ -14084,8 +14084,9 @@ done
14084 14084
14085 14085
14086 14086
14087
14087for ac_func in gethostname getdomainname dup2 \ 14088for ac_func in gethostname getdomainname dup2 \
14088rename closedir mkdir rmdir sysinfo getrusage \ 14089rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \
14089random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \ 14090random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \
14090strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \ 14091strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
14091utimes setrlimit setpgid getcwd getwd shutdown getaddrinfo \ 14092utimes setrlimit setpgid getcwd getwd shutdown getaddrinfo \
diff --git a/configure.in b/configure.in
index 586b6ac928c..a2d451c5ce7 100644
--- a/configure.in
+++ b/configure.in
@@ -2422,7 +2422,7 @@ AC_CHECK_FUNCS(touchlock)
2422AC_CHECK_HEADERS(maillock.h) 2422AC_CHECK_HEADERS(maillock.h)
2423 2423
2424AC_CHECK_FUNCS(gethostname getdomainname dup2 \ 2424AC_CHECK_FUNCS(gethostname getdomainname dup2 \
2425rename closedir mkdir rmdir sysinfo getrusage \ 2425rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \
2426random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \ 2426random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \
2427strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \ 2427strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
2428utimes setrlimit setpgid getcwd getwd shutdown getaddrinfo \ 2428utimes setrlimit setpgid getcwd getwd shutdown getaddrinfo \
diff --git a/etc/NEWS b/etc/NEWS
index 1fc9ff7e259..1406ee5bf28 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1766,6 +1766,12 @@ boundaries during scrolling.
1766 1766
1767* Changes in Specialized Modes and Packages in Emacs 22.1: 1767* Changes in Specialized Modes and Packages in Emacs 22.1:
1768 1768
1769** The variable `woman-topic-at-point' was renamed
1770to `woman-use-topic-at-point' and behaves differently: if this
1771variable is non-nil, the `woman' command uses the word at point
1772automatically, without asking for a confirmation. Otherwise, the word
1773at point is suggested as default, but not inserted at the prompt.
1774
1769--- 1775---
1770** Changes to cmuscheme 1776** Changes to cmuscheme
1771 1777
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index fd85c39f3a3..a019c5a9f08 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,48 @@
12005-09-10 Alan Mackenzie <acm@muc.de>
2
3 * page.el (narrow-to-page): Exclude _entire_ multi-line delimiter
4 from the region narrowed to.
5
62005-09-10 Magnus Henoch <mange@freemail.hu>
7
8 * textmodes/ispell.el (ispell-check-version): Signal an error if
9 aspell version is less than 0.60.
10
112005-09-10 Pascal Dupuis <Pascal.Dupuis@esat.kuleuven.be> (tiny change)
12
13 * progmodes/octave-inf.el (inferior-octave-startup): Resync
14 current dir at the end.
15
162005-09-10 Emilio C. Lopes <eclig@gmx.net>
17
18 * woman.el (woman-topic-at-point-default): Renamed to
19 woman-use-topic-at-point-default.
20 (woman-topic-at-point): Renamed to woman-use-topic-at-point.
21 (woman-file-name): Reflect renames above. Automatically use the
22 word at point as topic if woman-use-topic-at-point is non-nil.
23 Otherwise offer it as default but don't insert it in the
24 minibuffer. Also use `test-completion' instead of `assoc' as
25 suggested by Stefan Monnier.
26
272005-09-10 Andre Spiegel <spiegel@gnu.org>
28
29 * vc.el (vc-directory, vc-update-change-log): Throw an error on
30 the attempt to do it over Tramp. This is not yet supported.
31
322005-09-10 Eli Zaretskii <eliz@gnu.org>
33
34 * menu-bar.el (menu-bar-menu-frame-live-and-visible-p)
35 (menu-bar-non-minibuffer-window-p): New functions.
36 ("Split Window", "Save As..."): Use them.
37 ("Postscript Print Buffer (B+W)", "Postscript Print Buffer")
38 ("Print Buffer", "Truncate Long Lines in this Buffer"): Use
39 menu-bar-menu-frame-live-and-visible-p.
40 ("Save Buffer", "Insert File", "Open Directory...")
41 ("Open File...", "Visit New File..."): Use
42 menu-bar-non-minibuffer-window-p.
43 (kill-this-buffer-enabled-p, dired <menu-enable>): Use
44 menu-bar-non-minibuffer-window-p.
45
12005-09-09 Eli Zaretskii <eliz@gnu.org> 462005-09-09 Eli Zaretskii <eliz@gnu.org>
2 47
3 * cus-start.el (all): Don't complain about fringe-related 48 * cus-start.el (all): Don't complain about fringe-related
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index efb16807c56..401513c3583 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -105,12 +105,8 @@ A large number or nil slows down menu responsiveness."
105 105
106(define-key menu-bar-file-menu [split-window] 106(define-key menu-bar-file-menu [split-window]
107 '(menu-item "Split Window" split-window-vertically 107 '(menu-item "Split Window" split-window-vertically
108 :enable (or (not (display-multi-frame-p)) 108 :enable (and (menu-bar-menu-frame-live-and-visible-p)
109 (and (frame-live-p menu-updating-frame) 109 (menu-bar-non-minibuffer-window-p))
110 (frame-visible-p menu-updating-frame )
111 (not (window-minibuffer-p
112 (frame-selected-window
113 menu-updating-frame)))))
114 :help "Split selected window in two windows")) 110 :help "Split selected window in two windows"))
115 111
116(define-key menu-bar-file-menu [separator-window] 112(define-key menu-bar-file-menu [separator-window]
@@ -122,9 +118,7 @@ A large number or nil slows down menu responsiveness."
122 :help "Pretty-print marked region in black and white to PostScript printer")) 118 :help "Pretty-print marked region in black and white to PostScript printer"))
123(define-key menu-bar-file-menu [ps-print-buffer] 119(define-key menu-bar-file-menu [ps-print-buffer]
124 '(menu-item "Postscript Print Buffer (B+W)" ps-print-buffer 120 '(menu-item "Postscript Print Buffer (B+W)" ps-print-buffer
125 :enable (or (not (display-multi-frame-p)) 121 :enable (menu-bar-menu-frame-live-and-visible-p)
126 (and (frame-live-p menu-updating-frame)
127 (frame-visible-p menu-updating-frame)))
128 :help "Pretty-print current buffer in black and white to PostScript printer")) 122 :help "Pretty-print current buffer in black and white to PostScript printer"))
129(define-key menu-bar-file-menu [ps-print-region-faces] 123(define-key menu-bar-file-menu [ps-print-region-faces]
130 '(menu-item "Postscript Print Region" ps-print-region-with-faces 124 '(menu-item "Postscript Print Region" ps-print-region-with-faces
@@ -132,9 +126,7 @@ A large number or nil slows down menu responsiveness."
132 :help "Pretty-print marked region to PostScript printer")) 126 :help "Pretty-print marked region to PostScript printer"))
133(define-key menu-bar-file-menu [ps-print-buffer-faces] 127(define-key menu-bar-file-menu [ps-print-buffer-faces]
134 '(menu-item "Postscript Print Buffer" ps-print-buffer-with-faces 128 '(menu-item "Postscript Print Buffer" ps-print-buffer-with-faces
135 :enable (or (not (display-multi-frame-p)) 129 :enable (menu-bar-menu-frame-live-and-visible-p)
136 (and (frame-live-p menu-updating-frame)
137 (frame-visible-p menu-updating-frame)))
138 :help "Pretty-print current buffer to PostScript printer")) 130 :help "Pretty-print current buffer to PostScript printer"))
139(define-key menu-bar-file-menu [print-region] 131(define-key menu-bar-file-menu [print-region]
140 '(menu-item "Print Region" print-region 132 '(menu-item "Print Region" print-region
@@ -142,9 +134,7 @@ A large number or nil slows down menu responsiveness."
142 :help "Print region between mark and current position")) 134 :help "Print region between mark and current position"))
143(define-key menu-bar-file-menu [print-buffer] 135(define-key menu-bar-file-menu [print-buffer]
144 '(menu-item "Print Buffer" print-buffer 136 '(menu-item "Print Buffer" print-buffer
145 :enable (or (not (display-multi-frame-p)) 137 :enable (menu-bar-menu-frame-live-and-visible-p)
146 (and (frame-live-p menu-updating-frame)
147 (frame-visible-p menu-updating-frame)))
148 :help "Print current buffer with page headings")) 138 :help "Print current buffer with page headings"))
149 139
150(define-key menu-bar-file-menu [separator-print] 140(define-key menu-bar-file-menu [separator-print]
@@ -175,21 +165,14 @@ A large number or nil slows down menu responsiveness."
175 :help "Re-read current buffer from its file")) 165 :help "Re-read current buffer from its file"))
176(define-key menu-bar-file-menu [write-file] 166(define-key menu-bar-file-menu [write-file]
177 '(menu-item "Save As..." write-file 167 '(menu-item "Save As..." write-file
178 :enable (or (not (display-multi-frame-p)) 168 :enable (and (menu-bar-menu-frame-live-and-visible-p)
179 (and (frame-live-p menu-updating-frame) 169 (menu-bar-non-minibuffer-window-p))
180 (frame-visible-p menu-updating-frame )
181 (not (window-minibuffer-p
182 (frame-selected-window
183 menu-updating-frame)))))
184 :help "Write current buffer to another file")) 170 :help "Write current buffer to another file"))
185(define-key menu-bar-file-menu [save-buffer] 171(define-key menu-bar-file-menu [save-buffer]
186 '(menu-item "Save" save-buffer 172 '(menu-item "Save" save-buffer
187 :enable (and (buffer-modified-p) 173 :enable (and (buffer-modified-p)
188 (buffer-file-name) 174 (buffer-file-name)
189 (or (not (display-multi-frame-p)) 175 (menu-bar-non-minibuffer-window-p))
190 (not (window-minibuffer-p
191 (frame-selected-window
192 menu-updating-frame)))))
193 :help "Save current buffer to its file")) 176 :help "Save current buffer to its file"))
194 177
195(define-key menu-bar-file-menu [separator-save] 178(define-key menu-bar-file-menu [separator-save]
@@ -201,28 +184,19 @@ A large number or nil slows down menu responsiveness."
201 :help "Discard (kill) current buffer")) 184 :help "Discard (kill) current buffer"))
202(define-key menu-bar-file-menu [insert-file] 185(define-key menu-bar-file-menu [insert-file]
203 '(menu-item "Insert File..." insert-file 186 '(menu-item "Insert File..." insert-file
204 :enable (or (not (display-multi-frame-p)) 187 :enable (menu-bar-non-minibuffer-window-p)
205 (and (not (window-minibuffer-p
206 (frame-selected-window
207 menu-updating-frame)))))
208 :help "Insert another file into current buffer")) 188 :help "Insert another file into current buffer"))
209(define-key menu-bar-file-menu [dired] 189(define-key menu-bar-file-menu [dired]
210 '(menu-item "Open Directory..." dired 190 '(menu-item "Open Directory..." dired
211 :enable (or (not (display-multi-frame-p)) 191 :enable (menu-bar-non-minibuffer-window-p)
212 (not (window-minibuffer-p
213 (frame-selected-window menu-updating-frame))))
214 :help "Read a directory, operate on its files")) 192 :help "Read a directory, operate on its files"))
215(define-key menu-bar-file-menu [open-file] 193(define-key menu-bar-file-menu [open-file]
216 '(menu-item "Open File..." find-file-existing 194 '(menu-item "Open File..." find-file-existing
217 :enable (or (not (display-multi-frame-p)) 195 :enable (menu-bar-non-minibuffer-window-p)
218 (not (window-minibuffer-p
219 (frame-selected-window menu-updating-frame))))
220 :help "Read an existing file into an Emacs buffer")) 196 :help "Read an existing file into an Emacs buffer"))
221(define-key menu-bar-file-menu [new-file] 197(define-key menu-bar-file-menu [new-file]
222 '(menu-item "Visit New File..." find-file 198 '(menu-item "Visit New File..." find-file
223 :enable (or (not (display-multi-frame-p)) 199 :enable (menu-bar-non-minibuffer-window-p)
224 (not (window-minibuffer-p
225 (frame-selected-window menu-updating-frame))))
226 :help "Read or create a file and edit it")) 200 :help "Read or create a file and edit it"))
227 201
228 202
@@ -1057,9 +1031,7 @@ mail status in mode line"))
1057 toggle-truncate-lines 1031 toggle-truncate-lines
1058 :help "Truncate long lines on the screen" 1032 :help "Truncate long lines on the screen"
1059 :button (:toggle . truncate-lines) 1033 :button (:toggle . truncate-lines)
1060 :enable (or (not (display-multi-frame-p)) 1034 :enable (menu-bar-menu-frame-live-and-visible-p)))
1061 (and (frame-live-p menu-updating-frame)
1062 (frame-visible-p menu-updating-frame)))))
1063 1035
1064(define-key menu-bar-options-menu [highlight-separator] 1036(define-key menu-bar-options-menu [highlight-separator]
1065 '("--")) 1037 '("--"))
@@ -1440,6 +1412,23 @@ key, a click, or a menu-item"))
1440 '(menu-item "Emacs Tutorial" help-with-tutorial 1412 '(menu-item "Emacs Tutorial" help-with-tutorial
1441 :help "Learn how to use Emacs")) 1413 :help "Learn how to use Emacs"))
1442 1414
1415(defun menu-bar-menu-frame-live-and-visible-p ()
1416 "Return non-nil if the menu frame is alive and visible.
1417The menu frame is the frame for which we are updating the menu."
1418 (let ((menu-frame (if (display-multi-frame-p) menu-updating-frame
1419 (selected-frame))))
1420 (and (frame-live-p menu-frame)
1421 (frame-visible-p menu-frame))))
1422
1423(defun menu-bar-non-minibuffer-window-p ()
1424 "Return non-nil if selected window of the menu frame is not a minibuf window.
1425
1426See the documentation of `menu-bar-menu-frame-live-and-visible-p'
1427for the definition of the menu frame."
1428 (let ((menu-frame (if (display-multi-frame-p) menu-updating-frame
1429 (selected-frame))))
1430 (not (window-minibuffer-p (frame-selected-window menu-frame)))))
1431
1443(defun kill-this-buffer () ; for the menubar 1432(defun kill-this-buffer () ; for the menubar
1444 "Kill the current buffer." 1433 "Kill the current buffer."
1445 (interactive) 1434 (interactive)
@@ -1452,11 +1441,10 @@ key, a click, or a menu-item"))
1452 (or (string-match "^ " (buffer-name (car buffers))) 1441 (or (string-match "^ " (buffer-name (car buffers)))
1453 (setq count (1+ count))) 1442 (setq count (1+ count)))
1454 (setq buffers (cdr buffers))) 1443 (setq buffers (cdr buffers)))
1455 (and (not (window-minibuffer-p (frame-selected-window menu-updating-frame))) 1444 (and (menu-bar-non-minibuffer-window-p)
1456 (> count 1)))) 1445 (> count 1))))
1457 1446
1458(put 'dired 'menu-enable 1447(put 'dired 'menu-enable '(menu-bar-non-minibuffer-window-p))
1459 '(not (window-minibuffer-p (frame-selected-window menu-updating-frame))))
1460 1448
1461;; Permit deleting frame if it would leave a visible or iconified frame. 1449;; Permit deleting frame if it would leave a visible or iconified frame.
1462(defun delete-frame-enabled-p () 1450(defun delete-frame-enabled-p ()
diff --git a/lisp/progmodes/octave-inf.el b/lisp/progmodes/octave-inf.el
index 917016cf159..4f0875bbf99 100644
--- a/lisp/progmodes/octave-inf.el
+++ b/lisp/progmodes/octave-inf.el
@@ -248,7 +248,11 @@ startup file, `~/.emacs-octave'."
248 248
249 ;; And finally, everything is back to normal. 249 ;; And finally, everything is back to normal.
250 (set-process-filter proc 'inferior-octave-output-filter) 250 (set-process-filter proc 'inferior-octave-output-filter)
251 (run-hooks 'inferior-octave-startup-hook))) 251 (run-hooks 'inferior-octave-startup-hook)
252 (run-hooks 'inferior-octave-startup-hook)
253 ;; Just in case, to be sure a cd in the startup file
254 ;; won't have detrimental effects.
255 (inferior-octave-resync-dirs)))
252 256
253 257
254(defun inferior-octave-complete () 258(defun inferior-octave-complete ()
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 8bd8ed2d692..acd27d69c46 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -814,7 +814,10 @@ Otherwise returns the library directory name, if that is defined."
814 (goto-char (point-min)) 814 (goto-char (point-min))
815 (let (case-fold-search) 815 (let (case-fold-search)
816 (setq ispell-really-aspell 816 (setq ispell-really-aspell
817 (and (search-forward "(but really Aspell " nil t) t)))) 817 (and (search-forward-regexp "(but really Aspell \\(.*\\))" nil t)
818 (if (version< (match-string 1) "0.60")
819 (error "aspell version 0.60 or greater is required")
820 t)))))
818 (kill-buffer (current-buffer))) 821 (kill-buffer (current-buffer)))
819 result)) 822 result))
820 823
diff --git a/lisp/textmodes/page.el b/lisp/textmodes/page.el
index ffb4c89f2db..3ec1eca1fb7 100644
--- a/lisp/textmodes/page.el
+++ b/lisp/textmodes/page.el
@@ -112,7 +112,7 @@ thus showing a page other than the one point was originally in."
112 (save-excursion 112 (save-excursion
113 (goto-char (match-beginning 0)) ; was (beginning-of-line) 113 (goto-char (match-beginning 0)) ; was (beginning-of-line)
114 (looking-at page-delimiter))) 114 (looking-at page-delimiter)))
115 (beginning-of-line)) 115 (goto-char (match-beginning 0))) ; was (beginning-of-line)
116 (narrow-to-region (point) 116 (narrow-to-region (point)
117 (progn 117 (progn
118 ;; Find the top of the page. 118 ;; Find the top of the page.
diff --git a/lisp/vc.el b/lisp/vc.el
index a0b6ffa0ad8..8e87cb50eb4 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -2259,6 +2259,8 @@ With prefix arg READ-SWITCHES, specify a value to override
2259 (interactive "DDired under VC (directory): \nP") 2259 (interactive "DDired under VC (directory): \nP")
2260 (let ((vc-dired-switches (concat vc-dired-listing-switches 2260 (let ((vc-dired-switches (concat vc-dired-listing-switches
2261 (if vc-dired-recurse "R" "")))) 2261 (if vc-dired-recurse "R" ""))))
2262 (if (eq (string-match tramp-file-name-regexp dir) 0)
2263 (error "Sorry, vc-directory does not work over Tramp"))
2262 (if read-switches 2264 (if read-switches
2263 (setq vc-dired-switches 2265 (setq vc-dired-switches
2264 (read-string "Dired listing switches: " 2266 (read-string "Dired listing switches: "
@@ -2809,6 +2811,9 @@ log entries should be gathered."
2809 ;; it should find all relevant files relative to 2811 ;; it should find all relevant files relative to
2810 ;; the default-directory. 2812 ;; the default-directory.
2811 nil))) 2813 nil)))
2814 (dolist (file (or args (list default-directory)))
2815 (if (eq (string-match tramp-file-name-regexp file) 0)
2816 (error "Sorry, vc-update-change-log does not work over Tramp")))
2812 (vc-call-backend (vc-responsible-backend default-directory) 2817 (vc-call-backend (vc-responsible-backend default-directory)
2813 'update-changelog args)) 2818 'update-changelog args))
2814 2819
diff --git a/lisp/woman.el b/lisp/woman.el
index e5753d746f7..9b7bce889b3 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -136,27 +136,23 @@
136;; man man_page_name 136;; man man_page_name
137 137
138 138
139;; Using the `word at point' as a topic suggestion 139;; Using the word at point as the default topic
140;; =============================================== 140;; ============================================
141 141
142;; By default, the `woman' command uses the word nearest to point in 142;; The `woman' command uses the word nearest to point in the current
143;; the current buffer as a suggestion for the topic to look up. The 143;; buffer as the default topic to look up if it matches the name of a
144;; topic must be confirmed or edited in the minibuffer. This 144;; manual page installed on the system. The default topic can also be
145;; suggestion can be turned off, or `woman' can use the suggested 145;; used without confirmation by setting the user-option
146;; topic without confirmation* if possible, by setting the user-option 146;; `woman-use-topic-at-point' to t; thanks to Benjamin Riefenstahl for
147;; `woman-topic-at-point' to nil or t respectively. (Its default 147;; suggesting this functionality.
148;; value is neither nil nor t, meaning ask for confirmation.)
149 148
150;; [* Thanks to Benjamin Riefenstahl for suggesting this 149;; The variable `woman-use-topic-at-point' can be rebound locally,
151;; functionality.] 150;; which may be useful to provide special private key bindings, e.g.
152
153;; The variable `woman-topic-at-point' can be rebound locally, which
154;; may be useful to provide special private key bindings, e.g.
155 151
156;; (global-set-key "\C-cw" 152;; (global-set-key "\C-cw"
157;; (lambda () 153;; (lambda ()
158;; (interactive) 154;; (interactive)
159;; (let ((woman-topic-at-point t)) 155;; (let ((woman-use-topic-at-point t))
160;; (woman))))) 156;; (woman)))))
161 157
162 158
@@ -711,26 +707,21 @@ Default is \"CONTENTS\"."
711 :type 'string 707 :type 'string
712 :group 'woman-interface) 708 :group 'woman-interface)
713 709
714(defcustom woman-topic-at-point-default 'confirm 710(defcustom woman-use-topic-at-point-default nil
715 ;; `woman-topic-at-point' may be let-bound when woman is loaded, in 711 ;; `woman-use-topic-at-point' may be let-bound when woman is loaded,
716 ;; which case its global value does not get defined. 712 ;; in which case its global value does not get defined.
717 ;; `woman-file-name' sets it to this value if it is unbound. 713 ;; `woman-file-name' sets it to this value if it is unbound.
718 "*Default value for `woman-topic-at-point'." 714 "*Default value for `woman-use-topic-at-point'."
719 :type '(choice (const :tag "Yes" t) 715 :type '(choice (const :tag "Yes" t)
720 (const :tag "No" nil) 716 (const :tag "No" nil))
721 (other :tag "Confirm" confirm))
722 :group 'woman-interface) 717 :group 'woman-interface)
723 718
724(defcustom woman-topic-at-point woman-topic-at-point-default 719(defcustom woman-use-topic-at-point woman-use-topic-at-point-default
725 "*Controls use by `woman' of `word at point' as a topic suggestion. 720 "*Control use of the word at point as the default topic.
726If non-nil then the `woman' command uses the word at point as an 721If non-nil the `woman' command uses the word at point automatically,
727initial topic suggestion when it reads a topic from the minibuffer; if 722without interactive confirmation, if it exists as a topic."
728t then the `woman' command uses the word at point WITHOUT
729INTERACTIVE CONFIRMATION if it exists as a topic. The default value
730is `confirm', meaning suggest a topic and ask for confirmation."
731 :type '(choice (const :tag "Yes" t) 723 :type '(choice (const :tag "Yes" t)
732 (const :tag "No" nil) 724 (const :tag "No" nil))
733 (other :tag "Confirm" confirm))
734 :group 'woman-interface) 725 :group 'woman-interface)
735 726
736(defvar woman-file-regexp nil 727(defvar woman-file-regexp nil
@@ -1198,10 +1189,11 @@ It is saved to the file named by the variable `woman-cache-filename'."
1198 1189
1199(defun woman-file-name (topic &optional re-cache) 1190(defun woman-file-name (topic &optional re-cache)
1200 "Get the name of the UN*X man-page file describing a chosen TOPIC. 1191 "Get the name of the UN*X man-page file describing a chosen TOPIC.
1201When `woman' is called interactively, the word at point may be used as 1192When `woman' is called interactively, the word at point may be
1202the topic or initial topic suggestion, subject to the value of the 1193automatically used as the topic, if the value of the user option
1203user option `woman-topic-at-point'. Return nil if no file can be found. 1194`woman-use-topic-at-point' is non-nil. Return nil if no file can
1204Optional argument RE-CACHE, if non-nil, forces the cache to be re-read." 1195be found. Optional argument RE-CACHE, if non-nil, forces the
1196cache to be re-read."
1205 ;; Handle the caching of the directory and topic lists: 1197 ;; Handle the caching of the directory and topic lists:
1206 (if (and (not re-cache) 1198 (if (and (not re-cache)
1207 (or 1199 (or
@@ -1222,25 +1214,27 @@ Optional argument RE-CACHE, if non-nil, forces the cache to be re-read."
1222 (let (files 1214 (let (files
1223 (default (current-word))) 1215 (default (current-word)))
1224 (or (stringp topic) 1216 (or (stringp topic)
1225 (and (eq t 1217 (and (if (boundp 'woman-use-topic-at-point)
1226 (if (boundp 'woman-topic-at-point) 1218 woman-use-topic-at-point
1227 woman-topic-at-point 1219 ;; Was let-bound when file loaded, so ...
1228 ;; Was let-bound when file loaded, so ... 1220 (setq woman-use-topic-at-point woman-use-topic-at-point-default))
1229 (setq woman-topic-at-point woman-topic-at-point-default))) 1221 (setq topic (or (current-word t) "")) ; only within or adjacent to word
1230 (setq topic 1222 (test-completion topic woman-topic-all-completions))
1231 (or (current-word t) "")) ; only within or adjacent to word
1232 (assoc topic woman-topic-all-completions))
1233 (setq topic 1223 (setq topic
1234 (completing-read 1224 (let* ((word-at-point (current-word))
1235 (if default 1225 (default
1236 (format "Manual entry (default `%s'): " default) 1226 (when (and word-at-point
1237 "Manual entry: ") 1227 (test-completion
1238 woman-topic-all-completions nil 1 1228 word-at-point woman-topic-all-completions))
1239 nil 1229 word-at-point)))
1240 'woman-topic-history 1230 (completing-read
1241 ;; Default topic. 1231 (if default
1242 (and woman-topic-at-point 1232 (format "Manual entry [default: %s]: " default)
1243 default)))) 1233 "Manual entry: ")
1234 woman-topic-all-completions nil 1
1235 nil
1236 'woman-topic-history
1237 default))))
1244 ;; Note that completing-read always returns a string. 1238 ;; Note that completing-read always returns a string.
1245 (if (= (length topic) 0) 1239 (if (= (length topic) 0)
1246 nil ; no topic, so no file! 1240 nil ; no topic, so no file!
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 7e603eb63aa..41e6c1aa9eb 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,7 @@
12005-09-10 Chong Yidong <cyd@stupidchicken.com>
2
3 * files.texi (Saving Buffers): Fix typo.
4
12005-09-08 Richard M. Stallman <rms@gnu.org> 52005-09-08 Richard M. Stallman <rms@gnu.org>
2 6
3 * tips.texi (Programming Tips): Correct the "default" prompt spec. 7 * tips.texi (Programming Tips): Correct the "default" prompt spec.
diff --git a/lispref/files.texi b/lispref/files.texi
index 570b601f743..5b8d77d2070 100644
--- a/lispref/files.texi
+++ b/lispref/files.texi
@@ -343,7 +343,7 @@ If it is @code{t}, that means also offer to save certain other non-file
343buffers---those that have a non-@code{nil} buffer-local value of 343buffers---those that have a non-@code{nil} buffer-local value of
344@code{buffer-offer-save} (@pxref{Killing Buffers}). A user who says 344@code{buffer-offer-save} (@pxref{Killing Buffers}). A user who says
345@samp{yes} to saving a non-file buffer is asked to specify the file 345@samp{yes} to saving a non-file buffer is asked to specify the file
346name to use.) The @code{save-buffers-kill-emacs} function passes the 346name to use. The @code{save-buffers-kill-emacs} function passes the
347value @code{t} for @var{pred}. 347value @code{t} for @var{pred}.
348 348
349If @var{pred} is neither @code{t} nor @code{nil}, then it should be 349If @var{pred} is neither @code{t} nor @code{nil}, then it should be
diff --git a/msdos/ChangeLog b/msdos/ChangeLog
index ee8dc3fe9d5..7846f90c508 100644
--- a/msdos/ChangeLog
+++ b/msdos/ChangeLog
@@ -1,3 +1,8 @@
12005-09-10 Sven Joachim <svenjoac@gmx.de> (tiny change)
2
3 * sed3v2.inp (GETOPT_H, GETOPTOBJS): Define to use getopt.h,
4 getopt.o and getopt1.o.
5
12005-07-04 Lute Kamstra <lute@gnu.org> 62005-07-04 Lute Kamstra <lute@gnu.org>
2 7
3 Update FSF's address in GPL notices. 8 Update FSF's address in GPL notices.
diff --git a/msdos/sed3v2.inp b/msdos/sed3v2.inp
index 46d9f2fc894..fb6b67cc422 100644
--- a/msdos/sed3v2.inp
+++ b/msdos/sed3v2.inp
@@ -31,6 +31,8 @@
31/^LOADLIBES *=/s!=.*$!=! 31/^LOADLIBES *=/s!=.*$!=!
32/^ALLOCA *=/s!@ALLOCA@!! 32/^ALLOCA *=/s!@ALLOCA@!!
33/^EXEEXT *=/s!@EXEEXT@!! 33/^EXEEXT *=/s!@EXEEXT@!!
34/^GETOPT_H *=/s!@GETOPT_H@!getopt.h!
35/^GETOPTOBJS *=/s!@GETOPTOBJS@!getopt.o getopt1.o!
34/^INSTALLABLES/s/emacsclient *// 36/^INSTALLABLES/s/emacsclient *//
35s!^ \./! ! 37s!^ \./! !
36/^UTILITIES=/s/ wakeup// 38/^UTILITIES=/s/ wakeup//
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 854410b4f58..7436cd7b47e 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,7 @@
12005-09-10 Eli Zaretskii <eliz@gnu.org>
2
3 * config.nt (HAVE_GET_CURRENT_DIR_NAME): Undefine.
4
12005-08-10 Juanma Barranquero <lekktu@gmail.com> 52005-08-10 Juanma Barranquero <lekktu@gmail.com>
2 6
3 * .cvsignore: Add `obj' and `oo' for in-place installations. 7 * .cvsignore: Add `obj' and `oo' for in-place installations.
diff --git a/nt/config.nt b/nt/config.nt
index 4b8c38823af..0f66a441c7b 100644
--- a/nt/config.nt
+++ b/nt/config.nt
@@ -233,6 +233,7 @@ Boston, MA 02110-1301, USA. */
233#undef HAVE_MKTIME 233#undef HAVE_MKTIME
234#undef HAVE_EUIDACCESS 234#undef HAVE_EUIDACCESS
235#undef HAVE_GETPAGESIZE 235#undef HAVE_GETPAGESIZE
236#undef HAVE_GET_CURRENT_DIR_NAME
236#undef HAVE_TZSET 237#undef HAVE_TZSET
237#undef HAVE_SETLOCALE 238#undef HAVE_SETLOCALE
238#undef HAVE_UTIMES 239#undef HAVE_UTIMES
diff --git a/src/ChangeLog b/src/ChangeLog
index deb2b4ce3eb..e3fb1e07ab8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,35 @@
12005-09-10 Romain Francoise <romain@orebokech.com>
2
3 * buffer.c (init_buffer): Grow buffer to add directory separator
4 and terminal zero. Fix typos.
5
62005-09-10 Eli Zaretskii <eliz@gnu.org>
7
8 * buffer.c (init_buffer): Fix error message for failed call to
9 get_current_dir_name.
10 (get_current_dir_name): Remove prototype.
11
12 * xsmfns.c: (get_current_dir_name): Remove prototype.
13
14 * lisp.h: (get_current_dir_name) [!HAVE_GET_CURRENT_DIR_NAME]: Add
15 prototype.
16
17 * sysdep.c [WINDOWSNT]: Add prototype for getwd.
18 Don't #undef NULL after including blockinput.h.
19
20 * config.in: Regenerated.
21
222005-09-10 Giuseppe Scrivano <gscrivano@gmail.com>
23
24 Remove the MAXPATHLEN limitations:
25
26 * sysdep.c (get_current_dir_name) [!HAVE_GET_CURRENT_DIR_NAME]:
27 New function.
28
29 * buffer.c (init_buffer): Use it.
30
31 * xsmfns.c (smc_save_yourself_CB): Ditto.
32
12005-09-09 Kim F. Storm <storm@cua.dk> 332005-09-09 Kim F. Storm <storm@cua.dk>
2 34
3 * doc.c (Fsubstitute_command_keys): Lookup key binding for 35 * doc.c (Fsubstitute_command_keys): Lookup key binding for
diff --git a/src/buffer.c b/src/buffer.c
index 30626f11a24..fb1ff1c22e9 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -32,10 +32,6 @@ Boston, MA 02110-1301, USA. */
32extern int errno; 32extern int errno;
33#endif 33#endif
34 34
35#ifndef MAXPATHLEN
36/* in 4.1 [probably SunOS? -stef] , param.h fails to define this. */
37#define MAXPATHLEN 1024
38#endif /* not MAXPATHLEN */
39 35
40#ifdef HAVE_UNISTD_H 36#ifdef HAVE_UNISTD_H
41#include <unistd.h> 37#include <unistd.h>
@@ -5115,7 +5111,6 @@ init_buffer_once ()
5115void 5111void
5116init_buffer () 5112init_buffer ()
5117{ 5113{
5118 char buf[MAXPATHLEN + 1];
5119 char *pwd; 5114 char *pwd;
5120 struct stat dotstat, pwdstat; 5115 struct stat dotstat, pwdstat;
5121 Lisp_Object temp; 5116 Lisp_Object temp;
@@ -5138,40 +5133,28 @@ init_buffer ()
5138 if (NILP (buffer_defaults.enable_multibyte_characters)) 5133 if (NILP (buffer_defaults.enable_multibyte_characters))
5139 Fset_buffer_multibyte (Qnil); 5134 Fset_buffer_multibyte (Qnil);
5140 5135
5141 /* If PWD is accurate, use it instead of calling getwd. PWD is 5136 pwd = get_current_dir_name ();
5142 sometimes a nicer name, and using it may avoid a fatal error if a 5137
5143 parent directory is searchable but not readable. */ 5138 if (!pwd)
5144 if ((pwd = getenv ("PWD")) != 0 5139 fatal ("`get_current_dir_name' failed: %s\n", strerror (errno));
5145 && (IS_DIRECTORY_SEP (*pwd) || (*pwd && IS_DEVICE_SEP (pwd[1])))
5146 && stat (pwd, &pwdstat) == 0
5147 && stat (".", &dotstat) == 0
5148 && dotstat.st_ino == pwdstat.st_ino
5149 && dotstat.st_dev == pwdstat.st_dev
5150 && strlen (pwd) < MAXPATHLEN)
5151 strcpy (buf, pwd);
5152#ifdef HAVE_GETCWD
5153 else if (getcwd (buf, MAXPATHLEN+1) == 0)
5154 fatal ("`getcwd' failed: %s\n", strerror (errno));
5155#else
5156 else if (getwd (buf) == 0)
5157 fatal ("`getwd' failed: %s\n", buf);
5158#endif
5159 5140
5160#ifndef VMS 5141#ifndef VMS
5161 /* Maybe this should really use some standard subroutine 5142 /* Maybe this should really use some standard subroutine
5162 whose definition is filename syntax dependent. */ 5143 whose definition is filename syntax dependent. */
5163 rc = strlen (buf); 5144 rc = strlen (pwd);
5164 if (!(IS_DIRECTORY_SEP (buf[rc - 1]))) 5145 if (!(IS_DIRECTORY_SEP (pwd[rc - 1])))
5165 { 5146 {
5166 buf[rc] = DIRECTORY_SEP; 5147 /* Grow buffer to add directory separator and '\0'. */
5167 buf[rc + 1] = '\0'; 5148 pwd = (char *) xrealloc (pwd, rc + 2);
5149 pwd[rc] = DIRECTORY_SEP;
5150 pwd[rc + 1] = '\0';
5168 } 5151 }
5169#endif /* not VMS */ 5152#endif /* not VMS */
5170 5153
5171 current_buffer->directory = make_unibyte_string (buf, strlen (buf)); 5154 current_buffer->directory = make_unibyte_string (pwd, strlen (pwd));
5172 if (! NILP (buffer_defaults.enable_multibyte_characters)) 5155 if (! NILP (buffer_defaults.enable_multibyte_characters))
5173 /* At this momemnt, we still don't know how to decode the 5156 /* At this moment, we still don't know how to decode the
5174 direcotry name. So, we keep the bytes in multibyte form so 5157 directory name. So, we keep the bytes in multibyte form so
5175 that ENCODE_FILE correctly gets the original bytes. */ 5158 that ENCODE_FILE correctly gets the original bytes. */
5176 current_buffer->directory 5159 current_buffer->directory
5177 = string_to_multibyte (current_buffer->directory); 5160 = string_to_multibyte (current_buffer->directory);
@@ -5190,6 +5173,8 @@ init_buffer ()
5190 5173
5191 temp = get_minibuffer (0); 5174 temp = get_minibuffer (0);
5192 XBUFFER (temp)->directory = current_buffer->directory; 5175 XBUFFER (temp)->directory = current_buffer->directory;
5176
5177 free (pwd);
5193} 5178}
5194 5179
5195/* initialize the buffer routines */ 5180/* initialize the buffer routines */
diff --git a/src/config.in b/src/config.in
index dc2c07667fb..69c7543bfab 100644
--- a/src/config.in
+++ b/src/config.in
@@ -221,6 +221,9 @@ Boston, MA 02110-1301, USA. */
221/* Define to 1 if you have the `getwd' function. */ 221/* Define to 1 if you have the `getwd' function. */
222#undef HAVE_GETWD 222#undef HAVE_GETWD
223 223
224/* Define to 1 if you have the `get_current_dir_name' function. */
225#undef HAVE_GET_CURRENT_DIR_NAME
226
224/* Define to 1 if you have the ungif library (-lungif). */ 227/* Define to 1 if you have the ungif library (-lungif). */
225#undef HAVE_GIF 228#undef HAVE_GIF
226 229
diff --git a/src/lisp.h b/src/lisp.h
index 8f37c715c29..cba8bd31801 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3110,6 +3110,9 @@ struct tty_display_info;
3110struct device; 3110struct device;
3111 3111
3112/* defined in sysdep.c */ 3112/* defined in sysdep.c */
3113#ifndef HAVE_GET_CURRENT_DIR_NAME
3114extern char *get_current_dir_name P_ ((void));
3115#endif
3113extern void stuff_char P_ ((char c)); 3116extern void stuff_char P_ ((char c));
3114extern void init_sigio P_ ((int)); 3117extern void init_sigio P_ ((int));
3115extern void sys_subshell P_ ((void)); 3118extern void sys_subshell P_ ((void));
diff --git a/src/sysdep.c b/src/sysdep.c
index 9ffb167bdf0..114300b6784 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -49,7 +49,6 @@ extern void srandom P_ ((unsigned int));
49#include "sysselect.h" 49#include "sysselect.h"
50 50
51#include "blockinput.h" 51#include "blockinput.h"
52#undef NULL
53 52
54#ifdef MAC_OS8 53#ifdef MAC_OS8
55/* It is essential to include stdlib.h so that this file picks up 54/* It is essential to include stdlib.h so that this file picks up
@@ -190,6 +189,7 @@ extern int quit_char;
190#define _P_WAIT 0 189#define _P_WAIT 0
191int _CRTAPI1 _spawnlp (int, const char *, const char *, ...); 190int _CRTAPI1 _spawnlp (int, const char *, const char *, ...);
192int _CRTAPI1 _getpid (void); 191int _CRTAPI1 _getpid (void);
192extern char *getwd (char *);
193#endif 193#endif
194 194
195#ifdef NONSYSTEM_DIR_LIBRARY 195#ifdef NONSYSTEM_DIR_LIBRARY
@@ -256,6 +256,81 @@ void hft_reset P_ ((struct tty_display_info *));
256 256
257SIGMASKTYPE sigprocmask_set; 257SIGMASKTYPE sigprocmask_set;
258 258
259
260#ifndef HAVE_GET_CURRENT_DIR_NAME
261
262/* Return the current working directory. Returns NULL on errors.
263 Any other returned value must be freed with free. This is used
264 only when get_current_dir_name is not defined on the system. */
265char*
266get_current_dir_name ()
267{
268 char *buf;
269 char *pwd;
270 struct stat dotstat, pwdstat;
271 /* If PWD is accurate, use it instead of calling getwd. PWD is
272 sometimes a nicer name, and using it may avoid a fatal error if a
273 parent directory is searchable but not readable. */
274 if ((pwd = getenv ("PWD")) != 0
275 && (IS_DIRECTORY_SEP (*pwd) || (*pwd && IS_DEVICE_SEP (pwd[1])))
276 && stat (pwd, &pwdstat) == 0
277 && stat (".", &dotstat) == 0
278 && dotstat.st_ino == pwdstat.st_ino
279 && dotstat.st_dev == pwdstat.st_dev
280#ifdef MAXPATHLEN
281 && strlen (pwd) < MAXPATHLEN
282#endif
283 )
284 {
285 buf = (char *) malloc (strlen (pwd) + 1);
286 if (!buf)
287 return NULL;
288 strcpy (buf, pwd);
289 }
290#ifdef HAVE_GETCWD
291 else
292 {
293 size_t buf_size = 1024;
294 buf = (char *) malloc (buf_size);
295 if (!buf)
296 return NULL;
297 for (;;)
298 {
299 if (getcwd (buf, buf_size) == buf)
300 break;
301 if (errno != ERANGE)
302 {
303 int tmp_errno = errno;
304 free (buf);
305 errno = tmp_errno;
306 return NULL;
307 }
308 buf_size *= 2;
309 buf = (char *) realloc (buf, buf_size);
310 if (!buf)
311 return NULL;
312 }
313 }
314#else
315 else
316 {
317 /* We need MAXPATHLEN here. */
318 buf = (char *) malloc (MAXPATHLEN + 1);
319 if (!buf)
320 return NULL;
321 if (getwd (buf) == NULL)
322 {
323 int tmp_errno = errno;
324 free (buf);
325 errno = tmp_errno;
326 return NULL;
327 }
328 }
329#endif
330 return buf;
331}
332#endif
333
259 334
260/* Discard pending input on all input descriptors. */ 335/* Discard pending input on all input descriptors. */
261 336
diff --git a/src/xsmfns.c b/src/xsmfns.c
index fc427a29790..dc5ebdf1ebd 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -53,11 +53,6 @@ Boston, MA 02110-1301, USA. */
53#include "termopts.h" 53#include "termopts.h"
54#include "xterm.h" 54#include "xterm.h"
55 55
56#ifndef MAXPATHLEN
57#define MAXPATHLEN 1024
58#endif /* not MAXPATHLEN */
59
60
61/* The user login name. */ 56/* The user login name. */
62 57
63extern Lisp_Object Vuser_login_name; 58extern Lisp_Object Vuser_login_name;
@@ -206,7 +201,7 @@ smc_save_yourself_CB (smcConn,
206 int val_idx = 0; 201 int val_idx = 0;
207 int props_idx = 0; 202 int props_idx = 0;
208 203
209 char cwd[MAXPATHLEN+1]; 204 char *cwd = NULL;
210 char *smid_opt; 205 char *smid_opt;
211 206
212 /* How to start a new instance of Emacs. */ 207 /* How to start a new instance of Emacs. */
@@ -260,12 +255,9 @@ smc_save_yourself_CB (smcConn,
260 props[props_idx]->vals[0].value = SDATA (Vuser_login_name); 255 props[props_idx]->vals[0].value = SDATA (Vuser_login_name);
261 ++props_idx; 256 ++props_idx;
262 257
263 /* The current directory property, not mandatory. */ 258 cwd = get_current_dir_name ();
264#ifdef HAVE_GETCWD 259
265 if (getcwd (cwd, MAXPATHLEN+1) != 0) 260 if (cwd)
266#else
267 if (getwd (cwd) != 0)
268#endif
269 { 261 {
270 props[props_idx] = &prop_ptr[props_idx]; 262 props[props_idx] = &prop_ptr[props_idx];
271 props[props_idx]->name = SmCurrentDirectory; 263 props[props_idx]->name = SmCurrentDirectory;
@@ -282,6 +274,9 @@ smc_save_yourself_CB (smcConn,
282 274
283 xfree (smid_opt); 275 xfree (smid_opt);
284 276
277 if (cwd)
278 free (cwd);
279
285 /* See if we maybe shall interact with the user. */ 280 /* See if we maybe shall interact with the user. */
286 if (interactStyle != SmInteractStyleAny 281 if (interactStyle != SmInteractStyleAny
287 || ! shutdown 282 || ! shutdown