Now on revision 108359. ------------------------------------------------------------ revno: 108359 committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2012-05-25 06:43:29 +0000 message: nnspool.el (news-path): Use eval-and-compile diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-05-24 07:31:45 +0000 +++ lisp/gnus/ChangeLog 2012-05-25 06:43:29 +0000 @@ -1,3 +1,7 @@ +2012-05-25 Katsumi Yamaoka + + * nnspool.el (news-path): Use eval-and-compile. + 2012-05-24 Glenn Morris * nnspool.el (news-directory, news-path, news-inews-program): === modified file 'lisp/gnus/nnspool.el' --- lisp/gnus/nnspool.el 2012-05-24 07:31:45 +0000 +++ lisp/gnus/nnspool.el 2012-05-25 06:43:29 +0000 @@ -34,11 +34,12 @@ ;; Probably this entire thing should be obsolete. ;; It's only used to init nnspool-spool-directory, so why not just ;; set that variable's default directly? -(defvar news-directory (if (file-exists-p "/usr/spool/news/") - "/usr/spool/news/" - "/var/spool/news/") - "The root directory below which all news files are stored.") -(defvaralias 'news-path 'news-directory) +(eval-and-compile + (defvar news-directory (if (file-exists-p "/usr/spool/news/") + "/usr/spool/news/" + "/var/spool/news/") + "The root directory below which all news files are stored.") + (defvaralias 'news-path 'news-directory)) ;; Ditto re obsolescence. (defvar news-inews-program ------------------------------------------------------------ revno: 108358 committer: Juri Linkov branch nick: trunk timestamp: Fri 2012-05-25 03:55:40 +0300 message: Use the same diff color scheme as in modern VCSes (bug#10181). * lisp/vc/diff-mode.el (diff-header, diff-file-header): Remove "green" to avoid confusion with `diff-added' that now uses green colors. (diff-removed): Use shades of red. (diff-added): Use shades of green. (diff-changed): Leave just the yellow color. (diff-use-changed-face): New variable. (diff-font-lock-keywords): Use `diff-use-changed-face' to decide how to highlight context diff changes. (diff-refine-change): Use shades of yellow. (diff-refine-removed): New face that uses shades of red. (diff-refine-added): New face that uses shades of green. (diff-refine-hunk): Use `diff-refine-change', `diff-refine-added', `diff-refine-removed' in the call to `smerge-refine-subst' depending on the value of `diff-use-changed-face'. * lisp/vc/ediff-init.el (ediff-current-diff-A, ediff-fine-diff-A): Add face condition `min-colors 88' with shades of red. (ediff-current-diff-B, ediff-fine-diff-B): Add face condition `min-colors 88' with shades of green. (ediff-current-diff-C, ediff-fine-diff-C): Add face condition `min-colors 88' with shades of yellow. * lisp/vc/smerge-mode.el (smerge-mine): Use shades of red. (smerge-other): Use shades of green. (smerge-base): Use shades of yellow. (smerge-refined-change): Empty face. (smerge-refined-removed): New face that uses shades of red. (smerge-refined-added): New face that uses shades of green. (smerge-refine-subst): Rename arg `props' to `props-c'. Add new args `props-r' and `props-a', and use them. Doc fix. (smerge-refine): Evaluate `smerge-use-changed-face' and depending on its value use different faces `smerge-refined-change', `smerge-refined-removed', `smerge-refined-added' in the call to `smerge-refine-subst'. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-05-18 07:14:45 +0000 +++ etc/NEWS 2012-05-25 00:55:40 +0000 @@ -94,6 +94,17 @@ * Changes in Specialized Modes and Packages in Emacs 24.2 +** Diff mode + +Faces for changes now use the same diff color scheme as in modern VCSes +where deletions are displayed in red (new faces `diff-refine-removed' +and `smerge-refined-removed' and new definition of `diff-removed'), +insertions in green (new faces `diff-refine-added' and +`smerge-refined-added' and new definition of `diff-added'). +The variable `diff-use-changed-face' defines whether to use +the face `diff-changed', or `diff-removed' and `diff-added' +to highlight changes in context diffs. + ** `sh-script' *** Pairing of parens/quotes uses electric-pair-mode instead of skeleton-pair. *** `sh-electric-here-document-mode' now controls auto-insertion of here-docs. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-05-24 20:40:19 +0000 +++ lisp/ChangeLog 2012-05-25 00:55:40 +0000 @@ -1,3 +1,42 @@ +2012-05-25 Juri Linkov + + Use the same diff color scheme as in modern VCSes (bug#10181). + + * vc/diff-mode.el (diff-header, diff-file-header): Remove "green" + to avoid confusion with `diff-added' that now uses green colors. + (diff-removed): Use shades of red. + (diff-added): Use shades of green. + (diff-changed): Leave just the yellow color. + (diff-use-changed-face): New variable. + (diff-font-lock-keywords): Use `diff-use-changed-face' to decide + how to highlight context diff changes. + (diff-refine-change): Use shades of yellow. + (diff-refine-removed): New face that uses shades of red. + (diff-refine-added): New face that uses shades of green. + (diff-refine-hunk): Use `diff-refine-change', `diff-refine-added', + `diff-refine-removed' in the call to `smerge-refine-subst' + depending on the value of `diff-use-changed-face'. + + * vc/smerge-mode.el (smerge-mine): Use shades of red. + (smerge-other): Use shades of green. + (smerge-base): Use shades of yellow. + (smerge-refined-change): Empty face. + (smerge-refined-removed): New face that uses shades of red. + (smerge-refined-added): New face that uses shades of green. + (smerge-refine-subst): Rename arg `props' to `props-c'. Add new + args `props-r' and `props-a', and use them. Doc fix. + (smerge-refine): Evaluate `smerge-use-changed-face' and depending + on its value use different faces `smerge-refined-change', + `smerge-refined-removed', `smerge-refined-added' in the call to + `smerge-refine-subst'. + + * vc/ediff-init.el (ediff-current-diff-A, ediff-fine-diff-A): + Add face condition `min-colors 88' with shades of red. + (ediff-current-diff-B, ediff-fine-diff-B): Add face condition + `min-colors 88' with shades of green. + (ediff-current-diff-C, ediff-fine-diff-C): Add face condition + `min-colors 88' with shades of yellow. + 2012-05-24 Glenn Morris * paths.el (prune-directory-list, remote-shell-program): Move to... === modified file 'lisp/vc/diff-mode.el' --- lisp/vc/diff-mode.el 2012-04-26 08:00:47 +0000 +++ lisp/vc/diff-mode.el 2012-05-25 00:55:40 +0000 @@ -237,10 +237,8 @@ :background "grey80") (((class color) (min-colors 88) (background dark)) :background "grey45") - (((class color) (background light)) + (((class color)) :foreground "blue1" :weight bold) - (((class color) (background dark)) - :foreground "green" :weight bold) (t :weight bold)) "`diff-mode' face inherited by hunk and index header faces." :group 'diff-mode) @@ -252,9 +250,7 @@ :background "grey70" :weight bold) (((class color) (min-colors 88) (background dark)) :background "grey60" :weight bold) - (((class color) (background light)) - :foreground "green" :weight bold) - (((class color) (background dark)) + (((class color)) :foreground "cyan" :weight bold) (t :weight bold)) ; :height 1.3 "`diff-mode' face used to highlight file header lines." @@ -277,14 +273,28 @@ (defvar diff-hunk-header-face 'diff-hunk-header) (defface diff-removed - '((t :inherit diff-changed)) + '((default + :inherit diff-changed) + (((class color) (min-colors 88) (background light)) + :background "#ffdddd") + (((class color) (min-colors 88) (background dark)) + :background "#553333") + (((class color)) + :foreground "red")) "`diff-mode' face used to highlight removed lines." :group 'diff-mode) (define-obsolete-face-alias 'diff-removed-face 'diff-removed "22.1") (defvar diff-removed-face 'diff-removed) (defface diff-added - '((t :inherit diff-changed)) + '((default + :inherit diff-changed) + (((class color) (min-colors 88) (background light)) + :background "#ddffdd") + (((class color) (min-colors 88) (background dark)) + :background "#335533") + (((class color)) + :foreground "green")) "`diff-mode' face used to highlight added lines." :group 'diff-mode) (define-obsolete-face-alias 'diff-added-face 'diff-added "22.1") @@ -296,10 +306,8 @@ '((((class color grayscale) (min-colors 88))) ;; If the terminal lacks sufficient colors for shadowing, ;; highlight changed lines explicitly. - (((class color) (background light)) - :foreground "magenta" :weight bold :slant italic) - (((class color) (background dark)) - :foreground "yellow" :weight bold :slant italic)) + (((class color)) + :foreground "yellow")) "`diff-mode' face used to highlight changed lines." :group 'diff-mode) (define-obsolete-face-alias 'diff-changed-face 'diff-changed "22.1") @@ -374,6 +382,13 @@ (defconst diff-context-mid-hunk-header-re "--- \\([0-9]+\\)\\(?:,\\([0-9]+\\)\\)? ----$") +(defvar diff-use-changed-face (and (face-differs-from-default-p diff-changed-face) + (not (face-equal diff-changed-face diff-added-face)) + (not (face-equal diff-changed-face diff-removed-face))) + "If non-nil, use the face `diff-changed' for changed lines in context diffs. +Otherwise, use the face `diff-removed' for removed lines, +and the face `diff-added' for added lines.") + (defvar diff-font-lock-keywords `((,(concat "\\(" diff-hunk-header-re-unified "\\)\\(.*\\)$") (1 diff-hunk-header-face) (6 diff-function-face)) @@ -393,8 +408,25 @@ ("^\\([+>]\\)\\(.*\n\\)" (1 diff-indicator-added-face) (2 diff-added-face)) ("^\\(!\\)\\(.*\n\\)" - (1 diff-indicator-changed-face) (2 diff-changed-face)) - ("^Index: \\(.+\\).*\n" + (1 (if diff-use-changed-face + diff-indicator-changed-face + ;; Otherwise, search for `diff-context-mid-hunk-header-re' and + ;; if the line of context diff is above, use `diff-removed-face'; + ;; if below, use `diff-added-face'. + (save-match-data + (let ((limit (save-excursion (diff-beginning-of-hunk)))) + (if (save-excursion (re-search-backward diff-context-mid-hunk-header-re limit t)) + diff-indicator-added-face + diff-indicator-removed-face))))) + (2 (if diff-use-changed-face + diff-changed-face + ;; Otherwise, use the same method as above. + (save-match-data + (let ((limit (save-excursion (diff-beginning-of-hunk)))) + (if (save-excursion (re-search-backward diff-context-mid-hunk-header-re limit t)) + diff-added-face + diff-removed-face)))))) + ("^\\(?:Index\\|revno\\): \\(.+\\).*\n" (0 diff-header-face) (1 diff-index-face prepend)) ("^Only in .*\n" . diff-nonexistent-face) ("^\\(#\\)\\(.*\\)" @@ -1847,17 +1879,35 @@ (defface diff-refine-change '((((class color) (min-colors 88) (background light)) - :background "grey85") + :background "#ffff55") (((class color) (min-colors 88) (background dark)) - :background "grey60") - (((class color) (background light)) - :background "yellow") - (((class color) (background dark)) - :background "green") - (t :weight bold)) + :background "#aaaa22") + (t :inverse-video t)) "Face used for char-based changes shown by `diff-refine-hunk'." :group 'diff-mode) +(defface diff-refine-removed + '((default + :inherit diff-refine-change) + (((class color) (min-colors 88) (background light)) + :background "#ffaaaa") + (((class color) (min-colors 88) (background dark)) + :background "#aa2222")) + "Face used for removed characters shown by `diff-refine-hunk'." + :group 'diff-mode + :version "24.2") + +(defface diff-refine-added + '((default + :inherit diff-refine-change) + (((class color) (min-colors 88) (background light)) + :background "#aaffaa") + (((class color) (min-colors 88) (background dark)) + :background "#22aa22")) + "Face used for added characters shown by `diff-refine-hunk'." + :group 'diff-mode + :version "24.2") + (defun diff-refine-preproc () (while (re-search-forward "^[+>]" nil t) ;; Remove spurious changes due to the fact that one side of the hunk is @@ -1871,7 +1921,7 @@ ) (declare-function smerge-refine-subst "smerge-mode" - (beg1 end1 beg2 end2 props &optional preproc)) + (beg1 end1 beg2 end2 props-c &optional preproc props-r props-a)) (defun diff-refine-hunk () "Highlight changes of hunk at point at a finer granularity." @@ -1882,7 +1932,9 @@ (let* ((start (point)) (style (diff-hunk-style)) ;Skips the hunk header as well. (beg (point)) - (props '((diff-mode . fine) (face diff-refine-change))) + (props-c '((diff-mode . fine) (face diff-refine-change))) + (props-r '((diff-mode . fine) (face diff-refine-removed))) + (props-a '((diff-mode . fine) (face diff-refine-added))) ;; Be careful to go back to `start' so diff-end-of-hunk gets ;; to read the hunk header's line info. (end (progn (goto-char start) (diff-end-of-hunk) (point)))) @@ -1896,7 +1948,7 @@ end t) (smerge-refine-subst (match-beginning 0) (match-end 1) (match-end 1) (match-end 0) - props 'diff-refine-preproc))) + nil 'diff-refine-preproc props-r props-a))) (context (let* ((middle (save-excursion (re-search-forward "^---"))) (other middle)) @@ -1908,14 +1960,17 @@ (setq other (match-end 0)) (match-beginning 0)) other - props 'diff-refine-preproc)))) + (if diff-use-changed-face props-c) + 'diff-refine-preproc + (unless diff-use-changed-face props-r) + (unless diff-use-changed-face props-a))))) (t ;; Normal diffs. (let ((beg1 (1+ (point)))) (when (re-search-forward "^---.*\n" end t) ;; It's a combined add&remove, so there's something to do. (smerge-refine-subst beg1 (match-beginning 0) (match-end 0) end - props 'diff-refine-preproc)))))))) + nil 'diff-refine-preproc props-r props-a)))))))) (defun diff-undo (&optional arg) "Perform `undo', ignoring the buffer's read-only status." === modified file 'lisp/vc/ediff-init.el' --- lisp/vc/ediff-init.el 2012-04-26 03:04:36 +0000 +++ lisp/vc/ediff-init.el 2012-05-25 00:55:40 +0000 @@ -853,7 +853,11 @@ (defface ediff-current-diff-A (if (featurep 'emacs) - '((((class color) (min-colors 16)) + '((((class color) (min-colors 88) (background light)) + :background "#ffdddd") + (((class color) (min-colors 88) (background dark)) + :background "#553333") + (((class color) (min-colors 16)) (:foreground "firebrick" :background "pale green")) (((class color)) (:foreground "blue3" :background "yellow3")) @@ -882,7 +886,11 @@ (defface ediff-current-diff-B (if (featurep 'emacs) - '((((class color) (min-colors 16)) + '((((class color) (min-colors 88) (background light)) + :background "#ddffdd") + (((class color) (min-colors 88) (background dark)) + :background "#335533") + (((class color) (min-colors 16)) (:foreground "DarkOrchid" :background "Yellow")) (((class color)) (:foreground "magenta3" :background "yellow3" @@ -912,7 +920,11 @@ (defface ediff-current-diff-C (if (featurep 'emacs) - '((((class color) (min-colors 16)) + '((((class color) (min-colors 88) (background light)) + :background "#ffffaa") + (((class color) (min-colors 88) (background dark)) + :background "#888833") + (((class color) (min-colors 16)) (:foreground "Navy" :background "Pink")) (((class color)) (:foreground "cyan3" :background "yellow3" :weight bold)) @@ -968,7 +980,11 @@ (defface ediff-fine-diff-A (if (featurep 'emacs) - '((((class color) (min-colors 16)) + '((((class color) (min-colors 88) (background light)) + :background "#ffaaaa") + (((class color) (min-colors 88) (background dark)) + :background "#aa2222") + (((class color) (min-colors 16)) (:foreground "Navy" :background "sky blue")) (((class color)) (:foreground "white" :background "sky blue" :weight bold)) @@ -989,7 +1005,11 @@ (defface ediff-fine-diff-B (if (featurep 'emacs) - '((((class color) (min-colors 16)) + '((((class color) (min-colors 88) (background light)) + :background "#aaffaa") + (((class color) (min-colors 88) (background dark)) + :background "#22aa22") + (((class color) (min-colors 16)) (:foreground "Black" :background "cyan")) (((class color)) (:foreground "magenta3" :background "cyan3")) @@ -1010,7 +1030,11 @@ (defface ediff-fine-diff-C (if (featurep 'emacs) - '((((type pc)) + '((((class color) (min-colors 88) (background light)) + :background "#ffff55") + (((class color) (min-colors 88) (background dark)) + :background "#aaaa22") + (((type pc)) (:foreground "white" :background "Turquoise")) (((class color) (min-colors 16)) (:foreground "Black" :background "Turquoise")) === modified file 'lisp/vc/smerge-mode.el' --- lisp/vc/smerge-mode.el 2012-05-04 23:16:47 +0000 +++ lisp/vc/smerge-mode.el 2012-05-25 00:55:40 +0000 @@ -78,36 +78,36 @@ :type 'boolean) (defface smerge-mine - '((((min-colors 88) (background light)) - (:foreground "blue1")) - (((background light)) - (:foreground "blue")) - (((min-colors 88) (background dark)) - (:foreground "cyan1")) - (((background dark)) - (:foreground "cyan"))) + '((((class color) (min-colors 88) (background light)) + :background "#ffdddd") + (((class color) (min-colors 88) (background dark)) + :background "#553333") + (((class color)) + :foreground "red")) "Face for your code." :group 'smerge) (define-obsolete-face-alias 'smerge-mine-face 'smerge-mine "22.1") (defvar smerge-mine-face 'smerge-mine) (defface smerge-other - '((((background light)) - (:foreground "darkgreen")) - (((background dark)) - (:foreground "lightgreen"))) + '((((class color) (min-colors 88) (background light)) + :background "#ddffdd") + (((class color) (min-colors 88) (background dark)) + :background "#335533") + (((class color)) + :foreground "green")) "Face for the other code." :group 'smerge) (define-obsolete-face-alias 'smerge-other-face 'smerge-other "22.1") (defvar smerge-other-face 'smerge-other) (defface smerge-base - '((((min-colors 88) (background light)) - (:foreground "red1")) - (((background light)) - (:foreground "red")) - (((background dark)) - (:foreground "orange"))) + '((((class color) (min-colors 88) (background light)) + :background "#ffffaa") + (((class color) (min-colors 88) (background dark)) + :background "#888833") + (((class color)) + :foreground "yellow")) "Face for the base code." :group 'smerge) (define-obsolete-face-alias 'smerge-base-face 'smerge-base "22.1") @@ -124,10 +124,34 @@ (defvar smerge-markers-face 'smerge-markers) (defface smerge-refined-change - '((t :background "yellow")) + '((t nil)) "Face used for char-based changes shown by `smerge-refine'." :group 'smerge) +(defface smerge-refined-removed + '((default + :inherit smerge-refined-change) + (((class color) (min-colors 88) (background light)) + :background "#ffaaaa") + (((class color) (min-colors 88) (background dark)) + :background "#aa2222") + (t :inverse-video t)) + "Face used for removed characters shown by `smerge-refine'." + :group 'smerge + :version "24.2") + +(defface smerge-refined-added + '((default + :inherit smerge-refined-change) + (((class color) (min-colors 88) (background light)) + :background "#aaffaa") + (((class color) (min-colors 88) (background dark)) + :background "#22aa22") + (t :inverse-video t)) + "Face used for added characters shown by `smerge-refine'." + :group 'smerge + :version "24.2") + (easy-mmode-defmap smerge-basic-map `(("n" . smerge-next) ("p" . smerge-prev) @@ -980,9 +1004,17 @@ (dolist (x props) (overlay-put ol (car x) (cdr x))) ol))))) -(defun smerge-refine-subst (beg1 end1 beg2 end2 props &optional preproc) +(defun smerge-refine-subst (beg1 end1 beg2 end2 props-c &optional preproc props-r props-a) "Show fine differences in the two regions BEG1..END1 and BEG2..END2. -PROPS is an alist of properties to put (via overlays) on the changes. +PROPS-C is an alist of properties to put (via overlays) on the changes. +PROPS-R is an alist of properties to put on removed characters. +PROPS-A is an alist of properties to put on added characters. +If PROPS-R and PROPS-A are nil, put PROPS-C on all changes. +If PROPS-C is nil, but PROPS-R and PROPS-A are non-nil, +put PROPS-A on added characters, PROPS-R on removed characters. +If PROPS-C, PROPS-R and PROPS-A are non-nil, put PROPS-C on changed characters, +PROPS-A on added characters, and PROPS-R on removed characters. + If non-nil, PREPROC is called with no argument in a buffer that contains a copy of a region, just before preparing it to for `diff'. It can be used to replace chars to try and eliminate some spurious differences." @@ -1026,10 +1058,18 @@ (m5 (match-string 5))) (when (memq op '(?d ?c)) (setq last1 - (smerge-refine-highlight-change buf beg1 m1 m2 props))) + (smerge-refine-highlight-change + buf beg1 m1 m2 + ;; Try to use props-c only for changed chars, + ;; fallback to props-r for changed/removed chars, + ;; but if props-r is nil then fallback to props-c. + (or (and (eq op '?c) props-c) props-r props-c)))) (when (memq op '(?a ?c)) (setq last2 - (smerge-refine-highlight-change buf beg2 m4 m5 props)))) + (smerge-refine-highlight-change + buf beg2 m4 m5 + ;; Same logic as for removed chars above. + (or (and (eq op '?c) props-c) props-a props-c))))) (forward-line 1) ;Skip hunk header. (and (re-search-forward "^[0-9]" nil 'move) ;Skip hunk body. (goto-char (match-beginning 0)))) @@ -1081,7 +1121,11 @@ ((eq (match-end 3) (match-beginning 3)) 3) (t 2))) (let ((n1 (if (eq part 1) 2 1)) - (n2 (if (eq part 3) 2 3))) + (n2 (if (eq part 3) 2 3)) + (smerge-use-changed-face + (and (face-differs-from-default-p 'smerge-refined-change) + (not (face-equal 'smerge-refined-change 'smerge-refined-added)) + (not (face-equal 'smerge-refined-change 'smerge-refined-removed))))) (smerge-ensure-match n1) (smerge-ensure-match n2) (with-silent-modifications @@ -1090,8 +1134,13 @@ (cons (buffer-chars-modified-tick) part))) (smerge-refine-subst (match-beginning n1) (match-end n1) (match-beginning n2) (match-end n2) - '((smerge . refine) - (face . smerge-refined-change))))) + (if smerge-use-changed-face + '((smerge . refine) (face . smerge-refined-change))) + nil + (unless smerge-use-changed-face + '((smerge . refine) (face . smerge-refined-removed))) + (unless smerge-use-changed-face + '((smerge . refine) (face . smerge-refined-added)))))) (defun smerge-diff (n1 n2) (smerge-match-conflict) ------------------------------------------------------------ revno: 108357 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-05-24 17:27:22 -0400 message: Fix previous (slogin and rlogin not appropriate for remote-shell-program) diff: === modified file 'lisp/files.el' --- lisp/files.el 2012-05-24 20:40:19 +0000 +++ lisp/files.el 2012-05-24 21:27:22 +0000 @@ -998,7 +998,7 @@ ;; in this day and age. Almost everyone will use ssh, and have ;; whatever command they want to use in PATH. (purecopy - (let ((list '("ssh" "slogin" "rlogin" "remsh" "rcmd" "rsh"))) + (let ((list '("ssh" "remsh" "rcmd" "rsh"))) (while (and list (not (executable-find (car list))) (setq list (cdr list)))) ------------------------------------------------------------ revno: 108356 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-05-24 16:40:19 -0400 message: Move prune-directory-list, remote-shell-program from paths.el to files.el * lisp/paths.el (prune-directory-list, remote-shell-program): Move to ... * lisp/files.el (prune-directory-list, remote-shell-program): ...here. For the latter, delay initialization, prefer ssh, just search PATH. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-05-24 07:53:21 +0000 +++ lisp/ChangeLog 2012-05-24 20:40:19 +0000 @@ -1,5 +1,9 @@ 2012-05-24 Glenn Morris + * paths.el (prune-directory-list, remote-shell-program): Move to... + * files.el (prune-directory-list, remote-shell-program): ...here. + For the latter, delay initialization, prefer ssh, just search PATH. + * paths.el (term-file-prefix): Move to faces.el (the only user). * faces.el (term-file-prefix): Move here, make it a defcustom. === modified file 'lisp/files.el' --- lisp/files.el 2012-05-13 03:05:06 +0000 +++ lisp/files.el 2012-05-24 20:40:19 +0000 @@ -986,6 +986,29 @@ (funcall handler 'file-remote-p file identification connected) nil))) +;; Probably this entire variable should be obsolete now, in favor of +;; something Tramp-related (?). It is not used in many places. +;; It's not clear what the best file for this to be in is, but given +;; it uses custom-initialize-delay, it is easier if it is preloaded +;; rather than autoloaded. +(defcustom remote-shell-program + ;; This used to try various hard-coded places for remsh, rsh, and + ;; rcmd, trying to guess based on location whether "rsh" was + ;; "restricted shell" or "remote shell", but I don't see the point + ;; in this day and age. Almost everyone will use ssh, and have + ;; whatever command they want to use in PATH. + (purecopy + (let ((list '("ssh" "slogin" "rlogin" "remsh" "rcmd" "rsh"))) + (while (and list + (not (executable-find (car list))) + (setq list (cdr list)))) + (or (car list) "ssh"))) + "Program to use to execute commands on a remote host (e.g. ssh or rsh)." + :version "24.2" ; ssh rather than rsh, etc + :initialize 'custom-initialize-delay + :group 'environment + :type 'file) + (defcustom remote-file-name-inhibit-cache 10 "Whether to use the remote file-name cache for read access. When `nil', never expire cached values (caution) @@ -5125,6 +5148,24 @@ (times (and keep-time (nth 5 (file-attributes directory))))) (if modes (set-file-modes newname modes)) (if times (set-file-times newname times)))))) + + +;; At time of writing, only info uses this. +(defun prune-directory-list (dirs &optional keep reject) + "Return a copy of DIRS with all non-existent directories removed. +The optional argument KEEP is a list of directories to retain even if +they don't exist, and REJECT is a list of directories to remove from +DIRS, even if they exist; REJECT takes precedence over KEEP. + +Note that membership in REJECT and KEEP is checked using simple string +comparison." + (apply #'nconc + (mapcar (lambda (dir) + (and (not (member dir reject)) + (or (member dir keep) (file-directory-p dir)) + (list dir))) + dirs))) + (put 'revert-buffer-function 'permanent-local t) (defvar revert-buffer-function nil === modified file 'lisp/paths.el' --- lisp/paths.el 2012-05-24 07:53:21 +0000 +++ lisp/paths.el 2012-05-24 20:40:19 +0000 @@ -35,22 +35,6 @@ ;; conventions described in make-docfile, so that they get put in the ;; DOC file rather than in memory. -(defun prune-directory-list (dirs &optional keep reject) - "\ -Return a copy of DIRS with all non-existent directories removed. -The optional argument KEEP is a list of directories to retain even if -they don't exist, and REJECT is a list of directories to remove from -DIRS, even if they exist; REJECT takes precedence over KEEP. - -Note that membership in REJECT and KEEP is checked using simple string -comparison." - (apply #'nconc - (mapcar (lambda (dir) - (and (not (member dir reject)) - (or (member dir keep) (file-directory-p dir)) - (list dir))) - dirs))) - (defvar Info-default-directory-list (let* ((config-dir (file-name-as-directory configure-info-directory)) @@ -101,30 +85,5 @@ for initializing `Info-directory-list' when Info is started, unless the environment variable INFOPATH is set.") -(defcustom remote-shell-program - (purecopy - (cond - ;; Some systems use rsh for the remote shell; others use that name for the - ;; restricted shell and use remsh for the remote shell. Let's try to guess - ;; based on what we actually find out there. The restricted shell is - ;; almost certainly in /bin or /usr/bin, so it's probably safe to assume - ;; that an rsh found elsewhere is the remote shell program. The converse - ;; is not true: /usr/bin/rsh could be either one, so check that last. - ((file-exists-p "/usr/ucb/remsh") "/usr/ucb/remsh") - ((file-exists-p "/usr/bsd/remsh") "/usr/bsd/remsh") - ((file-exists-p "/bin/remsh") "/bin/remsh") - ((file-exists-p "/usr/bin/remsh") "/usr/bin/remsh") - ((file-exists-p "/usr/local/bin/remsh") "/usr/local/bin/remsh") - ((file-exists-p "/usr/ucb/rsh") "/usr/ucb/rsh") - ((file-exists-p "/usr/bsd/rsh") "/usr/bsd/rsh") - ((file-exists-p "/usr/local/bin/rsh") "/usr/local/bin/rsh") - ((file-exists-p "/usr/bin/rcmd") "/usr/bin/rcmd") - ((file-exists-p "/bin/rcmd") "/bin/rcmd") - ((file-exists-p "/bin/rsh") "/bin/rsh") - ((file-exists-p "/usr/bin/rsh") "/usr/bin/rsh") - (t "rsh"))) - "File name for remote-shell program (often rsh or remsh)." - :group 'environment - :type 'file) ;;; paths.el ends here ------------------------------------------------------------ revno: 108355 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-05-24 00:53:21 -0700 message: * lisp/paths.el (term-file-prefix): Move to lisp/faces.el (the only user). * faces.el (term-file-prefix): Move here, make it a defcustom. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-05-24 07:31:45 +0000 +++ lisp/ChangeLog 2012-05-24 07:53:21 +0000 @@ -1,5 +1,8 @@ 2012-05-24 Glenn Morris + * paths.el (term-file-prefix): Move to faces.el (the only user). + * faces.el (term-file-prefix): Move here, make it a defcustom. + * paths.el (news-directory, news-path, news-inews-program): Move to gnus/nnspool.el. === modified file 'lisp/faces.el' --- lisp/faces.el 2012-04-22 18:04:54 +0000 +++ lisp/faces.el 2012-05-24 07:53:21 +0000 @@ -28,6 +28,16 @@ (eval-when-compile (require 'cl)) +(defcustom term-file-prefix (purecopy "term/") + "If non-nil, Emacs startup performs terminal-specific initialization. +It does this by: (load (concat term-file-prefix (getenv \"TERM\"))) + +You may set this variable to nil in your init file if you do not wish +the terminal-initialization file to be loaded." + :type '(choice (const :tag "No terminal-specific initialization" nil) + (string :tag "Name of directory with term files")) + :group 'terminals) + (declare-function xw-defined-colors "term/common-win" (&optional frame)) (defvar help-xref-stack-item) === modified file 'lisp/paths.el' --- lisp/paths.el 2012-05-24 07:31:45 +0000 +++ lisp/paths.el 2012-05-24 07:53:21 +0000 @@ -127,9 +127,4 @@ :group 'environment :type 'file) -(defvar term-file-prefix (purecopy "term/") "\ -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.") - ;;; paths.el ends here ------------------------------------------------------------ revno: 108354 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-05-24 00:31:45 -0700 message: * paths.el (news-inews-program): Move to gnus/nnspool.el. * gnus/nnspool.el (news-inews-program): Move here from paths.el. Don't see a need for this to be autoloaded. (Or even to exist; it is only used to init another variable.) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-05-24 07:27:24 +0000 +++ lisp/ChangeLog 2012-05-24 07:31:45 +0000 @@ -1,6 +1,7 @@ 2012-05-24 Glenn Morris - * paths.el (news-directory, news-path): Move to gnus/nnspool.el. + * paths.el (news-directory, news-path, news-inews-program): + Move to gnus/nnspool.el. * paths.el (gnus-default-nntp-server): Remove (gnus.el defines it). === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-05-24 07:27:24 +0000 +++ lisp/gnus/ChangeLog 2012-05-24 07:31:45 +0000 @@ -1,7 +1,7 @@ 2012-05-24 Glenn Morris - * nnspool.el (news-directory, news-path): Move here from paths.el. - Don't see a need for these to be autoloaded. + * nnspool.el (news-directory, news-path, news-inews-program): + Move here from paths.el. Don't see a need for these to be autoloaded. * gnus.el (gnus-default-nntp-server): Make it a defcustom. Merge in doc from paths.el version. Don't see any need for this to be === modified file 'lisp/gnus/nnspool.el' --- lisp/gnus/nnspool.el 2012-05-24 07:27:24 +0000 +++ lisp/gnus/nnspool.el 2012-05-24 07:31:45 +0000 @@ -40,6 +40,16 @@ "The root directory below which all news files are stored.") (defvaralias 'news-path 'news-directory) +;; Ditto re obsolescence. +(defvar news-inews-program + (cond ((file-exists-p "/usr/bin/inews") "/usr/bin/inews") + ((file-exists-p "/usr/local/inews") "/usr/local/inews") + ((file-exists-p "/usr/local/bin/inews") "/usr/local/bin/inews") + ((file-exists-p "/usr/contrib/lib/news/inews") "/usr/contrib/lib/news/inews") + ((file-exists-p "/usr/lib/news/inews") "/usr/lib/news/inews") + (t "inews")) + "Program to post news.") + (nnoo-declare nnspool) (defvoo nnspool-inews-program news-inews-program === modified file 'lisp/paths.el' --- lisp/paths.el 2012-05-24 07:27:24 +0000 +++ lisp/paths.el 2012-05-24 07:31:45 +0000 @@ -101,16 +101,6 @@ for initializing `Info-directory-list' when Info is started, unless the environment variable INFOPATH is set.") -(defvar news-inews-program - (purecopy - (cond ((file-exists-p "/usr/bin/inews") "/usr/bin/inews") - ((file-exists-p "/usr/local/inews") "/usr/local/inews") - ((file-exists-p "/usr/local/bin/inews") "/usr/local/bin/inews") - ((file-exists-p "/usr/contrib/lib/news/inews") "/usr/contrib/lib/news/inews") - ((file-exists-p "/usr/lib/news/inews") "/usr/lib/news/inews") - (t "inews"))) - "Program to post news.") - (defcustom remote-shell-program (purecopy (cond ------------------------------------------------------------ revno: 108353 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-05-24 00:27:24 -0700 message: * paths.el (news-directory, news-path): Move to gnus/nnspool.el. * gnus/nnspool.el (news-directory, news-path): Move here from paths.el. Don't see a need for these to be autoloaded. This file is the only place that uses them, to init another variable. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-05-24 07:11:19 +0000 +++ lisp/ChangeLog 2012-05-24 07:27:24 +0000 @@ -1,5 +1,7 @@ 2012-05-24 Glenn Morris + * paths.el (news-directory, news-path): Move to gnus/nnspool.el. + * paths.el (gnus-default-nntp-server): Remove (gnus.el defines it). * paths.el (rmail-file-name, rmail-spool-directory): Move from here... === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-05-24 07:11:19 +0000 +++ lisp/gnus/ChangeLog 2012-05-24 07:27:24 +0000 @@ -1,5 +1,8 @@ 2012-05-24 Glenn Morris + * nnspool.el (news-directory, news-path): Move here from paths.el. + Don't see a need for these to be autoloaded. + * gnus.el (gnus-default-nntp-server): Make it a defcustom. Merge in doc from paths.el version. Don't see any need for this to be autoloaded, or for the warning about users not setting it. === modified file 'lisp/gnus/nnspool.el' --- lisp/gnus/nnspool.el 2012-01-19 07:21:25 +0000 +++ lisp/gnus/nnspool.el 2012-05-24 07:27:24 +0000 @@ -31,6 +31,15 @@ (require 'nnoo) (eval-when-compile (require 'cl)) +;; Probably this entire thing should be obsolete. +;; It's only used to init nnspool-spool-directory, so why not just +;; set that variable's default directly? +(defvar news-directory (if (file-exists-p "/usr/spool/news/") + "/usr/spool/news/" + "/var/spool/news/") + "The root directory below which all news files are stored.") +(defvaralias 'news-path 'news-directory) + (nnoo-declare nnspool) (defvoo nnspool-inews-program news-inews-program === modified file 'lisp/paths.el' --- lisp/paths.el 2012-05-24 07:11:19 +0000 +++ lisp/paths.el 2012-05-24 07:27:24 +0000 @@ -101,13 +101,6 @@ for initializing `Info-directory-list' when Info is started, unless the environment variable INFOPATH is set.") -(defvar news-directory - (purecopy (if (file-exists-p "/usr/spool/news/") - "/usr/spool/news/" - "/var/spool/news/")) - "The root directory below which all news files are stored.") -(defvaralias 'news-path 'news-directory) - (defvar news-inews-program (purecopy (cond ((file-exists-p "/usr/bin/inews") "/usr/bin/inews") ------------------------------------------------------------ revno: 108352 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-05-24 00:20:34 -0700 message: Add missing autload pieces needed for rmail-spool-directory's delayed init diff: === modified file 'lisp/mail/rmail.el' --- lisp/mail/rmail.el 2012-05-24 06:53:08 +0000 +++ lisp/mail/rmail.el 2012-05-24 07:20:34 +0000 @@ -149,6 +149,13 @@ :version "21.1") ;;;###autoload +(put 'rmail-spool-directory 'standard-value + '((cond ((file-exists-p "/var/mail") "/var/mail/") + ((file-exists-p "/var/spool/mail") "/var/spool/mail/") + ((memq system-type '(hpux usg-unix-v irix)) "/usr/mail/") + (t "/usr/spool/mail/")))) + +;;;###autoload (defcustom rmail-spool-directory (purecopy (cond ((file-exists-p "/var/mail") @@ -166,6 +173,8 @@ :type 'directory :group 'rmail) +;;;###autoload(custom-initialize-delay 'rmail-spool-directory nil) + (defcustom rmail-movemail-program nil "If non-nil, the file name of the `movemail' program." :group 'rmail-retrieve ------------------------------------------------------------ revno: 108351 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-05-24 00:11:19 -0700 message: No need to define gnus-default-nntp-server in paths.el Don't see a need for this to be autoloaded, since it is only used in gnus.el (in one place, as a fallback). Maybe it should be obsolete? * paths.el (gnus-default-nntp-server): Remove (gnus.el defines it). * gnus/gnus.el (gnus-default-nntp-server): Make it a defcustom. Merge in doc from paths.el version. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-05-24 06:53:08 +0000 +++ lisp/ChangeLog 2012-05-24 07:11:19 +0000 @@ -1,5 +1,7 @@ 2012-05-24 Glenn Morris + * paths.el (gnus-default-nntp-server): Remove (gnus.el defines it). + * paths.el (rmail-file-name, rmail-spool-directory): Move from here... * mail/rmail.el (rmail-file-name, rmail-spool-directory): ... to here. Make the latter a defcustom, with a delayed initialization. === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-05-04 06:13:18 +0000 +++ lisp/gnus/ChangeLog 2012-05-24 07:11:19 +0000 @@ -1,3 +1,9 @@ +2012-05-24 Glenn Morris + + * gnus.el (gnus-default-nntp-server): Make it a defcustom. + Merge in doc from paths.el version. Don't see any need for this to be + autoloaded, or for the warning about users not setting it. + 2012-05-04 Paul Eggert Fix minor Y10k bug. @@ -22655,7 +22661,7 @@ See ChangeLog.2 for earlier changes. - Copyright (C) 2004-2012 Free Software Foundation, Inc. + Copyright (C) 2004-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. === modified file 'lisp/gnus/gnus.el' --- lisp/gnus/gnus.el 2012-04-21 07:55:02 +0000 +++ lisp/gnus/gnus.el 2012-05-24 07:11:19 +0000 @@ -1271,15 +1271,18 @@ :type '(choice (const :tag "current" nil) directory)) -;; Site dependent variables. These variables should be defined in -;; paths.el. - -(defvar gnus-default-nntp-server nil - "Specify a default NNTP server. -This variable should be defined in paths.el, and should never be set -by the user. -If you want to change servers, you should use `gnus-select-method'. -See the documentation to that variable.") +;; Site dependent variables. + +;; Should this be obsolete? +(defcustom gnus-default-nntp-server nil + "The hostname of the default NNTP server. +The empty string, or nil, means to use the local host. +You may wish to set this on a site-wide basis. + +If you want to change servers, you should use `gnus-select-method'." + :group 'gnus-server + :type '(choice (const :tag "local host" nil) + (string :tag "host name"))) (defcustom gnus-nntpserver-file "/etc/nntpserver" "A file with only the name of the nntp server in it." @@ -1326,6 +1329,8 @@ There is a lot more to know about select methods and virtual servers - see the manual for details." + ;; Emacs has set-after since 22.1. + ;set-after '(gnus-default-nntp-server) :group 'gnus-server :group 'gnus-start :initialize 'custom-initialize-default === modified file 'lisp/paths.el' --- lisp/paths.el 2012-05-24 06:53:08 +0000 +++ lisp/paths.el 2012-05-24 07:11:19 +0000 @@ -118,12 +118,6 @@ (t "inews"))) "Program to post news.") -;; set this to your local server -(defvar gnus-default-nntp-server (purecopy "") "\ -The name of the host running an NNTP server. -The null string means use the local host as the server site.") - - (defcustom remote-shell-program (purecopy (cond ------------------------------------------------------------ revno: 108350 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-05-23 23:53:08 -0700 message: Move some rmail variables from paths.el to rmail.el Ref eg http://lists.gnu.org/archive/html/emacs-devel/2004-10/msg00620.html * paths.el (rmail-file-name, rmail-spool-directory): Move from here... * mail/rmail.el (rmail-file-name, rmail-spool-directory): ... to here. Make the latter a defcustom, with a delayed initialization. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-05-24 06:42:26 +0000 +++ lisp/ChangeLog 2012-05-24 06:53:08 +0000 @@ -1,5 +1,9 @@ 2012-05-24 Glenn Morris + * paths.el (rmail-file-name, rmail-spool-directory): Move from here... + * mail/rmail.el (rmail-file-name, rmail-spool-directory): ... to here. + Make the latter a defcustom, with a delayed initialization. + * paths.el (gnus-nntp-service, gnus-local-organization): Remove. These were deleted from Gnus itself late 2010. === modified file 'lisp/mail/rmail.el' --- lisp/mail/rmail.el 2012-05-09 03:06:08 +0000 +++ lisp/mail/rmail.el 2012-05-24 06:53:08 +0000 @@ -100,8 +100,6 @@ "The current header display style choice, one of 'normal (selected headers) or 'full (all headers).") -;; rmail-spool-directory and rmail-file-name are defined in paths.el. - (defgroup rmail nil "Mail reader for Emacs." :group 'mail) @@ -143,6 +141,31 @@ :prefix "rmail-edit-" :group 'rmail) +;;;###autoload +(defcustom rmail-file-name (purecopy "~/RMAIL") + "Name of user's primary mail file." + :type 'string + :group 'rmail + :version "21.1") + +;;;###autoload +(defcustom rmail-spool-directory + (purecopy + (cond ((file-exists-p "/var/mail") + ;; SVR4 and recent BSD are said to use this. + ;; Rather than trying to know precisely which systems use it, + ;; let's assume this dir is never used for anything else. + "/var/mail/") + ;; Many GNU/Linux systems use this name. + ((file-exists-p "/var/spool/mail") "/var/spool/mail/") + ((memq system-type '(hpux usg-unix-v irix)) "/usr/mail/") + (t "/usr/spool/mail/"))) + "Name of directory used by system mailer for delivering new mail. +Its name should end with a slash." + :initialize 'custom-initialize-delay + :type 'directory + :group 'rmail) + (defcustom rmail-movemail-program nil "If non-nil, the file name of the `movemail' program." :group 'rmail-retrieve === modified file 'lisp/paths.el' --- lisp/paths.el 2012-05-24 06:42:26 +0000 +++ lisp/paths.el 2012-05-24 06:53:08 +0000 @@ -123,27 +123,6 @@ The name of the host running an NNTP server. The null string means use the local host as the server site.") -(defcustom rmail-file-name (purecopy "~/RMAIL") "\ -Name of user's primary mail file." - :type 'string - :group 'rmail - :version "21.1") - -(defvar rmail-spool-directory - (purecopy - (cond ((file-exists-p "/var/mail") - ;; SVR4 and recent BSD are said to use this. - ;; Rather than trying to know precisely which systems use it, - ;; let's assume this dir is never used for anything else. - "/var/mail/") - ;; Many GNU/Linux systems use this name. - ((file-exists-p "/var/spool/mail") - "/var/spool/mail/") - ((memq system-type '(hpux usg-unix-v irix)) - "/usr/mail/") - (t "/usr/spool/mail/"))) - "Name of directory used by system mailer for delivering new mail. -Its name should end with a slash.") (defcustom remote-shell-program (purecopy