summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-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
6 files changed, 73 insertions, 88 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4bf474b62db..a06b9ff8443 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -9,6 +9,21 @@
2009-08-29 Stefan Monnier <monnier@iro.umontreal.ca>
+ * 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.
+
* files.el (get-free-disk-space): Use / for default-directory.
* 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 @@
;; Todo:
-;; - Make abbrev-file-name obey user-emacs-directory.
;; - Cleanup name space.
;;; Code:
@@ -39,6 +38,11 @@
:link '(custom-manual "(emacs)Abbrevs")
:group 'abbrev)
+(defcustom abbrev-file-name
+ (locate-user-emacs-file "abbrev_defs" ".abbrev_defs")
+ "Default name of file to read abbrevs from."
+ :type 'file)
+
(defcustom only-global-abbrevs nil
"Non-nil means user plans to use global abbrevs only.
This 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 @@
:tag "Calc"
:group 'applications)
-;;;###autoload
+;; Do not autoload, so it is evaluated at run-time rather than at dump time.
+;; ;;;###autoload
(defcustom calc-settings-file
- (convert-standard-filename "~/.calc.el")
+ (locate-user-emacs-file "calc.el" ".calc.el")
"File in which to record permanent settings."
:group 'calc
: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."
;; see if the list of defcustom's below is up to date, run the command
;; "M-x apropos-value RET ~/\. RET".
(defun dos-reevaluate-defcustoms ()
- ;; This was computed in paths.el, but that was at dump time.
- (setq abbrev-file-name
- (if (msdos-long-file-names)
- "~/.abbrev_defs"
- "~/_abbrev.defs"))
- ;; This was computed in loaddefs.el, but that was at dump time.
- (setq calc-settings-file
- (if (msdos-long-file-names)
- "~/.calc.el"
- "~/_calc.el"))
+ ;; This was computed at dump time.
(custom-reevaluate-setting 'trash-directory))
(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\"))
You may set this variable to nil in your `.emacs' file if you do not wish
the terminal-initialization file to be loaded.")
-(defvar abbrev-file-name
- (convert-standard-filename "~/.abbrev_defs")
- "*Default name of file to read abbrevs from.")
-
;; arch-tag: bae27ffb-9944-4c87-b569-30d4635a99e1
;;; 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).")
(custom-reevaluate-setting 'temporary-file-directory)
(custom-reevaluate-setting 'small-temporary-file-directory)
(custom-reevaluate-setting 'auto-save-file-name-transforms)
+ (custom-reevaluate-setting 'abbrev-file-name)
+ ;; Force recomputation, in case it was computed during the dump.
+ (setq abbreviated-home-dir nil)
;; See if we should import version-control from the environment variable.
(let ((vc (getenv "VERSION_CONTROL")))
@@ -1822,68 +1825,45 @@ To quit a partially entered command, type Control-g.\n")
;; If keys have their default meanings,
;; use precomputed string to save lots of time.
- (let ((c-h-accessible
- ;; If normal-erase-is-backspace is used on a tty, there's
- ;; no way to invoke C-h and you have to use F1 instead.
- (or (not (char-table-p keyboard-translate-table))
- (eq (aref keyboard-translate-table ?\C-h) ?\C-h))))
- (if (and (eq (key-binding "\C-h") 'help-command)
- (eq (key-binding "\C-xu") 'advertised-undo)
- (eq (key-binding "\C-x\C-c") 'save-buffers-kill-terminal)
- (eq (key-binding "\C-ht") 'help-with-tutorial)
- (eq (key-binding "\C-hi") 'info)
- (eq (key-binding "\C-hr") 'info-emacs-manual)
- (eq (key-binding "\C-h\C-n") 'view-emacs-news))
- (let ((help (if c-h-accessible "C-h" "<f1>")))
- (insert "
-Get help\t " help " (Hold down CTRL and press h)
-")
- (insert-button "Emacs manual"
- 'action (lambda (button) (info-emacs-manual))
- 'follow-link t)
- (insert " " help " r\t")
- (insert-button "Browse manuals"
- 'action (lambda (button) (Info-directory))
- 'follow-link t)
- (insert "\t " help " i
-")
- (insert-button "Emacs tutorial"
- 'action (lambda (button) (help-with-tutorial))
- 'follow-link t)
- (insert " " help " t\tUndo changes\t C-x u
-")
- (insert-button "Buy manuals"
- 'action (lambda (button) (view-order-manuals))
- 'follow-link t)
- (insert "\t " help " C-m\tExit Emacs\t C-x C-c"))
-
- (insert (format "
-Get help\t %s
-"
- (let ((where (where-is-internal 'help-command nil t)))
- (if where
- (key-description where)
- "M-x help"))))
- (insert-button "Emacs manual"
- 'action (lambda (button) (info-emacs-manual))
- 'follow-link t)
- (insert (substitute-command-keys"\t \\[info-emacs-manual]\t"))
- (insert-button "Browse manuals"
- 'action (lambda (button) (Info-directory))
- 'follow-link t)
- (insert (substitute-command-keys "\t \\[info]
-"))
- (insert-button "Emacs tutorial"
- 'action (lambda (button) (help-with-tutorial))
- 'follow-link t)
- (insert (substitute-command-keys
- "\t \\[help-with-tutorial]\tUndo changes\t \\[advertised-undo]
-"))
- (insert-button "Buy manuals"
- 'action (lambda (button) (view-order-manuals))
- 'follow-link t)
- (insert (substitute-command-keys
- "\t \\[view-order-manuals]\tExit Emacs\t \\[save-buffers-kill-terminal]"))))
+ (let* ((c-h-accessible
+ ;; If normal-erase-is-backspace is used on a tty, there's
+ ;; no way to invoke C-h and you have to use F1 instead.
+ (or (not (char-table-p keyboard-translate-table))
+ (eq (aref keyboard-translate-table ?\C-h) ?\C-h)))
+ (minor-mode-overriding-map-alist
+ (cons (cons (not c-h-accessible)
+ ;; If C-h can't be invoked, temporarily disable its
+ ;; binding, so where-is uses alternative bindings.
+ (let ((map (make-sparse-keymap)))
+ (define-key map [?\C-h] 'undefined)
+ map))
+ minor-mode-overriding-map-alist)))
+
+ (insert (format "\nGet help\t %s\n"
+ (let ((where (where-is-internal 'help-command nil t)))
+ (cond
+ ((equal where [?\C-h])
+ "C-h (Hold down CTRL and press h)")
+ (where (key-description where))
+ (t "M-x help")))))
+ (insert-button "Emacs manual"
+ 'action (lambda (button) (info-emacs-manual))
+ 'follow-link t)
+ (insert (substitute-command-keys"\t \\[info-emacs-manual]\t"))
+ (insert-button "Browse manuals"
+ 'action (lambda (button) (Info-directory))
+ 'follow-link t)
+ (insert (substitute-command-keys "\t \\[info]\n"))
+ (insert-button "Emacs tutorial"
+ 'action (lambda (button) (help-with-tutorial))
+ 'follow-link t)
+ (insert (substitute-command-keys
+ "\t \\[help-with-tutorial]\tUndo changes\t \\[advertised-undo]\n"))
+ (insert-button "Buy manuals"
+ 'action (lambda (button) (view-order-manuals))
+ 'follow-link t)
+ (insert (substitute-command-keys
+ "\t \\[view-order-manuals]\tExit Emacs\t \\[save-buffers-kill-terminal]")))
;; Say how to use the menu bar with the keyboard.
(insert "\n")
@@ -2035,8 +2015,7 @@ Type \\[describe-distribution] for information on "))
(let ((buffer (get-buffer-create " *temp*")))
(prog1
(condition-case nil
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(insert-file-contents user-init-file)
(re-search-forward
(concat
@@ -2109,11 +2088,10 @@ A fancy display is used on graphic displays, normal otherwise."
;; This includes our standard options' long versions
;; and long versions of what's on command-switch-alist.
(longopts
- (append '(("--funcall") ("--load") ("--insert") ("--kill")
- ("--directory") ("--eval") ("--execute") ("--no-splash")
- ("--find-file") ("--visit") ("--file") ("--no-desktop"))
- (mapcar (lambda (elt)
- (list (concat "-" (car elt))))
+ (append '("--funcall" "--load" "--insert" "--kill"
+ "--directory" "--eval" "--execute" "--no-splash"
+ "--find-file" "--visit" "--file" "--no-desktop")
+ (mapcar (lambda (elt) (concat "-" (car elt)))
command-switch-alist)))
(line 0)
(column 0))
@@ -2121,7 +2099,7 @@ A fancy display is used on graphic displays, normal otherwise."
;; Add the long X options to longopts.
(dolist (tem command-line-x-option-alist)
(if (string-match "^--" (car tem))
- (push (list (car tem)) longopts)))
+ (push (car tem) longopts)))
;; Add the long NS options to longopts.
(dolist (tem command-line-ns-option-alist)
@@ -2149,7 +2127,7 @@ A fancy display is used on graphic displays, normal otherwise."
(if (eq completion t)
(setq argi (substring argi 1))
(if (stringp completion)
- (let ((elt (assoc completion longopts)))
+ (let ((elt (member completion longopts)))
(or elt
(error "Option `%s' is ambiguous" argi))
(setq argi (substring (car elt) 1)))