aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2009-08-29 19:22:38 +0000
committerStefan Monnier2009-08-29 19:22:38 +0000
commit2aa0e5bf920dee0e2bc7b07c11adaa45636c40f2 (patch)
treec60fe2cf701387ed22a675286cfc1cc3f082bbf2
parentdb167d28c634931c7cc72640edb23b141050fd33 (diff)
downloademacs-2aa0e5bf920dee0e2bc7b07c11adaa45636c40f2.tar.gz
emacs-2aa0e5bf920dee0e2bc7b07c11adaa45636c40f2.zip
* paths.el (abbrev-file-name): Move to abbrev.el.
* abbrev.el (abbrev-file-name): Move from paths.el. Obey user-emacs-directory. * calc/calc.el (calc-settings-file): Don't autoload and instead obey user-emacs-directory. * dos-fns.el (dos-reevaluate-defcustoms): Don't reevaluate abbrev-file-name and calc-settings-file any more. * startup.el (command-line): Recompute abbrev-file-name and abbreviated-home-dir. (normal-no-mouse-startup-screen): Improve the generic code and get rid of the special code for when C-h bindings haven't been changed. (display-startup-echo-area-message): Use with-current-buffer. (command-line-1): Use a list of strings, rather than a list of lists of strings for longopts.
-rw-r--r--etc/NEWS2
-rw-r--r--lisp/ChangeLog15
-rw-r--r--lisp/abbrev.el6
-rw-r--r--lisp/calc/calc.el5
-rw-r--r--lisp/dos-fns.el11
-rw-r--r--lisp/paths.el4
-rw-r--r--lisp/startup.el120
7 files changed, 75 insertions, 88 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 042694fae70..ed4397ae08f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -117,6 +117,8 @@ default-file-name-coding-system on Mac OS X.
117 117
118* Changes in Specialized Modes and Packages in Emacs 23.2 118* Changes in Specialized Modes and Packages in Emacs 23.2
119 119
120** .calc.el and .abbrev_defs obey user-emacs-directory.
121
120** Calc graphing commands (`g f' etc.) now work on MS-Windows, 122** Calc graphing commands (`g f' etc.) now work on MS-Windows,
121if you have the native Windows port of Gnuplot version 3.8 or later 123if you have the native Windows port of Gnuplot version 3.8 or later
122installed. 124installed.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4bf474b62db..a06b9ff8443 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -9,6 +9,21 @@
9 9
102009-08-29 Stefan Monnier <monnier@iro.umontreal.ca> 102009-08-29 Stefan Monnier <monnier@iro.umontreal.ca>
11 11
12 * paths.el (abbrev-file-name): Move to abbrev.el.
13 * abbrev.el (abbrev-file-name): Move from paths.el.
14 Obey user-emacs-directory.
15 * calc/calc.el (calc-settings-file): Don't autoload and instead obey
16 user-emacs-directory.
17 * dos-fns.el (dos-reevaluate-defcustoms): Don't reevaluate
18 abbrev-file-name and calc-settings-file any more.
19 * startup.el (command-line): Recompute abbrev-file-name and
20 abbreviated-home-dir.
21 (normal-no-mouse-startup-screen): Improve the generic code and get rid
22 of the special code for when C-h bindings haven't been changed.
23 (display-startup-echo-area-message): Use with-current-buffer.
24 (command-line-1): Use a list of strings, rather than a list of lists
25 of strings for longopts.
26
12 * files.el (get-free-disk-space): Use / for default-directory. 27 * files.el (get-free-disk-space): Use / for default-directory.
13 28
14 * textmodes/ispell.el (ispell-accept-output, ispell-command-loop): 29 * textmodes/ispell.el (ispell-accept-output, ispell-command-loop):
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 4a2c57ddd60..6441381d171 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -27,7 +27,6 @@
27 27
28;; Todo: 28;; Todo:
29 29
30;; - Make abbrev-file-name obey user-emacs-directory.
31;; - Cleanup name space. 30;; - Cleanup name space.
32 31
33;;; Code: 32;;; Code:
@@ -39,6 +38,11 @@
39 :link '(custom-manual "(emacs)Abbrevs") 38 :link '(custom-manual "(emacs)Abbrevs")
40 :group 'abbrev) 39 :group 'abbrev)
41 40
41(defcustom abbrev-file-name
42 (locate-user-emacs-file "abbrev_defs" ".abbrev_defs")
43 "Default name of file to read abbrevs from."
44 :type 'file)
45
42(defcustom only-global-abbrevs nil 46(defcustom only-global-abbrevs nil
43 "Non-nil means user plans to use global abbrevs only. 47 "Non-nil means user plans to use global abbrevs only.
44This makes the commands that normally define mode-specific abbrevs 48This makes the commands that normally define mode-specific abbrevs
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 8e6af0db7e1..790647d62ca 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -227,9 +227,10 @@
227 :tag "Calc" 227 :tag "Calc"
228 :group 'applications) 228 :group 'applications)
229 229
230;;;###autoload 230;; Do not autoload, so it is evaluated at run-time rather than at dump time.
231;; ;;;###autoload
231(defcustom calc-settings-file 232(defcustom calc-settings-file
232 (convert-standard-filename "~/.calc.el") 233 (locate-user-emacs-file "calc.el" ".calc.el")
233 "File in which to record permanent settings." 234 "File in which to record permanent settings."
234 :group 'calc 235 :group 'calc
235 :type '(file)) 236 :type '(file))
diff --git a/lisp/dos-fns.el b/lisp/dos-fns.el
index 37a1a9c1d16..5b3c5df50d8 100644
--- a/lisp/dos-fns.el
+++ b/lisp/dos-fns.el
@@ -224,16 +224,7 @@ returned unaltered."
224;; see if the list of defcustom's below is up to date, run the command 224;; see if the list of defcustom's below is up to date, run the command
225;; "M-x apropos-value RET ~/\. RET". 225;; "M-x apropos-value RET ~/\. RET".
226(defun dos-reevaluate-defcustoms () 226(defun dos-reevaluate-defcustoms ()
227 ;; This was computed in paths.el, but that was at dump time. 227 ;; This was computed at dump time.
228 (setq abbrev-file-name
229 (if (msdos-long-file-names)
230 "~/.abbrev_defs"
231 "~/_abbrev.defs"))
232 ;; This was computed in loaddefs.el, but that was at dump time.
233 (setq calc-settings-file
234 (if (msdos-long-file-names)
235 "~/.calc.el"
236 "~/_calc.el"))
237 (custom-reevaluate-setting 'trash-directory)) 228 (custom-reevaluate-setting 'trash-directory))
238 229
239(add-hook 'before-init-hook 'dos-reevaluate-defcustoms) 230(add-hook 'before-init-hook 'dos-reevaluate-defcustoms)
diff --git a/lisp/paths.el b/lisp/paths.el
index 10881e5dbc9..385df8488e6 100644
--- a/lisp/paths.el
+++ b/lisp/paths.el
@@ -181,9 +181,5 @@ If non-nil, Emacs startup does (load (concat term-file-prefix (getenv \"TERM\"))
181You may set this variable to nil in your `.emacs' file if you do not wish 181You may set this variable to nil in your `.emacs' file if you do not wish
182the terminal-initialization file to be loaded.") 182the terminal-initialization file to be loaded.")
183 183
184(defvar abbrev-file-name
185 (convert-standard-filename "~/.abbrev_defs")
186 "*Default name of file to read abbrevs from.")
187
188;; arch-tag: bae27ffb-9944-4c87-b569-30d4635a99e1 184;; arch-tag: bae27ffb-9944-4c87-b569-30d4635a99e1
189;;; paths.el ends here 185;;; paths.el ends here
diff --git a/lisp/startup.el b/lisp/startup.el
index cc2165bcfb4..1253284be51 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -721,6 +721,9 @@ opening the first frame (e.g. open a connection to an X server).")
721 (custom-reevaluate-setting 'temporary-file-directory) 721 (custom-reevaluate-setting 'temporary-file-directory)
722 (custom-reevaluate-setting 'small-temporary-file-directory) 722 (custom-reevaluate-setting 'small-temporary-file-directory)
723 (custom-reevaluate-setting 'auto-save-file-name-transforms) 723 (custom-reevaluate-setting 'auto-save-file-name-transforms)
724 (custom-reevaluate-setting 'abbrev-file-name)
725 ;; Force recomputation, in case it was computed during the dump.
726 (setq abbreviated-home-dir nil)
724 727
725 ;; See if we should import version-control from the environment variable. 728 ;; See if we should import version-control from the environment variable.
726 (let ((vc (getenv "VERSION_CONTROL"))) 729 (let ((vc (getenv "VERSION_CONTROL")))
@@ -1822,68 +1825,45 @@ To quit a partially entered command, type Control-g.\n")
1822 1825
1823 ;; If keys have their default meanings, 1826 ;; If keys have their default meanings,
1824 ;; use precomputed string to save lots of time. 1827 ;; use precomputed string to save lots of time.
1825 (let ((c-h-accessible 1828 (let* ((c-h-accessible
1826 ;; If normal-erase-is-backspace is used on a tty, there's 1829 ;; If normal-erase-is-backspace is used on a tty, there's
1827 ;; no way to invoke C-h and you have to use F1 instead. 1830 ;; no way to invoke C-h and you have to use F1 instead.
1828 (or (not (char-table-p keyboard-translate-table)) 1831 (or (not (char-table-p keyboard-translate-table))
1829 (eq (aref keyboard-translate-table ?\C-h) ?\C-h)))) 1832 (eq (aref keyboard-translate-table ?\C-h) ?\C-h)))
1830 (if (and (eq (key-binding "\C-h") 'help-command) 1833 (minor-mode-overriding-map-alist
1831 (eq (key-binding "\C-xu") 'advertised-undo) 1834 (cons (cons (not c-h-accessible)
1832 (eq (key-binding "\C-x\C-c") 'save-buffers-kill-terminal) 1835 ;; If C-h can't be invoked, temporarily disable its
1833 (eq (key-binding "\C-ht") 'help-with-tutorial) 1836 ;; binding, so where-is uses alternative bindings.
1834 (eq (key-binding "\C-hi") 'info) 1837 (let ((map (make-sparse-keymap)))
1835 (eq (key-binding "\C-hr") 'info-emacs-manual) 1838 (define-key map [?\C-h] 'undefined)
1836 (eq (key-binding "\C-h\C-n") 'view-emacs-news)) 1839 map))
1837 (let ((help (if c-h-accessible "C-h" "<f1>"))) 1840 minor-mode-overriding-map-alist)))
1838 (insert " 1841
1839Get help\t " help " (Hold down CTRL and press h) 1842 (insert (format "\nGet help\t %s\n"
1840") 1843 (let ((where (where-is-internal 'help-command nil t)))
1841 (insert-button "Emacs manual" 1844 (cond
1842 'action (lambda (button) (info-emacs-manual)) 1845 ((equal where [?\C-h])
1843 'follow-link t) 1846 "C-h (Hold down CTRL and press h)")
1844 (insert " " help " r\t") 1847 (where (key-description where))
1845 (insert-button "Browse manuals" 1848 (t "M-x help")))))
1846 'action (lambda (button) (Info-directory)) 1849 (insert-button "Emacs manual"
1847 'follow-link t) 1850 'action (lambda (button) (info-emacs-manual))
1848 (insert "\t " help " i 1851 'follow-link t)
1849") 1852 (insert (substitute-command-keys"\t \\[info-emacs-manual]\t"))
1850 (insert-button "Emacs tutorial" 1853 (insert-button "Browse manuals"
1851 'action (lambda (button) (help-with-tutorial)) 1854 'action (lambda (button) (Info-directory))
1852 'follow-link t) 1855 'follow-link t)
1853 (insert " " help " t\tUndo changes\t C-x u 1856 (insert (substitute-command-keys "\t \\[info]\n"))
1854") 1857 (insert-button "Emacs tutorial"
1855 (insert-button "Buy manuals" 1858 'action (lambda (button) (help-with-tutorial))
1856 'action (lambda (button) (view-order-manuals)) 1859 'follow-link t)
1857 'follow-link t) 1860 (insert (substitute-command-keys
1858 (insert "\t " help " C-m\tExit Emacs\t C-x C-c")) 1861 "\t \\[help-with-tutorial]\tUndo changes\t \\[advertised-undo]\n"))
1859 1862 (insert-button "Buy manuals"
1860 (insert (format " 1863 'action (lambda (button) (view-order-manuals))
1861Get help\t %s 1864 'follow-link t)
1862" 1865 (insert (substitute-command-keys
1863 (let ((where (where-is-internal 'help-command nil t))) 1866 "\t \\[view-order-manuals]\tExit Emacs\t \\[save-buffers-kill-terminal]")))
1864 (if where
1865 (key-description where)
1866 "M-x help"))))
1867 (insert-button "Emacs manual"
1868 'action (lambda (button) (info-emacs-manual))
1869 'follow-link t)
1870 (insert (substitute-command-keys"\t \\[info-emacs-manual]\t"))
1871 (insert-button "Browse manuals"
1872 'action (lambda (button) (Info-directory))
1873 'follow-link t)
1874 (insert (substitute-command-keys "\t \\[info]
1875"))
1876 (insert-button "Emacs tutorial"
1877 'action (lambda (button) (help-with-tutorial))
1878 'follow-link t)
1879 (insert (substitute-command-keys
1880 "\t \\[help-with-tutorial]\tUndo changes\t \\[advertised-undo]
1881"))
1882 (insert-button "Buy manuals"
1883 'action (lambda (button) (view-order-manuals))
1884 'follow-link t)
1885 (insert (substitute-command-keys
1886 "\t \\[view-order-manuals]\tExit Emacs\t \\[save-buffers-kill-terminal]"))))
1887 1867
1888 ;; Say how to use the menu bar with the keyboard. 1868 ;; Say how to use the menu bar with the keyboard.
1889 (insert "\n") 1869 (insert "\n")
@@ -2035,8 +2015,7 @@ Type \\[describe-distribution] for information on "))
2035 (let ((buffer (get-buffer-create " *temp*"))) 2015 (let ((buffer (get-buffer-create " *temp*")))
2036 (prog1 2016 (prog1
2037 (condition-case nil 2017 (condition-case nil
2038 (save-excursion 2018 (with-current-buffer buffer
2039 (set-buffer buffer)
2040 (insert-file-contents user-init-file) 2019 (insert-file-contents user-init-file)
2041 (re-search-forward 2020 (re-search-forward
2042 (concat 2021 (concat
@@ -2109,11 +2088,10 @@ A fancy display is used on graphic displays, normal otherwise."
2109 ;; This includes our standard options' long versions 2088 ;; This includes our standard options' long versions
2110 ;; and long versions of what's on command-switch-alist. 2089 ;; and long versions of what's on command-switch-alist.
2111 (longopts 2090 (longopts
2112 (append '(("--funcall") ("--load") ("--insert") ("--kill") 2091 (append '("--funcall" "--load" "--insert" "--kill"
2113 ("--directory") ("--eval") ("--execute") ("--no-splash") 2092 "--directory" "--eval" "--execute" "--no-splash"
2114 ("--find-file") ("--visit") ("--file") ("--no-desktop")) 2093 "--find-file" "--visit" "--file" "--no-desktop")
2115 (mapcar (lambda (elt) 2094 (mapcar (lambda (elt) (concat "-" (car elt)))
2116 (list (concat "-" (car elt))))
2117 command-switch-alist))) 2095 command-switch-alist)))
2118 (line 0) 2096 (line 0)
2119 (column 0)) 2097 (column 0))
@@ -2121,7 +2099,7 @@ A fancy display is used on graphic displays, normal otherwise."
2121 ;; Add the long X options to longopts. 2099 ;; Add the long X options to longopts.
2122 (dolist (tem command-line-x-option-alist) 2100 (dolist (tem command-line-x-option-alist)
2123 (if (string-match "^--" (car tem)) 2101 (if (string-match "^--" (car tem))
2124 (push (list (car tem)) longopts))) 2102 (push (car tem) longopts)))
2125 2103
2126 ;; Add the long NS options to longopts. 2104 ;; Add the long NS options to longopts.
2127 (dolist (tem command-line-ns-option-alist) 2105 (dolist (tem command-line-ns-option-alist)
@@ -2149,7 +2127,7 @@ A fancy display is used on graphic displays, normal otherwise."
2149 (if (eq completion t) 2127 (if (eq completion t)
2150 (setq argi (substring argi 1)) 2128 (setq argi (substring argi 1))
2151 (if (stringp completion) 2129 (if (stringp completion)
2152 (let ((elt (assoc completion longopts))) 2130 (let ((elt (member completion longopts)))
2153 (or elt 2131 (or elt
2154 (error "Option `%s' is ambiguous" argi)) 2132 (error "Option `%s' is ambiguous" argi))
2155 (setq argi (substring (car elt) 1))) 2133 (setq argi (substring (car elt) 1)))