diff options
author | Miles Bader <miles@gnu.org> | 2007-11-09 09:45:30 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2007-11-09 09:45:30 +0000 |
commit | c12ecb0af9679cc0e2fa0409931c34c035763469 (patch) | |
tree | bd118c7ebc571de0dab542f48ad0c1648c6ccf72 /lisp | |
parent | e83d1fe87564d06d2fcbb4006dfd9133bc340aa8 (diff) | |
parent | 9d2185d10e3da9062672d96d3b59fcea31ff17ed (diff) | |
download | emacs-c12ecb0af9679cc0e2fa0409931c34c035763469.tar.gz |
Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-923
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 75 | ||||
-rw-r--r-- | lisp/dired-aux.el | 11 | ||||
-rw-r--r-- | lisp/ediff-hook.el | 22 | ||||
-rw-r--r-- | lisp/emacs-lisp/elp.el | 20 | ||||
-rw-r--r-- | lisp/emacs-lisp/unsafep.el | 19 | ||||
-rw-r--r-- | lisp/follow.el | 4 | ||||
-rw-r--r-- | lisp/gnus/ChangeLog | 8 | ||||
-rw-r--r-- | lisp/gnus/gnus-sum.el | 1 | ||||
-rw-r--r-- | lisp/gnus/qp.el | 2 | ||||
-rw-r--r-- | lisp/loadhist.el | 2 | ||||
-rw-r--r-- | lisp/msb.el | 19 | ||||
-rw-r--r-- | lisp/net/tls.el | 3 | ||||
-rw-r--r-- | lisp/progmodes/gdb-ui.el | 10 | ||||
-rw-r--r-- | lisp/progmodes/gud.el | 19 | ||||
-rw-r--r-- | lisp/savehist.el | 3 | ||||
-rw-r--r-- | lisp/server.el | 4 | ||||
-rw-r--r-- | lisp/ses.el | 15 | ||||
-rw-r--r-- | lisp/shadowfile.el | 29 | ||||
-rw-r--r-- | lisp/strokes.el | 4 | ||||
-rw-r--r-- | lisp/uniquify.el | 51 | ||||
-rw-r--r-- | lisp/whitespace.el | 16 |
21 files changed, 239 insertions, 98 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bac3ee7a691..707a2ec45a4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,78 @@ +2007-11-09 Nick Roberts <nickrob@snap.net.nz> + + * progmodes/gud.el (gud-gdb): Remove vestigial gdba doc and code. + +2007-11-09 Sven Joachim <svenjoac@gmx.de> + + * dired-aux.el (dired-copy-file-recursive): + Preserve directory permissions. + +2007-11-09 Juanma Barranquero <lekktu@gmail.com> + + * whitespace.el (whitespace-write-file-hook): Remove interactive spec. + (whitespace-unload-function): New-style unload function. When run, + unintern `whitespace-unload-hook' and call `unload-feature' recursively + to stop the old hook from messing with the unloading. + +2007-11-09 Juanma Barranquero <lekktu@gmail.com> + + * emacs-lisp/elp.el (elp-report-limit, elp-restore-all) + (elp-unset-master, elp-results): Fix typos. + (elp-sort-by-function, elp-use-standard-output, elp-recycle-buffers-p): + Doc fixes. + + * msb.el (msb--many-menus): Remove variable. + (msb-max-menu-items, msb--add-to-menu): Doc fixes. + (msb-menu-cond, msb-item-handling-function, msb--create-function-info) + (msb--toggle-menu-type): Fix typos in docstrings. + + * shadowfile.el (shadow-inhibit-overload, shadow-remove-from-todo) + (shadow-insert-var): Doc fixes. + (shadow-file-match, shadow-define-cluster, shadow-define-regexp-group): + Reflow docstrings. + (shadow-parse-fullname, shadow-read-files): Fix typos in docstrings. + +2007-11-09 Juanma Barranquero <lekktu@gmail.com> + + * ediff-hook.el (ediff, ediff-files, ediff-buffers, ebuffers, ediff3) + (ediff-files3, ediff-buffers3, ebuffers3, erevision, ediff-revision): + Fix typos in autoload docstrings. + +2007-11-09 Richard Stallman <rms@gnu.org> + + * savehist.el (savehist-save): Obey savehist-ignored-variables. + +2007-11-09 Nick Roberts <nickrob@snap.net.nz> + + * progmodes/gdb-ui.el (gdb-delete-out-of-scope): New option. + (gdb-var-update-handler-1): Use it. + +2007-11-09 Juanma Barranquero <lekktu@gmail.com> + + * loadhist.el (unload-feature): Remove erroneous check for the + FEATURE-unload-function variable; check the existence of the + function (that's what the docstring says, and it makes more sense). + + * follow.el (follow-unload-function): Add docstring. + (follow-unload-function): Remove variable. + + * server.el (server-unload-function): Remove variable. + (server-unload-function): Unbind `server-edit' from `C-x #'. + + * uniquify.el (uniquify-unload-function): Add docstring. + (uniquify-unload-function): Remove variable. + + * ses.el (ses-unload-function): New function. + +2007-11-09 Juanma Barranquero <lekktu@gmail.com> + + * emacs-lisp/unsafep.el (unsafep, unsafep-function) + (unsafep-progn, unsafep-let): Fix typos in docstrings. + + * uniquify.el (uniquify-maybe-rerationalize-w/o-cb): Define it + before use to avoid a warning in packages that require uniquify. + (uniquify-unload-function): New function and var. + 2007-11-09 Dan Nicolaescu <dann@ics.uci.edu> * ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove. diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index e0749f375ae..b9ceb728dbc 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1160,7 +1160,8 @@ Special value `always' suppresses confirmation." (or (eq recursive 'always) (yes-or-no-p (format "Recursive copies of %s? " from)))) ;; This is a directory. - (let ((files + (let ((mode (file-modes from)) + (files (condition-case err (directory-files from nil dired-re-no-dot) (file-error @@ -1174,7 +1175,9 @@ Special value `always' suppresses confirmation." (if (file-exists-p to) (or top (dired-handle-overwrite to)) (condition-case err - (make-directory to) + (progn + (make-directory to) + (set-file-modes to #o700)) (file-error (push (dired-make-relative from) dired-create-files-failures) @@ -1193,7 +1196,9 @@ Special value `always' suppresses confirmation." (file-error (push (dired-make-relative thisfrom) dired-create-files-failures) - (dired-log "Copying error for %s:\n%s\n" thisfrom err)))))) + (dired-log "Copying error for %s:\n%s\n" thisfrom err))))) + (when (file-directory-p to) + (set-file-modes to mode))) ;; Not a directory. (or top (dired-handle-overwrite to)) (condition-case err diff --git a/lisp/ediff-hook.el b/lisp/ediff-hook.el index 00e6ba6bab2..306b2ed670c 100644 --- a/lisp/ediff-hook.el +++ b/lisp/ediff-hook.el @@ -261,17 +261,17 @@ () ; if dumping, autoloads are set up in loaddefs.el ;; if the user decides to load this file, set up autoloads ;; compare files and buffers - (autoload 'ediff "ediff" "Compare two files" t) - (autoload 'ediff-files "ediff" "Compare two files" t) - (autoload 'ediff-buffers "ediff" "Compare two bufers" t) - (autoload 'ebuffers "ediff" "Compare two bufers" t) - (autoload 'ediff3 "ediff" "Compare three files" t) - (autoload 'ediff-files3 "ediff" "Compare three files" t) - (autoload 'ediff-buffers3 "ediff" "Compare three bufers" t) - (autoload 'ebuffers3 "ediff" "Compare three bufers" t) - - (autoload 'erevision "ediff" "Compare versions of a file" t) - (autoload 'ediff-revision "ediff" "Compare versions of a file" t) + (autoload 'ediff "ediff" "Compare two files." t) + (autoload 'ediff-files "ediff" "Compare two files." t) + (autoload 'ediff-buffers "ediff" "Compare two buffers." t) + (autoload 'ebuffers "ediff" "Compare two buffers." t) + (autoload 'ediff3 "ediff" "Compare three files." t) + (autoload 'ediff-files3 "ediff" "Compare three files." t) + (autoload 'ediff-buffers3 "ediff" "Compare three buffers." t) + (autoload 'ebuffers3 "ediff" "Compare three buffers." t) + + (autoload 'erevision "ediff" "Compare versions of a file." t) + (autoload 'ediff-revision "ediff" "Compare versions of a file." t) ;; compare regions and windows (autoload 'ediff-windows-wordwise diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el index 71231a86df9..c4ba3e4ca9c 100644 --- a/lisp/emacs-lisp/elp.el +++ b/lisp/emacs-lisp/elp.el @@ -147,16 +147,16 @@ Results are displayed with the `elp-results' command." :group 'elp) (defcustom elp-sort-by-function 'elp-sort-by-total-time - "*Non-nil specifies elp results sorting function. + "*Non-nil specifies ELP results sorting function. These functions are currently available: elp-sort-by-call-count -- sort by the highest call count elp-sort-by-total-time -- sort by the highest total time elp-sort-by-average-time -- sort by the highest average times -You can write you're own sort function. It should adhere to the -interface specified by the PRED argument for the `sort' defun. Each -\"element of LIST\" is really a 4 element vector where element 0 is +You can write your own sort function. It should adhere to the +interface specified by the PREDICATE argument for `sort'. +Each \"element of LIST\" is really a 4 element vector where element 0 is the call count, element 1 is the total time spent in the function, element 2 is the average time spent in the function, and element 3 is the symbol's name string." @@ -164,7 +164,7 @@ the symbol's name string." :group 'elp) (defcustom elp-report-limit 1 - "*Prevents some functions from being displayed in the results buffer. + "*Prevent some functions from being displayed in the results buffer. If a number, no function that has been called fewer than that number of times will be displayed in the output buffer. If nil, all functions will be displayed." @@ -173,12 +173,12 @@ functions will be displayed." :group 'elp) (defcustom elp-use-standard-output nil - "*Non-nil says to output to `standard-output' instead of a buffer." + "*If non-nil, output to `standard-output' instead of a buffer." :type 'boolean :group 'elp) (defcustom elp-recycle-buffers-p t - "*nil says to not recycle the `elp-results-buffer'. + "*If nil, don't recycle the `elp-results-buffer'. In other words, a new unique buffer is create every time you run \\[elp-results]." :type 'boolean @@ -372,7 +372,7 @@ Use optional LIST if provided instead." (mapcar 'elp-restore-function list))) (defun elp-restore-all () - "Restores the original definitions of all functions being profiled." + "Restore the original definitions of all functions being profiled." (interactive) (elp-restore-list elp-all-instrumented-list)) @@ -412,7 +412,7 @@ Use optional LIST if provided instead." (elp-instrument-function funsym))) (defun elp-unset-master () - "Unsets the master function." + "Unset the master function." (interactive) ;; when there's no master function, recording is turned on by default. (setq elp-master nil @@ -558,7 +558,7 @@ original definition, use \\[elp-restore-function] or \\[elp-restore-all]." (defun elp-results () "Display current profiling results. If `elp-reset-after-results' is non-nil, then current profiling -information for all instrumented functions are reset after results are +information for all instrumented functions is reset after results are displayed." (interactive) (let ((curbuf (current-buffer)) diff --git a/lisp/emacs-lisp/unsafep.el b/lisp/emacs-lisp/unsafep.el index d7dd1f19300..3bb93334c3c 100644 --- a/lisp/emacs-lisp/unsafep.el +++ b/lisp/emacs-lisp/unsafep.el @@ -116,9 +116,9 @@ in the parse.") ;;;###autoload (defun unsafep (form &optional unsafep-vars) - "Return nil if evaluating FORM couldn't possibly do any harm; -otherwise result is a reason why FORM is unsafe. UNSAFEP-VARS is a list -of symbols with local bindings." + "Return nil if evaluating FORM couldn't possibly do any harm. +Otherwise result is a reason why FORM is unsafe. +UNSAFEP-VARS is a list of symbols with local bindings." (catch 'unsafep (if (or (eq safe-functions t) ;User turned off safety-checking (atom form)) ;Atoms are never unsafe @@ -213,8 +213,8 @@ of symbols with local bindings." (defun unsafep-function (fun) "Return nil if FUN is a safe function. -\(either a safe lambda or a symbol that names a safe function). Otherwise -result is a reason code." +\(Either a safe lambda or a symbol that names a safe function). +Otherwise result is a reason code." (cond ((eq (car-safe fun) 'lambda) (unsafep fun unsafep-vars)) @@ -226,8 +226,8 @@ result is a reason code." `(function ,fun)))) (defun unsafep-progn (list) - "Return nil if all forms in LIST are safe, or the reason -for the first unsafe form." + "Return nil if all forms in LIST are safe. +Else, return the reason for the first unsafe form." (catch 'unsafep-progn (let (reason) (dolist (x list) @@ -236,8 +236,9 @@ for the first unsafe form." (defun unsafep-let (clause) "Check the safety of a let binding. -CLAUSE is a let-binding, either SYM or (SYM) or (SYM VAL). Checks VAL -and throws a reason to `unsafep' if unsafe. Returns SYM." +CLAUSE is a let-binding, either SYM or (SYM) or (SYM VAL). +Check VAL and throw a reason to `unsafep' if unsafe. +Return SYM." (let (reason sym) (if (atom clause) (setq sym clause) diff --git a/lisp/follow.el b/lisp/follow.el index 50760cd9909..3edc62e5784 100644 --- a/lisp/follow.el +++ b/lisp/follow.el @@ -2163,6 +2163,7 @@ This prevents `mouse-drag-region' from messing things up." ;;{{{ The end (defun follow-unload-function () + "Unload Follow mode library." (easy-menu-remove-item nil '("Tools") "Follow") (follow-stop-intercept-process-output) (dolist (group '((before @@ -2189,10 +2190,9 @@ This prevents `mouse-drag-region' from messing things up." (intern (concat "follow-" (symbol-name fun)))) (ad-update fun)) (error nil)))))) + ;; continue standard processing nil) -(defvar follow-unload-function 'follow-unload-function) - ;; ;; We're done! ;; diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 77e1650f88d..bc07acae287 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,7 @@ +2007-11-03 Reiner Steib <Reiner.Steib@gmx.de> + + * gnus-sum.el (gnus-summary-highlight): Mark as risky local variable. + 2007-11-01 Reiner Steib <Reiner.Steib@gmx.de> * mm-util.el (mm-charset-eval-alist): Mark as risky local variable. @@ -21,6 +25,10 @@ (gnus-article-prev-page): Honor gnus-article-over-scroll when moving back to the previous page. +2007-10-30 Reiner Steib <Reiner.Steib@gmx.de> + + * qp.el (quoted-printable-decode-string): Fix typo in doc string. + 2007-10-30 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-ems.el (gnus-x-splash): Work even if there's no scroll bar. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 5709de62b19..bc5ed9f0fb5 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -1080,6 +1080,7 @@ uncached: Non-nil if the article is uncached." :group 'gnus-summary-visual :type '(repeat (cons (sexp :tag "Form" nil) face))) +(put 'gnus-summary-highlight 'risky-local-variable t) (defcustom gnus-alter-header-function nil "Function called to allow alteration of article header structures. diff --git a/lisp/gnus/qp.el b/lisp/gnus/qp.el index d601222160d..5689a70f3ac 100644 --- a/lisp/gnus/qp.el +++ b/lisp/gnus/qp.el @@ -82,7 +82,7 @@ them into characters should be done separately." (defun quoted-printable-decode-string (string &optional coding-system) "Decode the quoted-printable encoded STRING and return the result. -If CODING-SYSTEM is non-nil, decode the region with coding-system. +If CODING-SYSTEM is non-nil, decode the string with coding-system. Use of CODING-SYSTEM is deprecated; this function should deal with raw bytes, and coding conversion should be done separately." (mm-with-unibyte-buffer diff --git a/lisp/loadhist.el b/lisp/loadhist.el index 82bab11a7ce..0c1766143d6 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el @@ -191,7 +191,7 @@ something strange, such as redefining an Emacs function." (unload-func (intern-soft (concat name "-unload-function")))) ;; If FEATURE-unload-function is defined and returns non-nil, ;; don't try to do anything more; otherwise proceed normally. - (unless (and (bound-and-true-p unload-func) + (unless (and (fboundp unload-func) (funcall unload-func)) ;; Try to avoid losing badly when hooks installed in critical ;; places go away. (Some packages install things on diff --git a/lisp/msb.el b/lisp/msb.el index b67e471c229..cc5a0adcded 100644 --- a/lisp/msb.el +++ b/lisp/msb.el @@ -190,9 +190,6 @@ 3099 "Other files (%d)"))) -;; msb--many-menus is obsolete -(defvar msb--many-menus msb--very-many-menus) - ;;; ;;; Customizable variables ;;; @@ -235,12 +232,12 @@ A value of nil means don't display this menu. MENU-TITLE is really a format. If you add %d in it, the %d is replaced with the number of items in that menu. -ITEM-HANDLING-FN, is optional. If it is supplied and is a function, -than it is used for displaying the items in that particular buffer +ITEM-HANDLING-FN is optional. If it is supplied and is a function, +then it is used for displaying the items in that particular buffer menu, otherwise the function pointed out by `msb-item-handling-function' is used. -ITEM-SORT-FN, is also optional. +ITEM-SORT-FN is also optional. If it is not supplied, the function pointed out by `msb-item-sort-function' is used. If it is nil, then no sort takes place and the buffers are presented @@ -282,7 +279,7 @@ that differs by this value or more." (defcustom msb-max-menu-items 15 "*The maximum number of items in a menu. If this variable is set to 15 for instance, then the submenu will be -split up in minor parts, 15 items each. nil means no limit." +split up in minor parts, 15 items each. A value of nil means no limit." :type '(choice integer (const nil)) :set 'msb-custom-set :group 'msb) @@ -336,7 +333,7 @@ names that starts with a space character." "*The appearance of a buffer menu. The default function to call for handling the appearance of a menu -item. It should take to arguments, BUFFER and MAX-BUFFER-NAME-LENGTH, +item. It should take two arguments, BUFFER and MAX-BUFFER-NAME-LENGTH, where the latter is the max length of all buffer names. The function should return the string to use in the menu. @@ -664,7 +661,7 @@ If the argument is left out or nil, then the current buffer is considered." (defun msb--create-function-info (menu-cond-elt) "Create a vector from an element MENU-COND-ELT of `msb-menu-cond'. This takes the form: -\]BUFFER-LIST-VARIABLE CONDITION MENU-SORT-KEY MENU-TITLE ITEM-HANDLER SORTER) +\[BUFFER-LIST-VARIABLE CONDITION MENU-SORT-KEY MENU-TITLE ITEM-HANDLER SORTER] See `msb-menu-cond' for a description of its elements." (let* ((list-symbol (make-symbol "-msb-buffer-list")) (tmp-ih (and (> (length menu-cond-elt) 3) @@ -727,7 +724,7 @@ See `msb-menu-cond' for a description of its elements." (defun msb--add-to-menu (buffer function-info max-buffer-name-length) "Add BUFFER to the menu depicted by FUNCTION-INFO. All side-effects. Adds an element of form (BUFFER-TITLE . BUFFER) -to the buffer-list variable in function-info." +to the buffer-list variable in FUNCTION-INFO." (let ((list-symbol (aref function-info 0))) ;BUFFER-LIST-VARIABLE ;; Here comes the hairy side-effect! (set list-symbol @@ -961,7 +958,7 @@ It takes the form ((TITLE . BUFFER-LIST)...)." (msb--create-buffer-menu-2)))) (defun msb--toggle-menu-type () - "Multi purpose function for selecting a buffer with the mouse." + "Multi-purpose function for selecting a buffer with the mouse." (interactive) (setq msb-files-by-directory (not msb-files-by-directory)) ;; This gets a warning, but it is correct, diff --git a/lisp/net/tls.el b/lisp/net/tls.el index 0643aca5d80..c2d9a826157 100644 --- a/lisp/net/tls.el +++ b/lisp/net/tls.el @@ -51,6 +51,9 @@ (autoload 'format-spec "format-spec") (autoload 'format-spec-make "format-spec")) +(eval-when-compile + (require 'rx)) + (defgroup tls nil "Transport Layer Security (TLS) parameters." :group 'comm) diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index c6ae98c5b12..0d1a4b05d65 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -947,6 +947,12 @@ Changed values are highlighted with the face `font-lock-warning-face'." :group 'gud :version "22.1") +(defcustom gdb-delete-out-of-scope t + "If non-nil delete watch expressions automatically when they go out of scope." + :type 'boolean + :group 'gud + :version "22.2") + (defun gdb-speedbar-expand-node (text token indent) "Expand the node the user clicked on. TEXT is the text of the button we clicked on, a + or - item. @@ -3515,7 +3521,9 @@ in_scope=\"\\(.*?\\)\".*?}") (when var (let ((match (match-string 3))) (cond ((string-equal match "false") - (setcar (nthcdr 5 var) 'out-of-scope)) + (if gdb-delete-out-of-scope + (gdb-var-delete-1 varnum) + (setcar (nthcdr 5 var) 'out-of-scope))) ((string-equal match "true") (setcar (nthcdr 5 var) 'changed) (setcar (nthcdr 4 var) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 50dcd6a83bf..ce231f4c662 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -709,25 +709,14 @@ The option \"--fullname\" must be included in this value." (defvar gud-filter-pending-text nil "Non-nil means this is text that has been saved for later in `gud-filter'.") -;; The old gdb command. The new one is in gdb-ui.el. +;; The old gdb command (text command mode). The new one is in gdb-ui.el. ;;;###autoload (defun gud-gdb (command-line) "Run gdb on program FILE in buffer *gud-FILE*. The directory containing FILE becomes the initial working -directory and source-file directory for your debugger. By -default this command starts GDB using a graphical interface. See -`gdba' for more information. - -To run GDB in text command mode, replace the GDB \"--annotate=3\" -option with \"--fullname\" either in the minibuffer for the -current Emacs session, or the custom variable -`gud-gdb-command-name' for all future sessions. You need to use -text command mode to debug multiple programs within one Emacs -session." +directory and source-file directory for your debugger." (interactive (list (gud-query-cmdline 'gud-gdb))) - (require 'gdb-ui) - (when (and gud-comint-buffer (buffer-name gud-comint-buffer) (get-buffer-process gud-comint-buffer) @@ -736,8 +725,8 @@ session." (error "Multiple debugging requires restarting in text command mode")) - (gud-common-init command-line nil 'gud-gdba-marker-filter) - (set (make-local-variable 'gud-minor-mode) 'gdba) + (gud-common-init command-line nil 'gud-gdb-marker-filter) + (set (make-local-variable 'gud-minor-mode) 'gdb) (gud-def gud-break "break %f:%l" "\C-b" "Set breakpoint at current line.") (gud-def gud-tbreak "tbreak %f:%l" "\C-t" diff --git a/lisp/savehist.el b/lisp/savehist.el index 7cc56842d4b..705be69088d 100644 --- a/lisp/savehist.el +++ b/lisp/savehist.el @@ -308,7 +308,8 @@ If AUTO-SAVE is non-nil, compare the saved contents to the one last saved, (current-buffer)) (insert ?\n) (dolist (symbol savehist-minibuffer-history-variables) - (when (boundp symbol) + (when (and (boundp symbol) + (not (memq symbol savehist-ignored-variables))) (let ((value (savehist-trim-history (symbol-value symbol))) excess-space) (when value ; Don't save empty histories. diff --git a/lisp/server.el b/lisp/server.el index bbebe784636..c263a21a6cf 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -1287,6 +1287,7 @@ only these files will be asked to be saved." (defun server-unload-function () "Unload the server library." (server-mode -1) + (substitute-key-definition 'server-edit nil ctl-x-map) (save-current-buffer (dolist (buffer (buffer-list)) (set-buffer buffer) @@ -1294,7 +1295,10 @@ only these files will be asked to be saved." ;; continue standard unloading nil) +(add-hook 'kill-emacs-hook (lambda () (server-mode -1))) ;Cleanup upon exit. + (defvar server-unload-function 'server-unload-function) + (provide 'server) diff --git a/lisp/ses.el b/lisp/ses.el index 62067471b60..f76befa874d 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -2921,7 +2921,7 @@ TEST is evaluated." ;;---------------------------------------------------------------------------- ;;These functions use the variables 'row' and 'col' that are -;;dynamically bound by ses-print-cell. We define these varables at +;;dynamically bound by ses-print-cell. We define these variables at ;;compile-time to make the compiler happy. (eval-when-compile (dolist (x '(row col)) @@ -2980,6 +2980,19 @@ current column and continues until the next nonblank column." (dolist (x (cons 'ses-unsafe ses-standard-printer-functions)) (put x 'side-effect-free t)) +(defun ses-unload-function () + "Unload the Simple Emacs Spreadsheet." + (dolist (fun '(copy-region-as-kill yank)) + (ad-remove-advice fun 'around (intern (concat "ses-" (symbol-name fun)))) + (ad-update fun)) + (save-current-buffer + (dolist (buf (buffer-list)) + (set-buffer buf) + (when (eq major-mode 'ses-mode) + (funcall (or default-major-mode 'fundamental-mode))))) + ;; continue standard unloading + nil) + (provide 'ses) ;; arch-tag: 88c1ccf0-4293-4824-8c5d-0757b52217f3 diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index ca06ace2214..be30ccc8c6a 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el @@ -103,8 +103,8 @@ is no buffer currently visiting the file." (defcustom shadow-inhibit-overload nil "If non-nil, shadowfile won't redefine \\[save-buffers-kill-emacs]. -Normally it overloads the function `save-buffers-kill-emacs' to check -for files have been changed and need to be copied to other systems." +Normally it overloads the function `save-buffers-kill-emacs' to check for +files that have been changed and need to be copied to other systems." :type 'boolean :group 'shadow) @@ -299,7 +299,7 @@ be matched against the primary of SITE2." (defun shadow-parse-fullname (fullname) "Parse FULLNAME into \(site user path) list. -Leave it alone if it already is one. Returns nil if the argument is +Leave it alone if it already is one. Return nil if the argument is not a full ange-ftp pathname." (if (listp fullname) fullname @@ -392,9 +392,9 @@ local filename." "Return t if PATTERN matches FILE. If REGEXP is supplied and non-nil, the file part of the pattern is a regular expression, otherwise it must match exactly. The sites and usernames must -match---see `shadow-same-site'. The pattern must be in full ange-ftp format, but -the file can be any valid filename. This function does not do any filename -expansion or contraction, you must do that yourself first." +match---see `shadow-same-site'. The pattern must be in full ange-ftp format, +but the file can be any valid filename. This function does not do any +filename expansion or contraction, you must do that yourself first." (let* ((pattern-sup (shadow-parse-fullname pattern)) (file-sup (shadow-parse-name file))) (and (shadow-same-site pattern-sup file-sup) @@ -412,8 +412,8 @@ expansion or contraction, you must do that yourself first." This is a group of hosts that share directories, so that copying to or from one of them is sufficient to update the file on all of them. Clusters are defined by a name, the network address of a primary host \(the one we copy -files to), and a regular expression that matches the hostnames of all the sites -in the cluster." +files to), and a regular expression that matches the hostnames of all the +sites in the cluster." (interactive (list (completing-read "Cluster name: " shadow-clusters () ()))) (let* ((old (shadow-get-cluster name)) (primary (read-string "Primary host: " @@ -469,8 +469,8 @@ specific hostnames, or names of clusters \(see `shadow-define-cluster')." "Make each of a group of files be shared between hosts. Prompts for regular expression; files matching this are shared between a list of sites, which are also prompted for. The filenames must be identical on all -hosts \(if they aren't, use `shadow-define-literal-group' instead of this function). -Each site can be either a hostname or the name of a cluster \(see +hosts \(if they aren't, use `shadow-define-literal-group' instead of this +function). Each site can be either a hostname or the name of a cluster \(see `shadow-define-cluster')." (interactive) (let ((regexp (read-string @@ -639,7 +639,7 @@ Consider them as regular expressions if third arg REGEXP is true." (defun shadow-remove-from-todo (pair) "Remove PAIR from `shadow-files-to-copy'. -PAIR must be (eq to) one of the elements of that list." +PAIR must be `eq' to one of the elements of that list." (setq shadow-files-to-copy (shadow-remove-if (function (lambda (s) (eq s pair))) shadow-files-to-copy))) @@ -647,7 +647,7 @@ PAIR must be (eq to) one of the elements of that list." (defun shadow-read-files () "Visit and load `shadow-info-file' and `shadow-todo-file'. Thus restores shadowfile's state from your last Emacs session. -Returns t unless files were locked; then returns nil." +Return t unless files were locked; then return nil." (interactive) (if (and (fboundp 'file-locked-p) (or (stringp (file-locked-p shadow-info-file)) @@ -723,8 +723,9 @@ With non-nil argument also saves the buffer." (setq shadow-hashtable (make-vector 37 0))) (defun shadow-insert-var (variable) - "Prettily insert a `setq' command for VARIABLE, -which, when later evaluated, will restore it to its current setting. + "Build a `setq' to restore VARIABLE. +Prettily insert a `setq' command which, when later evaluated, +will restore VARIABLE to its current setting. VARIABLE must be the name of a variable whose value is a list." (let ((standard-output (current-buffer))) (insert (format "(setq %s" variable)) diff --git a/lisp/strokes.el b/lisp/strokes.el index 73e5594664a..d4fcdb66f61 100644 --- a/lisp/strokes.el +++ b/lisp/strokes.el @@ -1371,7 +1371,9 @@ If STROKES-MAP is not given, `strokes-global-map' will be used instead." (defun strokes-alphabetic-lessp (stroke1 stroke2) "Return t if STROKE1's command name precedes STROKE2's in lexicographic order." - (string-lessp (cdr stroke1) (cdr stroke2))) + (let ((command-name-1 (symbol-name (cdr stroke1))) + (command-name-2 (symbol-name (cdr stroke2)))) + (string-lessp command-name-1 command-name-2))) (defvar strokes-mode-map (let ((map (make-sparse-keymap))) diff --git a/lisp/uniquify.el b/lisp/uniquify.el index 254832ed700..492918c7f96 100644 --- a/lisp/uniquify.el +++ b/lisp/uniquify.el @@ -421,6 +421,23 @@ in `uniquify-list-buffers-directory-modes', otherwise returns nil." ;;; Hooks from the rest of Emacs +;; Buffer deletion +;; Rerationalize after a buffer is killed, to reduce coinciding buffer names. +;; This mechanism uses `kill-buffer-hook', which runs *before* deletion, so +;; it calls `uniquify-rerationalize-w/o-cb' to rerationalize the buffer list +;; ignoring the current buffer (which is going to be deleted anyway). +(defun uniquify-maybe-rerationalize-w/o-cb () + "Re-rationalize buffer names, ignoring current buffer. +For use on `kill-buffer-hook'." + (if (and (cdr uniquify-managed) + uniquify-buffer-name-style + uniquify-after-kill-buffer-p) + (uniquify-rerationalize-w/o-cb uniquify-managed))) + +;; Ideally we'd like to add it buffer-locally, but that doesn't work +;; because kill-buffer-hook is not permanent-local :-( +(add-hook 'kill-buffer-hook 'uniquify-maybe-rerationalize-w/o-cb) + ;; The logical place to put all this code is in generate-new-buffer-name. ;; It's written in C, so we would add a generate-new-buffer-name-function ;; which, if non-nil, would be called instead of the C. One problem with @@ -458,22 +475,24 @@ in `uniquify-list-buffers-directory-modes', otherwise returns nil." (file-name-nondirectory filename) (file-name-directory filename) ad-return-value)))) -;; Buffer deletion -;; Rerationalize after a buffer is killed, to reduce coinciding buffer names. -;; This mechanism uses `kill-buffer-hook', which runs *before* deletion, so -;; it calls `uniquify-rerationalize-w/o-cb' to rerationalize the buffer list -;; ignoring the current buffer (which is going to be deleted anyway). -(defun uniquify-maybe-rerationalize-w/o-cb () - "Re-rationalize buffer names, ignoring current buffer. -For use on `kill-buffer-hook'." - (if (and (cdr uniquify-managed) - uniquify-buffer-name-style - uniquify-after-kill-buffer-p) - (uniquify-rerationalize-w/o-cb uniquify-managed))) - -;; Ideally we'd like to add it buffer-locally, but that doesn't work -;; because kill-buffer-hook is not permanent-local :-( -(add-hook 'kill-buffer-hook 'uniquify-maybe-rerationalize-w/o-cb) +;;; The End + +(defun uniquify-unload-function () + "Unload the uniquify library." + (save-current-buffer + (let ((buffers nil)) + (dolist (buf (buffer-list)) + (set-buffer buf) + (when uniquify-managed + (push (cons buf (uniquify-item-base (car uniquify-managed))) buffers))) + (dolist (fun '(rename-buffer create-file-buffer)) + (ad-remove-advice fun 'after (intern (concat (symbol-name fun) "-uniquify"))) + (ad-update fun)) + (dolist (buf buffers) + (set-buffer (car buf)) + (rename-buffer (cdr buf) t)))) + ;; continue standard uploading + nil) (provide 'uniquify) diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 6e6aeb5fbb7..f6c94534a00 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -784,7 +784,6 @@ When this mode is active, `whitespace-buffer' is added to (defun whitespace-write-file-hook () "Hook function to be called on the buffer when whitespace check is enabled. This is meant to be added buffer-locally to `write-file-functions'." - (interactive) (let ((werr nil)) (if whitespace-auto-cleanup (whitespace-cleanup-internal) @@ -794,6 +793,21 @@ This is meant to be added buffer-locally to `write-file-functions'." buffer-file-name)))) nil) +(defun whitespace-unload-function () + "Unload the whitespace library." + (if (unintern "whitespace-unload-hook") + ;; if whitespace-unload-hook is defined, let's get rid of it + ;; and recursively call `unload-feature' + (progn (unload-feature 'whitespace) t) + ;; this only happens in the recursive call + (whitespace-global-mode -1) + (save-current-buffer + (dolist (buf (buffer-list)) + (set-buffer buf) + (remove-hook 'write-file-functions 'whitespace-write-file-hook t))) + ;; continue standard unloading + nil)) + (defun whitespace-unload-hook () (remove-hook 'find-file-hook 'whitespace-buffer) (remove-hook 'write-file-functions 'whitespace-write-file-hook t) |