From: Stefan Monnier Date: Wed, 5 May 2010 04:27:16 +0000 (-0400) Subject: Minor cleanups. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~277 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=365f8d856c11b0684817aec977905b8831d4d973;p=emacs.git Minor cleanups. * org-table.el (orgtbl-setup): * org-agenda.el (org-agenda-entry-text-mode): Simplify. * subr.el (add-minor-mode): Use push. * mail/supercite.el (sc-electric-mode): Use more descriptive arg name. * emulation/edt.el (edt-select-mode): Simplify. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f2ebf07fd87..4c33ae6a193 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2010-05-05 Stefan Monnier + Minor cleanups. + * subr.el (add-minor-mode): Use push. + * mail/supercite.el (sc-electric-mode): Use more descriptive arg name. + * emulation/edt.el (edt-select-mode): Simplify. + Use define-minor-mode in more cases. * term/tvi970.el (tvi970-set-keypad-mode): * simple.el (auto-fill-mode, overwrite-mode, binary-overwrite-mode) diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el index 2abde59af90..37764a15435 100644 --- a/lisp/emulation/edt.el +++ b/lisp/emulation/edt.el @@ -858,8 +858,7 @@ Argument NUM is the number of lines to delete." In select mode, selected text is highlighted." (if arg (progn - (make-local-variable 'edt-select-mode) - (setq edt-select-mode 'edt-select-mode-current) + (set (make-local-variable 'edt-select-mode) 'edt-select-mode-current) (setq rect-start-point (window-point))) (progn (kill-local-variable 'edt-select-mode))) diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el index 9144be89e96..1660721fe21 100644 --- a/lisp/mail/supercite.el +++ b/lisp/mail/supercite.el @@ -1619,21 +1619,20 @@ error occurs." (cadr err) sc-eref-style) (beep)))))) -(defun sc-electric-mode (&optional arg) - " -Mode for viewing Supercite reference headers. Commands are: +(defun sc-electric-mode (&optional style) + "Mode for viewing Supercite reference headers. Commands are: \n\\{sc-electric-mode-map} `sc-electric-mode' is not intended to be run interactively, but rather accessed through Supercite's electric reference feature. See -`sc-insert-reference' for more details. Optional ARG is the initial +`sc-insert-reference' for more details. Optional STYLE is the initial header style to use, unless not supplied or invalid, in which case `sc-preferred-header-style' is used." (let ((info sc-mail-info)) (setq sc-eref-style - (or (sc-valid-index-p arg) + (or (sc-valid-index-p style) (sc-valid-index-p sc-preferred-header-style) 0)) diff --git a/lisp/net/rlogin.el b/lisp/net/rlogin.el index 1406abecdcb..fb3f3339be5 100644 --- a/lisp/net/rlogin.el +++ b/lisp/net/rlogin.el @@ -249,7 +249,7 @@ If called with a positive, numeric prefix argument, e.g. ``\\[universal-argument] 1 M-x rlogin-directory-tracking-mode\'', then do directory tracking but assume the remote filesystem is the same as the local system. This only works in general if the remote machine and the -local one share the same directories (through NFS)." +local one share the same directories (e.g. through NFS)." (interactive "P") (cond ((or (null prefix) diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog index 0c420a73deb..2b29da02580 100644 --- a/lisp/org/ChangeLog +++ b/lisp/org/ChangeLog @@ -1,3 +1,8 @@ +2010-05-05 Stefan Monnier + + * org-table.el (orgtbl-setup): + * org-agenda.el (org-agenda-entry-text-mode): Simplify. + 2010-05-03 Stefan Monnier * org-table.el (orgtbl-mode): Use define-minor-mode. diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 1cec8a8a227..50e78528256 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -5916,9 +5916,8 @@ so that the date SD will be in that range." (defun org-agenda-entry-text-mode (&optional arg) "Toggle entry text mode in an agenda buffer." (interactive "P") - (if (integerp arg) - (setq org-agenda-entry-text-mode t) - (setq org-agenda-entry-text-mode (not org-agenda-entry-text-mode))) + (setq org-agenda-entry-text-mode (or (integerp arg) + (not org-agenda-entry-text-mode))) (org-agenda-entry-text-hide) (and org-agenda-entry-text-mode (let ((org-agenda-entry-text-maxlines diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index 98c48baf52c..bbf9f10bc25 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -3514,34 +3514,33 @@ to execute outside of tables." "Setup orgtbl keymaps." (let ((nfunc 0) (bindings - (list - '([(meta shift left)] org-table-delete-column) - '([(meta left)] org-table-move-column-left) - '([(meta right)] org-table-move-column-right) - '([(meta shift right)] org-table-insert-column) - '([(meta shift up)] org-table-kill-row) - '([(meta shift down)] org-table-insert-row) - '([(meta up)] org-table-move-row-up) - '([(meta down)] org-table-move-row-down) - '("\C-c\C-w" org-table-cut-region) - '("\C-c\M-w" org-table-copy-region) - '("\C-c\C-y" org-table-paste-rectangle) - '("\C-c-" org-table-insert-hline) - '("\C-c}" org-table-toggle-coordinate-overlays) - '("\C-c{" org-table-toggle-formula-debugger) - '("\C-m" org-table-next-row) - '([(shift return)] org-table-copy-down) - '("\C-c?" org-table-field-info) - '("\C-c " org-table-blank-field) - '("\C-c+" org-table-sum) - '("\C-c=" org-table-eval-formula) - '("\C-c'" org-table-edit-formulas) - '("\C-c`" org-table-edit-field) - '("\C-c*" org-table-recalculate) - '("\C-c^" org-table-sort-lines) - '("\M-a" org-table-beginning-of-field) - '("\M-e" org-table-end-of-field) - '([(control ?#)] org-table-rotate-recalc-marks))) + '(([(meta shift left)] org-table-delete-column) + ([(meta left)] org-table-move-column-left) + ([(meta right)] org-table-move-column-right) + ([(meta shift right)] org-table-insert-column) + ([(meta shift up)] org-table-kill-row) + ([(meta shift down)] org-table-insert-row) + ([(meta up)] org-table-move-row-up) + ([(meta down)] org-table-move-row-down) + ("\C-c\C-w" org-table-cut-region) + ("\C-c\M-w" org-table-copy-region) + ("\C-c\C-y" org-table-paste-rectangle) + ("\C-c-" org-table-insert-hline) + ("\C-c}" org-table-toggle-coordinate-overlays) + ("\C-c{" org-table-toggle-formula-debugger) + ("\C-m" org-table-next-row) + ([(shift return)] org-table-copy-down) + ("\C-c?" org-table-field-info) + ("\C-c " org-table-blank-field) + ("\C-c+" org-table-sum) + ("\C-c=" org-table-eval-formula) + ("\C-c'" org-table-edit-formulas) + ("\C-c`" org-table-edit-field) + ("\C-c*" org-table-recalculate) + ("\C-c^" org-table-sort-lines) + ("\M-a" org-table-beginning-of-field) + ("\M-e" org-table-end-of-field) + ([(control ?#)] org-table-rotate-recalc-marks))) elt key fun cmd) (while (setq elt (pop bindings)) (setq nfunc (1+ nfunc)) diff --git a/lisp/subr.el b/lisp/subr.el index 0d57f1ba0c5..0cc05a78bc7 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1477,8 +1477,7 @@ If TOGGLE has a `:menu-tag', that is used for the menu item's label." (let ((rest (cdr found))) (setcdr found nil) (nconc found (list (list toggle name)) rest)) - (setq minor-mode-alist (cons (list toggle name) - minor-mode-alist))))))) + (push (list toggle name) minor-mode-alist)))))) ;; Add the toggle to the minor-modes menu if requested. (when (get toggle :included) (define-key mode-line-mode-menu @@ -1507,8 +1506,7 @@ If TOGGLE has a `:menu-tag', that is used for the menu item's label." (let ((rest (cdr found))) (setcdr found nil) (nconc found (list (cons toggle keymap)) rest)) - (setq minor-mode-map-alist (cons (cons toggle keymap) - minor-mode-map-alist)))))))) + (push (cons toggle keymap) minor-mode-map-alist))))))) ;;; Load history