------------------------------------------------------------ revno: 117079 committer: Sam Steingold branch nick: trunk timestamp: Fri 2014-05-09 13:04:46 -0400 message: Optionally auto-reconnect depending on `rcirc-reconnect-delay'. * net/rcirc.el (rcirc-reconnect-delay): New user option. (rcirc-sentinel): Auto-reconnect to the server if `rcirc-reconnect-delay' is non-0 (but not more often than its value in case the host is off-line). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-09 09:10:56 +0000 +++ lisp/ChangeLog 2014-05-09 17:04:46 +0000 @@ -1,3 +1,10 @@ +2014-05-08 Sam Steingold + + * net/rcirc.el (rcirc-reconnect-delay): New user option. + (rcirc-sentinel): Auto-reconnect to the server if + `rcirc-reconnect-delay' is non-0 (but not more often than its + value in case the host is off-line). + 2014-05-09 Eli Zaretskii * progmodes/grep.el (lgrep): Fix a typo in last commit. === modified file 'lisp/net/rcirc.el' --- lisp/net/rcirc.el 2014-04-09 13:37:49 +0000 +++ lisp/net/rcirc.el 2014-05-09 17:04:46 +0000 @@ -658,6 +658,15 @@ "Hook functions called when the process sentinel is called. Functions are called with PROCESS and SENTINEL arguments.") +(defcustom rcirc-reconnect-delay 0 + "*The minimum interval in seconds between reconnect attempts. +When 0, do not auto-reconnect." + :type 'integer + :group 'rcirc) + +(defvar rcirc-last-connect-time nil + "The last time the buffer was connected.") + (defun rcirc-sentinel (process sentinel) "Called when PROCESS receives SENTINEL." (let ((sentinel (replace-regexp-in-string "\n" "" sentinel))) @@ -671,6 +680,14 @@ sentinel (process-status process)) (not rcirc-target)) (rcirc-disconnect-buffer))) + (when (and (string= sentinel "deleted") + (< 0 rcirc-reconnect-delay)) + (let ((now (current-time))) + (when (or (null rcirc-last-connect-time) + (< rcirc-reconnect-delay + (float-time (time-subtract now rcirc-last-connect-time)))) + (setq sds-rcirc-sentinel-last now) + (rcirc-cmd-reconnect nil)))) (run-hook-with-args 'rcirc-sentinel-functions process sentinel)))) (defun rcirc-disconnect-buffer (&optional buffer) @@ -1007,6 +1024,7 @@ (setq-local fill-paragraph-function 'rcirc-fill-paragraph) (setq-local rcirc-recent-quit-alist nil) (setq-local rcirc-current-line 0) + (setq-local rcirc-last-connect-time (current-time)) (use-hard-newlines t) (setq-local rcirc-short-buffer-name nil) ------------------------------------------------------------ revno: 117078 committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2014-05-09 09:50:14 +0000 message: gnus-art.el: Misc improvements for displaying MIME parts * gnus-art.el (gnus-mm-display-part): Don't put article out of sight while prompting a user for a file name, etc. (gnus-mime-display-single): Display part with a common appearance no matter whether MIME button is omitted or not; don't add duplicate entry to gnus-article-mime-handle-alist. (gnus-mime-buttonize-attachments-in-header): Use copied buttons. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2014-05-08 22:42:13 +0000 +++ lisp/gnus/ChangeLog 2014-05-09 09:50:14 +0000 @@ -1,3 +1,12 @@ +2014-05-09 Katsumi Yamaoka + + * gnus-art.el (gnus-mm-display-part): Don't put article out of sight + while prompting a user for a file name, etc. + (gnus-mime-display-single): Display part with a common appearance no + matter whether MIME button is omitted or not; don't add duplicate entry + to gnus-article-mime-handle-alist. + (gnus-mime-buttonize-attachments-in-header): Use copied buttons. + 2014-05-08 Adam Sjøgren * mml2015.el (mml2015-display-key-image): New variable. === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2014-05-02 09:44:34 +0000 +++ lisp/gnus/gnus-art.el 2014-05-09 09:50:14 +0000 @@ -5693,27 +5693,36 @@ (setq point (previous-single-property-change (next-single-property-change point 'gnus-data) 'gnus-data)) - (forward-line) (if (mm-handle-displayed-p handle) ;; This will remove the part. (setq retval (mm-display-part handle)) - (save-window-excursion - (save-restriction - ;; FIXME: nothing is displayed in the article buffer - ;; while prompting a user for a file name. - (narrow-to-region (point) - (if (eobp) (point) (1+ (point)))) - (gnus-bind-safe-url-regexp - (setq retval (mm-display-part handle))) - ;; We narrow to the part itself and - ;; then call the treatment functions. - (goto-char (point-min)) - (forward-line 1) - (narrow-to-region (point) (point-max)) - (gnus-treat-article - nil id - (gnus-article-mime-total-parts) - (mm-handle-media-type handle)))))) + (let ((part (or (and (mm-inlinable-p handle) + (mm-inlined-p handle) + t) + (with-temp-buffer + (gnus-bind-safe-url-regexp + (setq retval (mm-display-part handle))) + (unless (zerop (buffer-size)) + (buffer-string)))))) + (forward-line) + (cond ((stringp part) + (save-restriction + (narrow-to-region (point) + (progn + (insert part) + (unless (bolp) (insert "\n")) + (point))) + (gnus-treat-article nil id + (gnus-article-mime-total-parts) + (mm-handle-media-type handle)) + (mm-handle-set-undisplayer + handle + `(lambda () + (let ((inhibit-read-only t)) + (delete-region ,(copy-marker (point-min) t) + ,(point-max-marker))))))) + (part + (mm-display-inline handle)))))) (goto-char point) ;; Toggle the button appearance between `[button]...' and `[button]'. (gnus-insert-mime-button handle id (list (mm-handle-displayed-p handle))) @@ -5985,7 +5994,6 @@ (let ((type (mm-handle-media-type handle)) (ignored gnus-ignored-mime-types) (not-attachment t) - (move nil) display text) (catch 'ignored (progn @@ -6011,9 +6019,11 @@ (setq display t) (when (equal (mm-handle-media-supertype handle) "text") (setq text t))) - (let ((id (1+ (length gnus-article-mime-handle-alist))) + (let ((id (car (rassq handle gnus-article-mime-handle-alist))) beg) - (push (cons id handle) gnus-article-mime-handle-alist) + (unless id + (setq id (1+ (length gnus-article-mime-handle-alist))) + (push (cons id handle) gnus-article-mime-handle-alist)) (when (and display (equal (mm-handle-media-supertype handle) "message")) (insert-char @@ -6025,16 +6035,13 @@ (not (gnus-unbuttonized-mime-type-p type)) (eq id gnus-mime-buttonized-part-id)) (gnus-insert-mime-button - handle id (list (or display (and not-attachment text)))) - (gnus-article-insert-newline) - ;; Remember modify the number of forward lines. - (setq move t)) + handle id (list (or display (and not-attachment text))))) + (gnus-article-insert-newline) + (when (or display (and text not-attachment)) + (forward-line -1)) (setq beg (point)) (cond (display - (when move - (forward-line -1) - (setq beg (point))) (let ((mail-parse-charset gnus-newsgroup-charset) (mail-parse-ignored-charsets (save-excursion (condition-case () @@ -6044,9 +6051,6 @@ (gnus-bind-safe-url-regexp (mm-display-part handle t))) (goto-char (point-max))) ((and text not-attachment) - (when move - (forward-line -1) - (setq beg (point))) (gnus-article-insert-newline) (mm-display-inline handle) (goto-char (point-max)))) @@ -6334,7 +6338,7 @@ (setcar handle (caar handle)))) flat) flat)))) - (let ((case-fold-search t) buttons st) + (let ((case-fold-search t) buttons st handle) (save-excursion (save-restriction (widen) @@ -6371,7 +6375,9 @@ (dolist (button (nreverse buttons)) (setq st (point)) (insert " ") - (gnus-insert-mime-button (cdr button) (car button)) + (mm-handle-set-undisplayer + (setq handle (copy-sequence (cdr button))) nil) + (gnus-insert-mime-button handle (car button)) (skip-chars-backward "\t\n ") (delete-region (point) (point-max)) (when (> (current-column) (window-width)) ------------------------------------------------------------ revno: 117077 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2014-05-09 12:10:56 +0300 message: lisp/progmodes/grep.el (lgrep): Fix a typo in last commit. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-09 07:02:00 +0000 +++ lisp/ChangeLog 2014-05-09 09:10:56 +0000 @@ -1,3 +1,7 @@ +2014-05-09 Eli Zaretskii + + * progmodes/grep.el (lgrep): Fix a typo in last commit. + 2014-05-09 Glenn Morris * files.el (file-expand-wildcards): === modified file 'lisp/progmodes/grep.el' --- lisp/progmodes/grep.el 2014-05-09 07:02:00 +0000 +++ lisp/progmodes/grep.el 2014-05-09 09:10:56 +0000 @@ -904,7 +904,7 @@ (confirm (equal current-prefix-arg '(4)))) (list regexp files dir confirm)))))) (when (and (stringp regexp) (> (length regexp) 0)) - (unless (and dir (file-acessible-directory-p dir)) + (unless (and dir (file-accessible-directory-p dir)) (setq dir default-directory)) (let ((command regexp)) (if (null files) ------------------------------------------------------------ revno: 117076 committer: Glenn Morris branch nick: trunk timestamp: Fri 2014-05-09 00:02:00 -0700 message: Use file-accessible-directory-p in some more places * lisp/files.el (file-expand-wildcards): * lisp/man.el (Man-support-local-filenames): * lisp/printing.el (pr-i-directory, pr-interface-directory): * lisp/progmodes/grep.el (lgrep, rgrep): * lisp/textmodes/ispell.el (ispell-call-process) (ispell-call-process-region, ispell-start-process) (ispell-init-process): * lisp/mh-e/mh-e.el (mh-variants): Use file-accessible-directory-p. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-08 03:41:21 +0000 +++ lisp/ChangeLog 2014-05-09 07:02:00 +0000 @@ -1,3 +1,13 @@ +2014-05-09 Glenn Morris + + * files.el (file-expand-wildcards): + * man.el (Man-support-local-filenames): + * printing.el (pr-i-directory, pr-interface-directory): + * progmodes/grep.el (lgrep, rgrep): + * textmodes/ispell.el (ispell-call-process) + (ispell-call-process-region, ispell-start-process) + (ispell-init-process): Use file-accessible-directory-p. + 2014-05-08 Stefan Monnier * xt-mouse.el: Drop spurious/oddly shaped events (bug#17378). === modified file 'lisp/files.el' --- lisp/files.el 2014-04-07 20:54:16 +0000 +++ lisp/files.el 2014-05-09 07:02:00 +0000 @@ -5987,10 +5987,9 @@ (file-expand-wildcards (directory-file-name dirpart))) (list dirpart))) contents) - (while dirs - (when (or (null (car dirs)) ; Possible if DIRPART is not wild. - (and (file-directory-p (directory-file-name (car dirs))) - (file-readable-p (car dirs)))) + (dolist (dir dirs) + (when (or (null dir) ; Possible if DIRPART is not wild. + (file-accessible-directory-p dir)) (let ((this-dir-contents ;; Filter out "." and ".." (delq nil @@ -5998,16 +5997,15 @@ (unless (string-match "\\`\\.\\.?\\'" (file-name-nondirectory name)) name)) - (directory-files (or (car dirs) ".") full + (directory-files (or dir ".") full (wildcard-to-regexp nondir)))))) (setq contents (nconc - (if (and (car dirs) (not full)) - (mapcar (function (lambda (name) (concat (car dirs) name))) + (if (and dir (not full)) + (mapcar #'(lambda (name) (concat dir name)) this-dir-contents) this-dir-contents) - contents)))) - (setq dirs (cdr dirs))) + contents))))) contents))) ;; Let Tramp know that `file-expand-wildcards' does not need an advice. === modified file 'lisp/man.el' --- lisp/man.el 2014-02-10 01:34:22 +0000 +++ lisp/man.el 2014-05-09 07:02:00 +0000 @@ -1,7 +1,6 @@ ;;; man.el --- browse UNIX manual pages -*- coding: utf-8 -*- -;; Copyright (C) 1993-1994, 1996-1997, 2001-2014 Free Software -;; Foundation, Inc. +;; Copyright (C) 1993-1994, 1996-1997, 2001-2014 Free Software Foundation, Inc. ;; Author: Barry A. Warsaw ;; Maintainer: emacs-devel@gnu.org @@ -695,9 +694,8 @@ (with-temp-buffer (let ((default-directory ;; Ensure that `default-directory' exists and is readable. - (if (and (file-directory-p default-directory) - (file-readable-p default-directory)) - default-directory + (if (file-accessible-directory-p default-directory) + default-directory (expand-file-name "~/")))) (ignore-errors (call-process manual-program nil t nil "--help"))) === modified file 'lisp/mh-e/ChangeLog' --- lisp/mh-e/ChangeLog 2014-03-17 00:50:05 +0000 +++ lisp/mh-e/ChangeLog 2014-05-09 07:02:00 +0000 @@ -1,3 +1,7 @@ +2014-05-09 Glenn Morris + + * mh-e.el (mh-variants): Use file-accessible-directory-p. + 2014-03-16 Bill Wohler * mh-folder.el (mh-regenerate-headers): Fix scan: bad message list === modified file 'lisp/mh-e/mh-e.el' --- lisp/mh-e/mh-e.el 2014-02-24 02:04:35 +0000 +++ lisp/mh-e/mh-e.el 2014-05-09 07:02:00 +0000 @@ -1,7 +1,7 @@ ;;; mh-e.el --- GNU Emacs interface to the MH mail system -;; Copyright (C) 1985-1988, 1990, 1992-1995, 1997, 1999-2014 Free -;; Software Foundation, Inc. +;; Copyright (C) 1985-1988, 1990, 1992-1995, 1997, 1999-2014 +;; Free Software Foundation, Inc. ;; Author: Bill Wohler ;; Maintainer: Bill Wohler @@ -739,7 +739,7 @@ (setq dir (file-chase-links (directory-file-name dir))) (add-to-list 'list-unique dir)) (loop for dir in (nreverse list-unique) do - (when (and dir (file-directory-p dir) (file-readable-p dir)) + (when (and dir (file-accessible-directory-p dir)) (let ((variant (mh-variant-info dir))) (if variant (add-to-list 'mh-variants variant))))) === modified file 'lisp/printing.el' --- lisp/printing.el 2014-01-01 07:43:34 +0000 +++ lisp/printing.el 2014-05-09 07:02:00 +0000 @@ -6543,8 +6543,7 @@ (defun pr-i-directory () - (or (and (file-directory-p pr-i-directory) - (file-readable-p pr-i-directory)) + (or (file-accessible-directory-p pr-i-directory) (error "Please specify be a readable directory"))) @@ -6552,8 +6551,7 @@ (and pr-buffer-verbose (message "You can use M-TAB or ESC TAB for file completion")) (let ((dir (widget-value widget))) - (and (file-directory-p dir) - (file-readable-p dir) + (and (file-accessible-directory-p dir) (setq pr-i-directory dir)))) === modified file 'lisp/progmodes/grep.el' --- lisp/progmodes/grep.el 2014-04-12 19:38:06 +0000 +++ lisp/progmodes/grep.el 2014-05-09 07:02:00 +0000 @@ -1,7 +1,6 @@ ;;; grep.el --- run `grep' and display the results -*- lexical-binding:t -*- -;; Copyright (C) 1985-1987, 1993-1999, 2001-2014 Free Software -;; Foundation, Inc. +;; Copyright (C) 1985-1987, 1993-1999, 2001-2014 Free Software Foundation, Inc. ;; Author: Roland McGrath ;; Maintainer: emacs-devel@gnu.org @@ -905,7 +904,7 @@ (confirm (equal current-prefix-arg '(4)))) (list regexp files dir confirm)))))) (when (and (stringp regexp) (> (length regexp) 0)) - (unless (and dir (file-directory-p dir) (file-readable-p dir)) + (unless (and dir (file-acessible-directory-p dir)) (setq dir default-directory)) (let ((command regexp)) (if (null files) @@ -986,7 +985,7 @@ (confirm (equal current-prefix-arg '(4)))) (list regexp files dir confirm)))))) (when (and (stringp regexp) (> (length regexp) 0)) - (unless (and dir (file-directory-p dir) (file-readable-p dir)) + (unless (and dir (file-accessible-directory-p dir)) (setq dir default-directory)) (if (null files) (if (not (string= regexp (if (consp grep-find-command) === modified file 'lisp/textmodes/ispell.el' --- lisp/textmodes/ispell.el 2014-01-31 09:41:54 +0000 +++ lisp/textmodes/ispell.el 2014-05-09 07:02:00 +0000 @@ -931,16 +931,14 @@ (defun ispell-call-process (&rest args) "Like `call-process' but defend against bad `default-directory'." (let ((default-directory default-directory)) - (unless (and (file-directory-p default-directory) - (file-readable-p default-directory)) + (unless (file-accessible-directory-p default-directory) (setq default-directory (expand-file-name "~/"))) (apply 'call-process args))) (defun ispell-call-process-region (&rest args) "Like `call-process-region' but defend against bad `default-directory'." (let ((default-directory default-directory)) - (unless (and (file-directory-p default-directory) - (file-readable-p default-directory)) + (unless (file-accessible-directory-p default-directory) (setq default-directory (expand-file-name "~/"))) (apply 'call-process-region args))) @@ -2939,8 +2937,7 @@ (ispell-hunspell-fill-dictionary-entry ispell-current-dictionary))) (let* ((default-directory - (if (and (file-directory-p default-directory) - (file-readable-p default-directory)) + (if (file-accessible-directory-p default-directory) default-directory ;; Defend against bad `default-directory'. (expand-file-name "~/"))) @@ -2998,8 +2995,7 @@ (if (or ispell-really-aspell ispell-really-hunspell ;; Protect against bad default-directory - (not (and (file-directory-p default-directory) - (file-readable-p default-directory))) + (not (file-accessible-directory-p default-directory)) ;; Ispell and per-dir personal dicts available (not (or (file-readable-p (concat default-directory ".ispell_words"))