Now on revision 111778. ------------------------------------------------------------ revno: 111778 fixes bug: http://debbugs.gnu.org/9276 author: David Biesack committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-02-13 23:50:57 -0800 message: * net/quickurl.el (quickurl-save-urls): Ensure quickurl-urls is not truncated on printing. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-14 05:45:33 +0000 +++ lisp/ChangeLog 2013-02-14 07:50:57 +0000 @@ -1,3 +1,8 @@ +2013-02-14 David Biesack (tiny change) + + * net/quickurl.el (quickurl-save-urls): + Ensure quickurl-urls is not truncated on printing. (Bug#9276) + 2013-02-14 Dmitry Gutov * progmodes/ruby-mode.el (ruby-parse-partial): Don't increase === modified file 'lisp/net/quickurl.el' --- lisp/net/quickurl.el 2013-01-01 09:11:05 +0000 +++ lisp/net/quickurl.el 2013-02-14 07:50:57 +0000 @@ -272,7 +272,8 @@ (defun quickurl-save-urls () "Save the contents of `quickurl-urls' to `quickurl-url-file'." (with-temp-buffer - (let ((standard-output (current-buffer))) + (let ((standard-output (current-buffer)) + (print-length nil)) (princ quickurl-prefix) (pp quickurl-urls) (princ quickurl-postfix) ------------------------------------------------------------ revno: 111777 committer: Dmitry Gutov branch nick: trunk timestamp: Thu 2013-02-14 09:45:33 +0400 message: (ruby-add-log-current-method): Improve performance at the expense of accuracy. `ruby-block-contains-point' is relatively slow, so only use it for method and singleton class blocks. * test/automated/ruby-mode-tests.el (ruby-add-log-current-method-after-inner-class): Lower expectations: move point inside a method, initially. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-14 03:33:55 +0000 +++ lisp/ChangeLog 2013-02-14 05:45:33 +0000 @@ -4,6 +4,9 @@ depth for unfinished percent literal. Not using it in the caller. (ruby-move-to-block): Jump over multiline literals of all types, ignoring code-looking contents inside them. + (ruby-add-log-current-method): Improve performance at the expense + of accuracy. `ruby-block-contains-point' is relatively slow, so + only use it for method and singleton class blocks. 2013-02-13 Michael Albinus === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2013-02-14 03:33:55 +0000 +++ lisp/progmodes/ruby-mode.el 2013-02-14 05:45:33 +0000 @@ -1073,29 +1073,33 @@ See `add-log-current-defun-function'." (condition-case nil (save-excursion - (let ((indent 0) mname mlist - (start (point)) - (definition-re - (concat "^[ \t]*" ruby-defun-beg-re "[ \t]+" - "\\(" - ;; \\. and :: for class methods - "\\([A-Za-z_]" ruby-symbol-re "*\\|\\.\\|::" "\\)" - "+\\)"))) + (let* ((indent 0) mname mlist + (start (point)) + (make-definition-re + (lambda (re) + (concat "^[ \t]*" re "[ \t]+" + "\\(" + ;; \\. and :: for class methods + "\\([A-Za-z_]" ruby-symbol-re "*\\|\\.\\|::" "\\)" + "+\\)"))) + (definition-re (funcall make-definition-re ruby-defun-beg-re)) + (module-re (funcall make-definition-re "\\(class\\|module\\)"))) ;; Get the current method definition (or class/module). (when (re-search-backward definition-re nil t) (goto-char (match-beginning 1)) - (when (ruby-block-contains-point start) - ;; We're inside the method, class or module. - (setq mname (match-string 2)) - (unless (string-equal "def" (match-string 1)) - (setq mlist (list mname) mname nil))) + (if (not (string-equal "def" (match-string 1))) + (setq mlist (list (match-string 2))) + ;; We're inside the method. For classes and modules, + ;; this check is skipped for performance. + (when (ruby-block-contains-point start) + (setq mname (match-string 2)))) (setq indent (current-column)) (beginning-of-line)) ;; Walk up the class/module nesting. (while (and (> indent 0) - (re-search-backward definition-re nil t)) + (re-search-backward module-re nil t)) (goto-char (match-beginning 1)) - (when (ruby-block-contains-point start) + (when (< (current-column) indent) (setq mlist (cons (match-string 2) mlist)) (setq indent (current-column)) (beginning-of-line))) @@ -1121,6 +1125,13 @@ (let ((in-singleton-class (when (re-search-forward ruby-singleton-class-re start t) (goto-char (match-beginning 0)) + ;; FIXME: Optimize it out, too? + ;; This can be slow in a large file, but + ;; unlike class/module declaration + ;; indentations, method definitions can be + ;; intermixed with these, and may or may not + ;; be additionally indented after visibility + ;; keywords. (ruby-block-contains-point start)))) (setq mname (concat (if in-singleton-class "." "#") === modified file 'test/ChangeLog' --- test/ChangeLog 2013-02-14 03:33:55 +0000 +++ test/ChangeLog 2013-02-14 05:45:33 +0000 @@ -4,6 +4,8 @@ (ruby-move-to-block-skips-percent-literal): Add depth-affecting bits inside the examples. (ruby-move-to-block-skips-heredoc): New test. + (ruby-add-log-current-method-after-inner-class): Lower + expectations: move point inside a method, initially. 2013-02-13 Dmitry Gutov === modified file 'test/automated/ruby-mode-tests.el' --- test/automated/ruby-mode-tests.el 2013-02-14 03:33:55 +0000 +++ test/automated/ruby-mode-tests.el 2013-02-14 05:45:33 +0000 @@ -390,11 +390,13 @@ | class C | class D | end - | _ + | def foo + | _ + | end | end |end") (search-backward "_") - (should (string= (ruby-add-log-current-method) "M::C")))) + (should (string= (ruby-add-log-current-method) "M::C#foo")))) (defvar ruby-block-test-example (ruby-test-string ------------------------------------------------------------ revno: 111776 committer: Dmitry Gutov branch nick: trunk timestamp: Thu 2013-02-14 07:33:55 +0400 message: * lisp/progmodes/ruby-mode.el (ruby-parse-partial): Don't increase depth for unfinished percent literal. Not using it in the caller. (ruby-move-to-block): Jump over multiline literals of all types, ignoring code-looking contents inside them. * test/automated/ruby-mode-tests.el (ruby-move-to-block-skips-percent-literal): Add depth-affecting bits inside the examples. (ruby-move-to-block-skips-heredoc): New test. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-13 16:23:15 +0000 +++ lisp/ChangeLog 2013-02-14 03:33:55 +0000 @@ -1,3 +1,10 @@ +2013-02-14 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-parse-partial): Don't increase + depth for unfinished percent literal. Not using it in the caller. + (ruby-move-to-block): Jump over multiline literals of all types, + ignoring code-looking contents inside them. + 2013-02-13 Michael Albinus Use ControlMaster where applicable. (Bug#13677) === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2013-02-13 08:15:05 +0000 +++ lisp/progmodes/ruby-mode.el 2013-02-14 03:33:55 +0000 @@ -519,12 +519,6 @@ (concat "[^\\]\\(\\\\\\\\\\)*" w)) end t))) (setq in-string (point)) - (when (eq (char-syntax (string-to-char w)) ?\() - ;; The rest of the literal, when parsed separately, will - ;; have the depth of -1. So in the rare case when this - ;; number is used despite the in-string status, the - ;; depths will balance. - (setq depth (1+ depth))) (goto-char end))) (t (goto-char pnt)))) @@ -913,10 +907,16 @@ (re-search-forward "^=end\\>")) ((and backward (looking-at "^=end\\>")) (re-search-backward "^=begin\\>")) + ;; Jump over a multiline literal. + ((ruby-in-ppss-context-p 'string) + (goto-char (nth 8 (syntax-ppss))) + (unless backward + (forward-sexp) + (when (bolp) (forward-char -1)))) ; After a heredoc. (t - (incf depth (or (nth 2 (ruby-parse-region (point) - (line-end-position))) - 0)) + (let ((state (ruby-parse-region (point) (line-end-position)))) + (unless (car state) ; Line ends with unfinished string. + (setq depth (+ (nth 2 state) depth)))) (cond ;; Deeper indentation, we found a block. ;; FIXME: We can't recognize empty blocks this way. === modified file 'test/ChangeLog' --- test/ChangeLog 2013-02-13 08:15:05 +0000 +++ test/ChangeLog 2013-02-14 03:33:55 +0000 @@ -1,3 +1,10 @@ +2013-02-14 Dmitry Gutov + + * automated/ruby-mode-tests.el + (ruby-move-to-block-skips-percent-literal): Add depth-affecting + bits inside the examples. + (ruby-move-to-block-skips-heredoc): New test. + 2013-02-13 Dmitry Gutov * automated/ruby-mode-tests.el === modified file 'test/automated/ruby-mode-tests.el' --- test/automated/ruby-mode-tests.el 2013-02-13 08:15:05 +0000 +++ test/automated/ruby-mode-tests.el 2013-02-14 03:33:55 +0000 @@ -449,20 +449,37 @@ (dolist (s (list (ruby-test-string "foo do | a = %%w( + | def yaa | ) |end") (ruby-test-string "foo do | a = %%w| + | end | | |end"))) (ruby-with-temp-buffer s (goto-line 1) (ruby-end-of-block) - (should (= 4 (line-number-at-pos))) + (should (= 5 (line-number-at-pos))) (ruby-beginning-of-block) (should (= 1 (line-number-at-pos)))))) +(ert-deftest ruby-move-to-block-skips-heredoc () + (ruby-with-temp-buffer + (ruby-test-string + "if something_wrong? + | ActiveSupport::Deprecation.warn(<<-eowarn) + | boo hoo + | end + | eowarn + |end") + (goto-line 1) + (ruby-end-of-block) + (should (= 6 (line-number-at-pos))) + (ruby-beginning-of-block) + (should (= 1 (line-number-at-pos))))) + (provide 'ruby-mode-tests) ;;; ruby-mode-tests.el ends here ------------------------------------------------------------ revno: 111775 committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2013-02-14 00:44:38 +0000 message: gnus-util.el (gnus-define-keys): Convert [?\S-\ ] to [(shift space)] for XEmacs diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-02-13 08:28:47 +0000 +++ lisp/gnus/ChangeLog 2013-02-14 00:44:38 +0000 @@ -1,3 +1,8 @@ +2013-02-14 Katsumi Yamaoka + + * gnus-util.el (gnus-define-keys): Convert [?\S-\ ] to [(shift space)] + for XEmacs. + 2013-02-13 Juri Linkov * gnus-art.el (gnus-article-mode-map): === modified file 'lisp/gnus/gnus-util.el' --- lisp/gnus/gnus-util.el 2013-01-02 16:13:04 +0000 +++ lisp/gnus/gnus-util.el 2013-02-14 00:44:38 +0000 @@ -333,6 +333,13 @@ (defmacro gnus-define-keys (keymap &rest plist) "Define all keys in PLIST in KEYMAP." + ;; Convert the key [?\S-\ ] to [(shift space)] for XEmacs. + (when (featurep 'xemacs) + (let ((bindings plist)) + (while bindings + (when (equal (car bindings) [?\S-\ ]) + (setcar bindings [(shift space)])) + (setq bindings (cddr bindings))))) `(gnus-define-keys-1 (quote ,keymap) (quote ,plist))) (defmacro gnus-define-keys-safe (keymap &rest plist) ------------------------------------------------------------ revno: 111774 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-02-13 14:43:06 -0500 message: * src/keyboard.c (syms_of_keyboard): Further tweaks of docstring. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-02-13 07:14:38 +0000 +++ src/ChangeLog 2013-02-13 19:43:06 +0000 @@ -1,3 +1,7 @@ +2013-02-13 Stefan Monnier + + * keyboard.c (syms_of_keyboard): Further tweaks of docstring. + 2013-02-13 Dmitry Antipov * font.c (font_range): Add pos_byte argument. Adjust comment === modified file 'src/keyboard.c' --- src/keyboard.c 2013-02-13 04:31:09 +0000 +++ src/keyboard.c 2013-02-13 19:43:06 +0000 @@ -11630,8 +11630,8 @@ DEFVAR_LISP ("key-translation-map", Vkey_translation_map, doc: /* Keymap of key translations that can override keymaps. -This keymap works like `function-key-map', but comes after that, -and its non-prefix bindings override ordinary bindings. */); +This keymap works like `input-decode-map', but comes after `function-key-map'. +Another difference is that it is global rather than terminal-local. */); Vkey_translation_map = Fmake_sparse_keymap (Qnil); DEFVAR_LISP ("deferred-action-list", Vdeferred_action_list, ------------------------------------------------------------ revno: 111773 committer: Michael Albinus + + Use ControlMaster where applicable. (Bug#13677) + + * net/tramp.el (tramp-ssh-controlmaster-template): New defvar, + replacing `tramp-detect-ssh-controlmaster'. + (tramp-default-method): Use it. + + * net/tramp-sh.el (tramp-methods) [scp, scp1, scp2, scpx, sftp]: + [rsync, ssh, ssh1, ssh2, sshx]: Add ControlPath and ControlMaster + arguments. + [scpc, rsyncc]: Remove methods. + (top): Remove completion functions for "scpc", "rsyncc", "ssh1_old" + and "ssh2_old". + (tramp-do-copy-or-rename-file-out-of-band): Change trace level. + (tramp-maybe-open-connection): Reuse tmpfile for ControlPath. + 2013-02-13 Stefan Monnier * emacs-lisp/package.el (package--initialized): Move before first use. === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2013-02-12 14:35:10 +0000 +++ lisp/net/tramp-sh.el 2013-02-13 16:23:15 +0000 @@ -109,31 +109,36 @@ (tramp-copy-keep-date t))) ;;;###tramp-autoload (add-to-list 'tramp-methods - '("scp" - (tramp-login-program "ssh") - (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h"))) - (tramp-async-args (("-q"))) - (tramp-remote-shell "/bin/sh") - (tramp-remote-shell-args ("-c")) - (tramp-copy-program "scp") - (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r"))) - (tramp-copy-keep-date t) - (tramp-copy-recursive t) - (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") - ("-o" "UserKnownHostsFile=/dev/null") - ("-o" "StrictHostKeyChecking=no"))) - (tramp-default-port 22))) + `("scp" + (tramp-login-program "ssh") + (tramp-login-args (("-l" "%u") ("-p" "%p") + ,tramp-ssh-controlmaster-template + ("-e" "none") ("%h"))) + (tramp-async-args (("-q"))) + (tramp-remote-shell "/bin/sh") + (tramp-remote-shell-args ("-c")) + (tramp-copy-program "scp") + (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r") + ,tramp-ssh-controlmaster-template)) + (tramp-copy-keep-date t) + (tramp-copy-recursive t) + (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") + ("-o" "UserKnownHostsFile=/dev/null") + ("-o" "StrictHostKeyChecking=no"))) + (tramp-default-port 22))) ;;;###tramp-autoload (add-to-list 'tramp-methods - '("scp1" + `("scp1" (tramp-login-program "ssh") (tramp-login-args (("-l" "%u") ("-p" "%p") + ,tramp-ssh-controlmaster-template ("-1") ("-e" "none") ("%h"))) (tramp-async-args (("-q"))) (tramp-remote-shell "/bin/sh") (tramp-remote-shell-args ("-c")) (tramp-copy-program "scp") - (tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k") ("-q") ("-r"))) + (tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k") ("-q") ("-r") + ,tramp-ssh-controlmaster-template)) (tramp-copy-keep-date t) (tramp-copy-recursive t) (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") @@ -142,15 +147,17 @@ (tramp-default-port 22))) ;;;###tramp-autoload (add-to-list 'tramp-methods - '("scp2" + `("scp2" (tramp-login-program "ssh") (tramp-login-args (("-l" "%u") ("-p" "%p") + ,tramp-ssh-controlmaster-template ("-2") ("-e" "none") ("%h"))) (tramp-async-args (("-q"))) (tramp-remote-shell "/bin/sh") (tramp-remote-shell-args ("-c")) (tramp-copy-program "scp") - (tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k") ("-q") ("-r"))) + (tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k") ("-q") ("-r") + ,tramp-ssh-controlmaster-template)) (tramp-copy-keep-date t) (tramp-copy-recursive t) (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") @@ -159,72 +166,41 @@ (tramp-default-port 22))) ;;;###tramp-autoload (add-to-list 'tramp-methods - '("scpc" + `("scpx" (tramp-login-program "ssh") (tramp-login-args (("-l" "%u") ("-p" "%p") - ("-o" "ControlPath=%t.%%r@%%h:%%p") - ("-o" "ControlMaster=yes") - ("-e" "none") ("%h"))) + ,tramp-ssh-controlmaster-template + ("-e" "none") ("-t" "-t") ("%h") ("/bin/sh"))) (tramp-async-args (("-q"))) (tramp-remote-shell "/bin/sh") (tramp-remote-shell-args ("-c")) (tramp-copy-program "scp") (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r") - ("-o" "ControlPath=%t.%%r@%%h:%%p") - ("-o" "ControlMaster=auto"))) - (tramp-copy-keep-date t) - (tramp-copy-recursive t) - (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") - ("-o" "UserKnownHostsFile=/dev/null") - ("-o" "StrictHostKeyChecking=no"))) - (tramp-default-port 22))) -;;;###tramp-autoload -(add-to-list 'tramp-methods - '("scpx" - (tramp-login-program "ssh") - (tramp-login-args (("-l" "%u") ("-p" "%p") - ("-e" "none") ("-t" "-t") - ("%h") ("/bin/sh"))) - (tramp-async-args (("-q"))) - (tramp-remote-shell "/bin/sh") - (tramp-remote-shell-args ("-c")) - (tramp-copy-program "scp") - (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r"))) - (tramp-copy-keep-date t) - (tramp-copy-recursive t) - (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") - ("-o" "UserKnownHostsFile=/dev/null") - ("-o" "StrictHostKeyChecking=no"))) - (tramp-default-port 22))) -;;;###tramp-autoload -(add-to-list 'tramp-methods - '("sftp" - (tramp-login-program "ssh") - (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h"))) - (tramp-async-args (("-q"))) - (tramp-remote-shell "/bin/sh") - (tramp-remote-shell-args ("-c")) - (tramp-copy-program "sftp"))) -;;;###tramp-autoload -(add-to-list 'tramp-methods - '("rsync" - (tramp-login-program "ssh") - (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h"))) - (tramp-async-args (("-q"))) - (tramp-remote-shell "/bin/sh") - (tramp-remote-shell-args ("-c")) - (tramp-copy-program "rsync") - (tramp-copy-args (("-e" "ssh") ("-t" "%k") ("-r"))) - (tramp-copy-keep-date t) - (tramp-copy-keep-tmpfile t) - (tramp-copy-recursive t))) -;;;###tramp-autoload -(add-to-list 'tramp-methods - `("rsyncc" - (tramp-login-program "ssh") - (tramp-login-args (("-l" "%u") ("-p" "%p") - ("-o" "ControlPath=%t.%%r@%%h:%%p") - ("-o" "ControlMaster=yes") + ,tramp-ssh-controlmaster-template)) + (tramp-copy-keep-date t) + (tramp-copy-recursive t) + (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") + ("-o" "UserKnownHostsFile=/dev/null") + ("-o" "StrictHostKeyChecking=no"))) + (tramp-default-port 22))) +;;;###tramp-autoload +(add-to-list 'tramp-methods + `("sftp" + (tramp-login-program "ssh") + (tramp-login-args (("-l" "%u") ("-p" "%p") + ,tramp-ssh-controlmaster-template + ("-e" "none") ("%h"))) + (tramp-async-args (("-q"))) + (tramp-remote-shell "/bin/sh") + (tramp-remote-shell-args ("-c")) + (tramp-copy-program "sftp") + (tramp-copy-args ,tramp-ssh-controlmaster-template))) + ;;;###tramp-autoload +(add-to-list 'tramp-methods + `("rsync" + (tramp-login-program "ssh") + (tramp-login-args (("-l" "%u") ("-p" "%p") + ,tramp-ssh-controlmaster-template ("-e" "none") ("%h"))) (tramp-async-args (("-q"))) (tramp-remote-shell "/bin/sh") @@ -232,10 +208,11 @@ (tramp-copy-program "rsync") (tramp-copy-args (("-t" "%k") ("-r"))) (tramp-copy-env (("RSYNC_RSH") - (,(concat - "ssh" - " -o ControlPath=%t.%%r@%%h:%%p" - " -o ControlMaster=auto")))) + (,(mapconcat + 'identity + (append + '("ssh") tramp-ssh-controlmaster-template) + " ")))) (tramp-copy-keep-date t) (tramp-copy-keep-tmpfile t) (tramp-copy-recursive t))) @@ -255,9 +232,11 @@ (tramp-remote-shell-args ("-c")))) ;;;###tramp-autoload (add-to-list 'tramp-methods - '("ssh" + `("ssh" (tramp-login-program "ssh") - (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h"))) + (tramp-login-args (("-l" "%u") ("-p" "%p") + ,tramp-ssh-controlmaster-template + ("-e" "none") ("%h"))) (tramp-async-args (("-q"))) (tramp-remote-shell "/bin/sh") (tramp-remote-shell-args ("-c")) @@ -267,9 +246,10 @@ (tramp-default-port 22))) ;;;###tramp-autoload (add-to-list 'tramp-methods - '("ssh1" + `("ssh1" (tramp-login-program "ssh") (tramp-login-args (("-l" "%u") ("-p" "%p") + ,tramp-ssh-controlmaster-template ("-1") ("-e" "none") ("%h"))) (tramp-async-args (("-q"))) (tramp-remote-shell "/bin/sh") @@ -280,9 +260,10 @@ (tramp-default-port 22))) ;;;###tramp-autoload (add-to-list 'tramp-methods - '("ssh2" + `("ssh2" (tramp-login-program "ssh") (tramp-login-args (("-l" "%u") ("-p" "%p") + ,tramp-ssh-controlmaster-template ("-2") ("-e" "none") ("%h"))) (tramp-async-args (("-q"))) (tramp-remote-shell "/bin/sh") @@ -293,11 +274,11 @@ (tramp-default-port 22))) ;;;###tramp-autoload (add-to-list 'tramp-methods - '("sshx" + `("sshx" (tramp-login-program "ssh") (tramp-login-args (("-l" "%u") ("-p" "%p") - ("-e" "none") ("-t" "-t") - ("%h") ("/bin/sh"))) + ,tramp-ssh-controlmaster-template + ("-e" "none") ("-t" "-t") ("%h") ("/bin/sh"))) (tramp-async-args (("-q"))) (tramp-remote-shell "/bin/sh") (tramp-remote-shell-args ("-c")) @@ -473,21 +454,14 @@ (tramp-set-completion-function "scp" tramp-completion-function-alist-ssh) (tramp-set-completion-function "scp1" tramp-completion-function-alist-ssh) (tramp-set-completion-function "scp2" tramp-completion-function-alist-ssh) - (tramp-set-completion-function "scpc" tramp-completion-function-alist-ssh) (tramp-set-completion-function "scpx" tramp-completion-function-alist-ssh) (tramp-set-completion-function "sftp" tramp-completion-function-alist-ssh) (tramp-set-completion-function "rsync" tramp-completion-function-alist-ssh) - (tramp-set-completion-function - "rsyncc" tramp-completion-function-alist-ssh) (tramp-set-completion-function "rsh" tramp-completion-function-alist-rsh) (tramp-set-completion-function "remsh" tramp-completion-function-alist-rsh) (tramp-set-completion-function "ssh" tramp-completion-function-alist-ssh) (tramp-set-completion-function "ssh1" tramp-completion-function-alist-ssh) (tramp-set-completion-function "ssh2" tramp-completion-function-alist-ssh) - (tramp-set-completion-function - "ssh1_old" tramp-completion-function-alist-ssh) - (tramp-set-completion-function - "ssh2_old" tramp-completion-function-alist-ssh) (tramp-set-completion-function "sshx" tramp-completion-function-alist-ssh) (tramp-set-completion-function "telnet" tramp-completion-function-alist-telnet) @@ -2419,7 +2393,7 @@ v "process-buffer" (current-buffer)) (while copy-env (tramp-message - orig-vec 5 "%s=\"%s\"" (car copy-env) (cadr copy-env)) + orig-vec 6 "%s=\"%s\"" (car copy-env) (cadr copy-env)) (setenv (pop copy-env) (pop copy-env))) ;; Use an asynchronous process. By this, password can @@ -4478,14 +4452,16 @@ ;; temporary file has another name, and it is ;; created and protected by ssh. It is also ;; removed by ssh when the connection is - ;; closed. + ;; closed. The temporary file name is cached + ;; in the main connection process, therefore + ;; we cannot use `tramp-get-connection-process'. (tmpfile - (tramp-set-connection-property - p "temp-file" - (make-temp-name - (expand-file-name - tramp-temp-name-prefix - (tramp-compat-temporary-file-directory))))) + (with-tramp-connection-property + (get-process (tramp-buffer-name vec)) "temp-file" + (make-temp-name + (expand-file-name + tramp-temp-name-prefix + (tramp-compat-temporary-file-directory))))) spec r-shell) ;; Add arguments for asynchronous processes. === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2013-02-03 16:49:37 +0000 +++ lisp/net/tramp.el 2013-02-13 16:23:15 +0000 @@ -280,15 +280,18 @@ `localhost' or the name of the local host. Another host name is useful only in combination with `tramp-default-proxies-alist'.") -(defun tramp-detect-ssh-controlmaster () - "Call ssh to detect whether it supports the ControlMaster argument. -This function may return nil when the argument is supported, but -shouldn't return t when it isn't." - (ignore-errors - (with-temp-buffer - (call-process "ssh" nil t nil "-o" "ControlMaster") - (goto-char (point-min)) - (search-forward-regexp "Missing ControlMaster argument" nil t)))) +;;;###tramp-autoload +(defvar tramp-ssh-controlmaster-template + (ignore-errors + (with-temp-buffer + (call-process "ssh" nil t nil "-o" "ControlMaster") + (goto-char (point-min)) + (when (search-forward-regexp "Missing ControlMaster argument" nil t) + '("-o" "ControlPath=%t.%%r@%%h:%%p" + "-o" "ControlMaster=auto" + "-o" "ControlPersist=no")))) + "Call ssh to detect whether it supports the ControlMaster argument. +Return a template to be used in `tramp-methods'.") (defcustom tramp-default-method ;; An external copy method seems to be preferred, because it performs @@ -297,8 +300,9 @@ ;; permanent password queries. Either a password agent like ;; "ssh-agent" or "Pageant" shall run, or the optional ;; password-cache.el or auth-sources.el packages shall be active for - ;; password caching. "scpc" is chosen if we detect that the user is - ;; running OpenSSH 4.0 or newer. + ;; password caching. If we detect that the user is running OpenSSH + ;; 4.0 or newer, we could reuse the connection, which calls also for + ;; an external method. (cond ;; PuTTY is installed. We don't take it, if it is installed on a ;; non-windows system, or pscp from the pssh (parallel ssh) package @@ -314,16 +318,16 @@ "plink")) ;; There is an ssh installation. ((executable-find "scp") - (cond - ((tramp-detect-ssh-controlmaster) "scpc") - ((or (fboundp 'password-read) - (fboundp 'auth-source-user-or-password) - (fboundp 'auth-source-search) - ;; ssh-agent is running. - (getenv "SSH_AUTH_SOCK") - (getenv "SSH_AGENT_PID")) - "scp") - (t "ssh"))) + (if (or (fboundp 'password-read) + (fboundp 'auth-source-user-or-password) + (fboundp 'auth-source-search) + ;; ssh-agent is running. + (getenv "SSH_AUTH_SOCK") + (getenv "SSH_AGENT_PID") + ;; We could reuse the connection. + tramp-ssh-controlmaster-template) + "scp" + "ssh")) ;; Fallback. (t "ftp")) "Default method to use for transferring files. ------------------------------------------------------------ revno: 111772 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-02-13 11:02:35 -0500 message: * lisp/emacs-lisp/package.el (package--initialized): Move before first use. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-13 15:13:22 +0000 +++ lisp/ChangeLog 2013-02-13 16:02:35 +0000 @@ -1,3 +1,7 @@ +2013-02-13 Stefan Monnier + + * emacs-lisp/package.el (package--initialized): Move before first use. + 2013-02-13 Jambunathan K * icomplete.el (icomplete-hide-common-prefix): New user option. === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2013-02-13 05:00:45 +0000 +++ lisp/emacs-lisp/package.el 2013-02-13 16:02:35 +0000 @@ -735,6 +735,8 @@ (package--with-work-buffer location file (package-unpack name version)))) +(defvar package--initialized nil) + (defun package-installed-p (package &optional min-version) "Return true if PACKAGE, of MIN-VERSION or newer, is installed. MIN-VERSION should be a version list." @@ -896,8 +898,6 @@ package-user-dir) (package-activate elt (version-to-list v-string))))) -(defvar package--initialized nil) - ;;;###autoload (defun package-install (name) "Install the package named NAME. ------------------------------------------------------------ revno: 111771 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12638 author: Jambunathan K committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-02-13 10:13:22 -0500 message: * lisp/icomplete.el (icomplete-hide-common-prefix): New user option. (icomplete-first-match): New face. (icomplete-completions): Correct handling of "complete but not unique". diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-13 14:54:59 +0000 +++ lisp/ChangeLog 2013-02-13 15:13:22 +0000 @@ -1,3 +1,10 @@ +2013-02-13 Jambunathan K + + * icomplete.el (icomplete-hide-common-prefix): New user option. + (icomplete-first-match): New face. + (icomplete-completions): Correct handling of "complete but not + unique" (Bug#12638). + 2013-02-13 YE Qianchuan (tiny change) * descr-text.el (describe-char): Display the script (bug#13698). === modified file 'lisp/icomplete.el' --- lisp/icomplete.el 2013-02-08 07:53:55 +0000 +++ lisp/icomplete.el 2013-02-13 15:13:22 +0000 @@ -76,6 +76,18 @@ :type 'string :version "24.4") +(defcustom icomplete-hide-common-prefix t + "When non-nil, hide common prefix from completion candidates. +When nil, show candidates in full." + :type 'boolean + :version "24.4" + :group 'icomplete) + +(defface icomplete-first-match '((t :weight bold)) + "Face used by icomplete for highlighting first match." + :version "24.4" + :group 'icomplete) + ;;;_* User Customization variables (defcustom icomplete-prospects-height ;; 20 is an estimated common size for the prompt + minibuffer content, to @@ -344,7 +356,8 @@ (t (concat "…" (substring most compare)))) close-bracket))) ;;"-prospects" - more than one candidate - (prospects-len (+ (length determ) + (prospects-len (+ (string-width + (or determ (concat open-bracket close-bracket))) (string-width icomplete-separator) 3 ;; take {…} into account (string-width (buffer-string)))) @@ -355,6 +368,8 @@ ;; one line, increase the allowable space accordingly. (/ prospects-len (window-width))) (window-width))) + (prefix (when icomplete-hide-common-prefix + (try-completion "" comps))) (prefix-len ;; Find the common prefix among `comps'. ;; We can't use the optimization below because its assumptions @@ -364,37 +379,55 @@ ;; ;; Common case. ;; (length most) ;; Else, use try-completion. - (let ((comps-prefix (try-completion "" comps))) - (and (stringp comps-prefix) - (length comps-prefix)))) ;;) - - prospects most-is-exact comp limit) + (and (stringp prefix) (length prefix))) ;;) + prospects comp limit) (if (eq most-try t) ;; (or (null (cdr comps)) (setq prospects nil) + (when (member name comps) + ;; NAME is complete but not unique. This scenario poses + ;; following UI issues: + ;; + ;; - When `icomplete-hide-common-prefix' is non-nil, NAME + ;; is stripped empty. This would make the entry + ;; inconspicuous. + ;; + ;; - Due to sorting of completions, NAME may not be the + ;; first of the prospects and could be hidden deep in + ;; the displayed string. + ;; + ;; - Because of `icomplete-prospects-height' , NAME may + ;; not even be displayed to the user. + ;; + ;; To circumvent all the above problems, provide a visual + ;; cue to the user via an "empty string" in the try + ;; completion field. + (setq determ (concat open-bracket "" close-bracket))) + ;; Compute prospects for display. (while (and comps (not limit)) (setq comp (if prefix-len (substring (car comps) prefix-len) (car comps)) comps (cdr comps)) - (cond ((string-equal comp "") (setq most-is-exact t)) - ((member comp prospects)) - (t (setq prospects-len + (setq prospects-len (+ (string-width comp) (string-width icomplete-separator) prospects-len)) (if (< prospects-len prospects-max) (push comp prospects) - (setq limit t)))))) + (setq limit t)))) + (setq prospects (nreverse prospects)) + ;; Decorate first of the prospects. + (when prospects + (let ((first (copy-sequence (pop prospects)))) + (put-text-property 0 (length first) + 'face 'icomplete-first-match first) + (push first prospects))) ;; Restore the base-size info, since completion-all-sorted-completions ;; is cached. (if last (setcdr last base-size)) (if prospects (concat determ "{" - (and most-is-exact - (substring icomplete-separator - (string-match "[^ ]" icomplete-separator))) - (mapconcat 'identity (nreverse prospects) - icomplete-separator) + (mapconcat 'identity prospects icomplete-separator) (and limit (concat icomplete-separator "…")) "}") (concat determ " [Matched]")))))) ------------------------------------------------------------ revno: 111770 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13698 author: YE Qianchuan committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-02-13 09:54:59 -0500 message: * lisp/descr-text.el (describe-char): Display the script. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-13 13:40:00 +0000 +++ lisp/ChangeLog 2013-02-13 14:54:59 +0000 @@ -1,3 +1,7 @@ +2013-02-13 YE Qianchuan (tiny change) + + * descr-text.el (describe-char): Display the script (bug#13698). + 2013-02-13 Stefan Monnier * tmm.el: Use lexical-binding and current-active-maps. === modified file 'lisp/descr-text.el' --- lisp/descr-text.el 2013-01-02 16:13:04 +0000 +++ lisp/descr-text.el 2013-02-13 14:54:59 +0000 @@ -574,6 +574,9 @@ 'help-echo "mouse-2, RET: show this character in its character set") str))) + ,@(let ((script (aref char-script-table char))) + (if script + (list (list "script" (symbol-name script))))) ("syntax" ,(let ((syntax (syntax-after pos))) (with-temp-buffer ------------------------------------------------------------ revno: 111769 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-02-13 08:40:00 -0500 message: * lisp/tmm.el: Use lexical-binding and current-active-maps. (tmm-menubar): Use map-keymap and pcase. (tmm--completion-table): New function. (tmm-prompt): Use it to fix the menu order. (tmm-get-keybind): Use current-active-maps. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-13 09:42:31 +0000 +++ lisp/ChangeLog 2013-02-13 13:40:00 +0000 @@ -1,3 +1,11 @@ +2013-02-13 Stefan Monnier + + * tmm.el: Use lexical-binding and current-active-maps. + (tmm-menubar): Use map-keymap and pcase. + (tmm--completion-table): New function. + (tmm-prompt): Use it to fix the menu order. + (tmm-get-keybind): Use current-active-maps. + 2013-02-12 Christopher Schmidt Add dired-hide-details-mode. (Bug#6799) === modified file 'lisp/tmm.el' --- lisp/tmm.el 2013-01-01 09:11:05 +0000 +++ lisp/tmm.el 2013-02-13 13:40:00 +0000 @@ -1,4 +1,4 @@ -;;; tmm.el --- text mode access to menu-bar +;;; tmm.el --- text mode access to menu-bar -*- lexical-binding: t -*- ;; Copyright (C) 1994-1996, 2000-2013 Free Software Foundation, Inc. @@ -54,36 +54,37 @@ (interactive) (run-hooks 'menu-bar-update-hook) ;; Obey menu-bar-final-items; put those items last. - (let ((menu-bar (tmm-get-keybind [menu-bar])) + (let ((menu-bar '()) + (menu-end '()) menu-bar-item) - (let ((list menu-bar-final-items)) - (while list - (let ((item (car list))) - ;; ITEM is the name of an item that we want to put last. - ;; Find it in MENU-BAR and move it to the end. - (let ((this-one (assq item menu-bar))) - (setq menu-bar (append (delq this-one menu-bar) - (list this-one))))) - (setq list (cdr list)))) + (map-keymap + (lambda (key binding) + (push (cons key binding) + ;; If KEY is the name of an item that we want to put last, + ;; move it to the end. + (if (memq key menu-bar-final-items) + menu-end + menu-bar))) + (tmm-get-keybind [menu-bar])) + (setq menu-bar `(keymap ,@(nreverse menu-bar) ,@(nreverse menu-end))) (if x-position - (let ((tail menu-bar) (column 0) - this-one name visible) - (while (and tail (<= column x-position)) - (setq this-one (car tail)) - (if (and (consp this-one) - (consp (cdr this-one)) - (setq name ;simple menu - (cond ((stringp (nth 1 this-one)) - (nth 1 this-one)) - ;extended menu - ((stringp (nth 2 this-one)) - (setq visible (plist-get - (nthcdr 4 this-one) :visible)) - (unless (and visible (not (eval visible))) - (nth 2 this-one)))))) - (setq column (+ column (length name) 1))) - (setq tail (cdr tail))) - (setq menu-bar-item (car this-one)))) + (let ((column 0)) + (catch 'done + (map-keymap + (lambda (key binding) + (when (> column x-position) + (setq menu-bar-item key) + (throw 'done nil)) + (pcase binding + ((or `(,(and (pred stringp) name) . ,_) ;Simple menu item. + `(menu-item ,name ,_cmd ;Extended menu item. + . ,(and props + (guard (let ((visible + (plist-get props :visible))) + (or (null visible) + (eval visible))))))) + (setq column (+ column (length name) 1))))) + menu-bar)))) (tmm-prompt menu-bar nil menu-bar-item))) ;;;###autoload @@ -138,6 +139,12 @@ "Face used for inactive menu items." :group 'tmm) +(defun tmm--completion-table (items) + (lambda (string pred action) + (if (eq action 'metadata) + '(metadata (display-sort-function . identity)) + (complete-with-action action items string pred)))) + ;;;###autoload (defun tmm-prompt (menu &optional in-popup default-item) "Text-mode emulation of calling the bindings in keymap. @@ -174,6 +181,7 @@ ((vectorp elt) (dotimes (i (length elt)) (tmm-get-keymap (cons i (aref elt i)) not-menu)))))) + (setq tmm-km-list (nreverse tmm-km-list)) ;; Choose an element of tmm-km-list; put it in choice. (if (and not-menu (= 1 (length tmm-km-list))) ;; If this is the top-level of an x-popup-menu menu, @@ -226,7 +234,7 @@ (completing-read (concat gl-str " (up/down to change, PgUp to menu): ") - tmm-km-list nil t nil + (tmm--completion-table tmm-km-list) nil t nil (cons 'history (- (* 2 history-len) index-of-default)))))))) (setq choice (cdr (assoc out tmm-km-list))) @@ -497,46 +505,7 @@ we merge them into a single keymap which shows the proper order of the menu. However, for the menu bar itself, the value does not take account of `menu-bar-final-items'." - (let (allbind bind minorbind localbind globalbind) - (setq bind (key-binding keyseq)) - ;; If KEYSEQ is a prefix key, then BIND is either nil - ;; or a symbol defined as a keymap (which satisfies keymapp). - (if (keymapp bind) - (setq bind nil)) - ;; If we have a non-keymap definition, return that. - (or bind - (progn - ;; Otherwise, it is a prefix, so make a list of the subcommands. - ;; Make a list of all the bindings in all the keymaps. - ;; FIXME: we'd really like to just use `key-binding' now that it - ;; returns a keymap that contains really all the bindings under that - ;; prefix, but `keyseq' is always [menu-bar], so the desired order of - ;; the bindings is difficult to recover. - (setq minorbind (mapcar 'cdr (minor-mode-key-binding keyseq))) - (setq localbind (local-key-binding keyseq)) - (setq globalbind (copy-sequence (cdr (global-key-binding keyseq)))) - - ;; If items have been redefined/undefined locally, remove them from - ;; the global list. - (dolist (minor minorbind) - (dolist (item (cdr minor)) - (setq globalbind (assq-delete-all (car-safe item) globalbind)))) - (dolist (item (cdr localbind)) - (setq globalbind (assq-delete-all (car-safe item) globalbind))) - - (setq globalbind (cons 'keymap globalbind)) - (setq allbind (cons globalbind (cons localbind minorbind))) - - ;; Merge all the elements of ALLBIND into one keymap. - (dolist (in allbind) - (if (and (symbolp in) (keymapp in)) - (setq in (symbol-function in))) - (and in (keymapp in) - (setq bind (if (keymapp bind) - (nconc bind (copy-sequence (cdr in))) - (copy-sequence in))))) - ;; Return that keymap. - bind)))) + (lookup-key (cons 'keymap (nreverse (current-active-maps))) keyseq)) (provide 'tmm) ------------------------------------------------------------ revno: 111768 fixes bug: http://debbugs.gnu.org/6799 committer: Christopher Schmidt branch nick: trunk timestamp: Wed 2013-02-13 10:42:31 +0100 message: Add dired-hide-details-mode. (Bug#6799) * locate.el (locate-mode): Set parent mode property to dired-mode. * find-dired.el (find-dired): Call dired-insert-set-properties on initial information line. Set process mark on end of buffer. (find-dired-sentinel): Call dired-insert-set-properties on summary. * dired.el (dired-hide-details-hide-symlink-targets) (dired-hide-details-hide-information-lines): New options. (dired-insert-directory): Set properties after final treatment of output. (dired-insert-set-properties): Set dired-hide-details-* properties. (dired-mode-map): Bind dired-hide-details-mode. (dired-mode): Set buffer-invisibility-spec to a list. (dired-next-line): Skip hidden lines. (dired-previous-line): Use dired-next-line. (dired-hide-details-mode): New minor mode. (dired-hide-details-update-invisibility-spec): New function. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-02-13 08:50:44 +0000 +++ etc/NEWS 2013-02-13 09:42:31 +0000 @@ -120,6 +120,10 @@ *** Support for ISO 8601 dates. +** Dired + +*** New minor mode `dired-hide-details-mode' hides details. + ** ERC *** New option `erc-accidental-paste-threshold-seconds'. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-13 08:50:44 +0000 +++ lisp/ChangeLog 2013-02-13 09:42:31 +0000 @@ -1,3 +1,27 @@ +2013-02-12 Christopher Schmidt + + Add dired-hide-details-mode. (Bug#6799) + + * locate.el (locate-mode): Set parent mode property to dired-mode. + + * find-dired.el (find-dired): Call dired-insert-set-properties on + initial information line. Set process mark on end of buffer. + (find-dired-sentinel): + Call dired-insert-set-properties on summary. + + * dired.el (dired-hide-details-hide-symlink-targets) + (dired-hide-details-hide-information-lines): New options. + (dired-insert-directory): + Set properties after final treatment of output. + (dired-insert-set-properties): + Set dired-hide-details-* properties. + (dired-mode-map): Bind dired-hide-details-mode. + (dired-mode): Set buffer-invisibility-spec to a list. + (dired-next-line): Skip hidden lines. + (dired-previous-line): Use dired-next-line. + (dired-hide-details-mode): New minor mode. + (dired-hide-details-update-invisibility-spec): New function. + 2013-02-13 Glenn Morris * play/yow.el: Move to obsolete/. (Bug#9384) === modified file 'lisp/dired.el' --- lisp/dired.el 2013-02-09 05:09:02 +0000 +++ lisp/dired.el 2013-02-13 09:42:31 +0000 @@ -230,6 +230,18 @@ :version "22.1" :group 'dired) +(defcustom dired-hide-details-hide-symlink-targets t + "If non-nil, `dired-hide-details-mode' hides symbolic link targets." + :type 'boolean + :version "24.4" + :group 'dired) + +(defcustom dired-hide-details-hide-information-lines t + "Non-nil means hide lines other than header and file/dir lines." + :type 'boolean + :version "24.4" + :group 'dired) + ;; Internal variables (defvar dired-marker-char ?* ; the answer is 42 @@ -1196,7 +1208,6 @@ ;; Note: adjust dired-build-subdir-alist if you change this. (setq dir (replace-regexp-in-string "\\\\" "\\\\" dir nil t) dir (replace-regexp-in-string "\n" "\\n" dir nil t))) - (dired-insert-set-properties opoint (point)) ;; If we used --dired and it worked, the lines are already indented. ;; Otherwise, indent them. (unless (save-excursion @@ -1205,18 +1216,21 @@ (let ((indent-tabs-mode nil)) (indent-rigidly opoint (point) 2))) ;; Insert text at the beginning to standardize things. - (save-excursion - (goto-char opoint) - (if (and (or hdr wildcard) - (not (and (looking-at "^ \\(.*\\):$") - (file-name-absolute-p (match-string 1))))) + (let ((content-point opoint)) + (save-excursion + (goto-char opoint) + (when (and (or hdr wildcard) + (not (and (looking-at "^ \\(.*\\):$") + (file-name-absolute-p (match-string 1))))) ;; Note that dired-build-subdir-alist will replace the name ;; by its expansion, so it does not matter whether what we insert ;; here is fully expanded, but it should be absolute. - (insert " " (directory-file-name (file-name-directory dir)) ":\n")) - (when wildcard - ;; Insert "wildcard" line where "total" line would be for a full dir. - (insert " wildcard " (file-name-nondirectory dir) "\n"))))) + (insert " " (directory-file-name (file-name-directory dir)) ":\n") + (setq content-point (point))) + (when wildcard + ;; Insert "wildcard" line where "total" line would be for a full dir. + (insert " wildcard " (file-name-nondirectory dir) "\n"))) + (dired-insert-set-properties content-point (point))))) (defun dired-insert-set-properties (beg end) "Add various text properties to the lines in the region." @@ -1224,15 +1238,24 @@ (goto-char beg) (while (< (point) end) (condition-case nil - (if (dired-move-to-filename) - (add-text-properties - (point) - (save-excursion - (dired-move-to-end-of-filename) - (point)) - '(mouse-face highlight - dired-filename t - help-echo "mouse-2: visit this file in other window"))) + (if (not (dired-move-to-filename)) + (put-text-property (line-beginning-position) + (1+ (line-end-position)) + 'invisible 'dired-hide-details-information) + (put-text-property (+ (line-beginning-position) 1) (1- (point)) + 'invisible 'dired-hide-details-detail) + (add-text-properties + (point) + (progn + (dired-move-to-end-of-filename) + (point)) + '(mouse-face + highlight + dired-filename t + help-echo "mouse-2: visit this file in other window")) + (when (< (+ (point) 4) (line-end-position)) + (put-text-property (+ (point) 4) (line-end-position) + 'invisible 'dired-hide-details-link))) (error nil)) (forward-line 1)))) @@ -1496,6 +1519,7 @@ ;; hiding (define-key map "$" 'dired-hide-subdir) (define-key map "\M-$" 'dired-hide-all) + (define-key map "(" 'dired-hide-details-mode) ;; isearch (define-key map (kbd "M-s a C-s") 'dired-do-isearch) (define-key map (kbd "M-s a M-C-s") 'dired-do-isearch-regexp) @@ -1586,6 +1610,10 @@ '(menu-item "Toggle Image Thumbnails in This Buffer" image-dired-dired-toggle-marked-thumbs :help "Add or remove image thumbnails in front of marked file names")) + (define-key map [menu-bar immediate hide-details] + '(menu-item "Hide Details" dired-hide-details-mode + :help "Hide details in buffer" + :button (:toggle . dired-hide-details-mode))) (define-key map [menu-bar immediate revert-buffer] '(menu-item "Refresh" revert-buffer :help "Update contents of shown directories")) @@ -1914,6 +1942,9 @@ selective-display t ; for subdirectory hiding mode-line-buffer-identification (propertized-buffer-identification "%17b")) + ;; Ignore dired-hide-details-* value of invisible text property by default. + (when (eq buffer-invisibility-spec t) + (setq buffer-invisibility-spec (list t))) (set (make-local-variable 'revert-buffer-function) (function dired-revert)) (set (make-local-variable 'buffer-stale-function) @@ -1978,15 +2009,20 @@ "Move down lines then position at filename. Optional prefix ARG says how many lines to move; default is one line." (interactive "p") - (forward-line arg) + (let ((line-move-visual) + (goal-column)) + (line-move arg t)) + ;; We never want to move point into an invisible line. + (while (and (invisible-p (point)) + (not (if (and arg (< arg 0)) (bobp) (eobp)))) + (forward-char (if (and arg (< arg 0)) -1 1))) (dired-move-to-filename)) (defun dired-previous-line (arg) "Move up lines then position at filename. Optional prefix ARG says how many lines to move; default is one line." (interactive "p") - (forward-line (- arg)) - (dired-move-to-filename)) + (dired-next-line (- (or arg 1)))) (defun dired-next-dirline (arg &optional opoint) "Goto ARG'th next directory file line." @@ -2230,6 +2266,40 @@ (substring file (match-end 0)) file)) +;;; Minor mode for hiding details +;;;###autoload +(define-minor-mode dired-hide-details-mode + "Hide details in `dired-mode'." + :group 'dired + (unless (derived-mode-p 'dired-mode) + (error "Not a Dired buffer")) + (dired-hide-details-update-invisibility-spec) + (if dired-hide-details-mode + (add-hook 'wdired-mode-hook + 'dired-hide-details-update-invisibility-spec + nil + t) + (remove-hook 'wdired-mode-hook + 'dired-hide-details-update-invisibility-spec + t))) + +(defun dired-hide-details-update-invisibility-spec () + (funcall (if dired-hide-details-mode + 'add-to-invisibility-spec + 'remove-from-invisibility-spec) + 'dired-hide-details-detail) + (funcall (if (and dired-hide-details-mode + dired-hide-details-hide-information-lines) + 'add-to-invisibility-spec + 'remove-from-invisibility-spec) + 'dired-hide-details-information) + (funcall (if (and dired-hide-details-mode + dired-hide-details-hide-symlink-targets + (not (derived-mode-p 'wdired-mode))) + 'add-to-invisibility-spec + 'remove-from-invisibility-spec) + 'dired-hide-details-link)) + ;;; Functions for finding the file name in a dired buffer line. (defvar dired-permission-flags-regexp === modified file 'lisp/find-dired.el' --- lisp/find-dired.el 2013-01-01 09:11:05 +0000 +++ lisp/find-dired.el 2013-02-13 09:42:31 +0000 @@ -210,13 +210,15 @@ (insert " " dir ":\n") ;; Make second line a ``find'' line in analogy to the ``total'' or ;; ``wildcard'' line. - (insert " " args "\n") + (let ((point (point))) + (insert " " args "\n") + (dired-insert-set-properties point (point))) (setq buffer-read-only t) (let ((proc (get-buffer-process (current-buffer)))) (set-process-filter proc (function find-dired-filter)) (set-process-sentinel proc (function find-dired-sentinel)) ;; Initialize the process marker; it is used by the filter. - (move-marker (process-mark proc) 1 (current-buffer))) + (move-marker (process-mark proc) (point) (current-buffer))) (setq mode-line-process '(":%s")))) (defun kill-find () @@ -337,10 +339,11 @@ (let ((buffer-read-only nil)) (save-excursion (goto-char (point-max)) - (insert "\n find " state) - (forward-char -1) ;Back up before \n at end of STATE. - (insert " at " (substring (current-time-string) 0 19)) - (forward-char 1) + (let ((point (point))) + (insert "\n find " state) + (forward-char -1) ;Back up before \n at end of STATE. + (insert " at " (substring (current-time-string) 0 19)) + (dired-insert-set-properties point (point))) (setq mode-line-process (concat ":" (symbol-name (process-status proc)))) === modified file 'lisp/locate.el' --- lisp/locate.el 2013-01-01 09:11:05 +0000 +++ lisp/locate.el 2013-02-13 09:42:31 +0000 @@ -496,6 +496,7 @@ (setq revert-buffer-function 'locate-update) (set (make-local-variable 'page-delimiter) "\n\n") (run-mode-hooks 'locate-mode-hook)) +(put 'locate-mode 'derived-mode-parent 'dired-mode) (defun locate-do-setup (search-string) (goto-char (point-min)) ------------------------------------------------------------ revno: 111767 fixes bug: http://debbugs.gnu.org/9384 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-02-13 00:50:44 -0800 message: Make yow.el obsolete * lisp/play/yow.el: Move to obsolete/. * doc/emacs/ack.texi (Acknowledgments): Don't mention yow any more. * doc/misc/message.texi (News Headers): Don't mention yow any more. * etc/NEWS: Mention this. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2013-02-13 00:42:56 +0000 +++ doc/emacs/ChangeLog 2013-02-13 08:50:44 +0000 @@ -1,3 +1,7 @@ +2013-02-13 Glenn Morris + + * ack.texi (Acknowledgments): Don't mention yow any more. + 2013-02-13 Paul Eggert * cmdargs.texi (General Variables): === modified file 'doc/emacs/ack.texi' --- doc/emacs/ack.texi 2013-02-12 17:36:54 +0000 +++ doc/emacs/ack.texi 2013-02-13 08:50:44 +0000 @@ -811,9 +811,8 @@ Common Lisp code; @file{ebuff-menu.el}, an ``electric'' browser for buffer listings; @file{ehelp.el}, bindings for browsing help screens; @file{rfc822.el}, a parser for E-mail addresses in the RFC-822 format, -used in mail messages and news articles; @file{terminal.el}, a -terminal emulator for Emacs subprocesses; and @file{yow.el}, an -essential utility. +used in mail messages and news articles; and @file{terminal.el}, a +terminal emulator for Emacs subprocesses. @item Gerd Moellmann was the Emacs maintainer from the beginning of Emacs 21 === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2013-02-09 23:17:05 +0000 +++ doc/misc/ChangeLog 2013-02-13 08:50:44 +0000 @@ -1,3 +1,7 @@ +2013-02-13 Glenn Morris + + * message.texi (News Headers): Don't mention yow any more. + 2013-02-09 Jay Belanger * calc.texi (Basic Operations on Units): === modified file 'doc/misc/message.texi' --- doc/misc/message.texi 2013-02-12 17:36:54 +0000 +++ doc/misc/message.texi 2013-02-13 08:50:44 +0000 @@ -1817,17 +1817,14 @@ unlikely that you should need to fiddle with this variable at all. @end table -@findex yow @cindex Mime-Version In addition, you can enter conses into this list. The @sc{car} of this cons should be a symbol. This symbol's name is the name of the header, and the @sc{cdr} can either be a string to be entered verbatim as the value of this header, or it can be a function to be called. This function should -return a string to be inserted. For instance, if you want to insert -@code{Mime-Version: 1.0}, you should enter @code{(Mime-Version . "1.0")} -into the list. If you want to insert a funny quote, you could enter -something like @code{(X-Yow . yow)} into the list. The function -@code{yow} will then be called without any arguments. +take no arguments, and return a string to be inserted. For +instance, if you want to insert @code{Mime-Version: 1.0}, you should +enter @code{(Mime-Version . "1.0")} into the list. If the list contains a cons where the @sc{car} of the cons is @code{optional}, the @sc{cdr} of this cons will only be inserted if it is === modified file 'etc/NEWS' --- etc/NEWS 2013-02-13 04:31:09 +0000 +++ etc/NEWS 2013-02-13 08:50:44 +0000 @@ -201,6 +201,9 @@ *** terminal.el is obsolete; use term.el instead. ++++ +*** yow.el is obsolete; use fortune.el or cookie1.el instead. + * New Modes and Packages in Emacs 24.4 ** New nadvice.el package offering lighter-weight advice facilities. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-13 08:41:56 +0000 +++ lisp/ChangeLog 2013-02-13 08:50:44 +0000 @@ -1,3 +1,7 @@ +2013-02-13 Glenn Morris + + * play/yow.el: Move to obsolete/. (Bug#9384) + 2013-02-13 Juri Linkov * vc/ediff-util.el (ediff-recenter): Use `select-frame-set-input-focus' === renamed file 'lisp/play/yow.el' => 'lisp/obsolete/yow.el' --- lisp/play/yow.el 2013-01-01 09:11:05 +0000 +++ lisp/obsolete/yow.el 2013-02-13 08:50:44 +0000 @@ -5,6 +5,7 @@ ;; Maintainer: FSF ;; Author: Richard Mlynarik ;; Keywords: games +;; Obsolete-since: 24.4 ;; This file is part of GNU Emacs. @@ -24,6 +25,8 @@ ;;; Commentary: ;; Important pinheadery for GNU Emacs. +;; This file is obsolete. For similar functionality, see +;; fortune.el and cookie1.el. ;;; Code: ------------------------------------------------------------ revno: 111766 fixes bug: http://debbugs.gnu.org/12218 committer: Juri Linkov branch nick: trunk timestamp: Wed 2013-02-13 10:41:56 +0200 message: * vc/ediff-util.el (ediff-recenter): Use `select-frame-set-input-focus' to select `ediff-control-frame' and set input focus correctly on Xfce. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-13 08:28:47 +0000 +++ lisp/ChangeLog 2013-02-13 08:41:56 +0000 @@ -1,5 +1,11 @@ 2013-02-13 Juri Linkov + * vc/ediff-util.el (ediff-recenter): Use `select-frame-set-input-focus' + to select `ediff-control-frame' and set input focus correctly on Xfce. + (Bug#12218) + +2013-02-13 Juri Linkov + * image-mode.el (image-mode-map): * doc-view.el (doc-view-mode-map): * vc/ediff-util.el (ediff-setup-keymap): === modified file 'lisp/vc/ediff-util.el' --- lisp/vc/ediff-util.el 2013-02-13 08:28:47 +0000 +++ lisp/vc/ediff-util.el 2013-02-13 08:41:56 +0000 @@ -787,7 +787,12 @@ (frame-live-p ediff-control-frame) (not ediff-use-long-help-message) (not (ediff-frame-iconified-p ediff-control-frame))) - (raise-frame ediff-control-frame)) + (if (fboundp 'select-frame-set-input-focus) + (select-frame-set-input-focus ediff-control-frame) + (raise-frame ediff-control-frame) + (select-frame ediff-control-frame) + (if (fboundp 'focus-frame) + (focus-frame ediff-control-frame)))) ;; Redisplay whatever buffers are showing, if there is a selected difference (let ((control-frame ediff-control-frame) ------------------------------------------------------------ revno: 111765 fixes bug: http://debbugs.gnu.org/2145 committer: Juri Linkov branch nick: trunk timestamp: Wed 2013-02-13 10:28:47 +0200 message: Add more keymaps where S-SPC scrolls in the opposite direction to SPC. * lisp/image-mode.el (image-mode-map): * lisp/doc-view.el (doc-view-mode-map): * lisp/vc/ediff-util.el (ediff-setup-keymap): Make S-SPC scroll in the opposite sense to SPC. * lisp/gnus/gnus-art.el (gnus-article-mode-map): * lisp/gnus/gnus-sum.el (gnus-summary-mode-map, gnus-summary-article-map): Make S-SPC scroll in the opposite sense to SPC. (Bug#2145) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-13 08:15:05 +0000 +++ lisp/ChangeLog 2013-02-13 08:28:47 +0000 @@ -1,3 +1,10 @@ +2013-02-13 Juri Linkov + + * image-mode.el (image-mode-map): + * doc-view.el (doc-view-mode-map): + * vc/ediff-util.el (ediff-setup-keymap): + Make S-SPC scroll in the opposite sense to SPC. (Bug#2145) + 2013-02-13 Dmitry Gutov * progmodes/ruby-mode.el (ruby-move-to-block): Improve === modified file 'lisp/doc-view.el' --- lisp/doc-view.el 2013-02-12 11:53:34 +0000 +++ lisp/doc-view.el 2013-02-13 08:28:47 +0000 @@ -390,6 +390,7 @@ (define-key map [remap forward-page] 'doc-view-next-page) (define-key map [remap backward-page] 'doc-view-previous-page) (define-key map (kbd "SPC") 'doc-view-scroll-up-or-next-page) + (define-key map (kbd "S-SPC") 'doc-view-scroll-down-or-previous-page) (define-key map (kbd "DEL") 'doc-view-scroll-down-or-previous-page) (define-key map (kbd "C-n") 'doc-view-next-line-or-next-page) (define-key map (kbd "") 'doc-view-next-line-or-next-page) === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-02-10 01:56:25 +0000 +++ lisp/gnus/ChangeLog 2013-02-13 08:28:47 +0000 @@ -1,3 +1,9 @@ +2013-02-13 Juri Linkov + + * gnus-art.el (gnus-article-mode-map): + * gnus-sum.el (gnus-summary-mode-map, gnus-summary-article-map): + Make S-SPC scroll in the opposite sense to SPC. (Bug#2145) + 2013-02-10 Katsumi Yamaoka * nnir.el ("nnir"): Add 'virtual ability to nnir backend. (This was === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2013-01-11 10:40:54 +0000 +++ lisp/gnus/gnus-art.el 2013-02-13 08:28:47 +0000 @@ -4361,6 +4361,7 @@ (gnus-define-keys gnus-article-mode-map " " gnus-article-goto-next-page + [?\S-\ ] gnus-article-goto-prev-page "\177" gnus-article-goto-prev-page [delete] gnus-article-goto-prev-page [backspace] gnus-article-goto-prev-page === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2013-01-21 22:07:34 +0000 +++ lisp/gnus/gnus-sum.el 2013-02-13 08:28:47 +0000 @@ -1819,6 +1819,7 @@ (gnus-define-keys gnus-summary-mode-map " " gnus-summary-next-page + [?\S-\ ] gnus-summary-prev-page "\177" gnus-summary-prev-page [delete] gnus-summary-prev-page [backspace] gnus-summary-prev-page @@ -2058,6 +2059,7 @@ (gnus-define-keys (gnus-summary-article-map "A" gnus-summary-mode-map) " " gnus-summary-next-page "n" gnus-summary-next-page + [?\S-\ ] gnus-summary-prev-page "\177" gnus-summary-prev-page [delete] gnus-summary-prev-page "p" gnus-summary-prev-page === modified file 'lisp/image-mode.el' --- lisp/image-mode.el 2013-01-19 15:22:38 +0000 +++ lisp/image-mode.el 2013-02-13 08:28:47 +0000 @@ -337,6 +337,7 @@ (set-keymap-parent map special-mode-map) (define-key map "\C-c\C-c" 'image-toggle-display) (define-key map (kbd "SPC") 'image-scroll-up) + (define-key map (kbd "S-SPC") 'image-scroll-down) (define-key map (kbd "DEL") 'image-scroll-down) (define-key map (kbd "RET") 'image-toggle-animation) (define-key map "n" 'image-next-file) === modified file 'lisp/vc/ediff-util.el' --- lisp/vc/ediff-util.el 2013-01-02 16:13:04 +0000 +++ lisp/vc/ediff-util.el 2013-02-13 08:28:47 +0000 @@ -143,6 +143,7 @@ 'ediff-previous-difference nil)) ;; must come after C-h, or else C-h wipes out backspace's binding in XEmacs (define-key ediff-mode-map [backspace] 'ediff-previous-difference) + (define-key ediff-mode-map [?\S-\ ] 'ediff-previous-difference) (define-key ediff-mode-map "n" 'ediff-next-difference) (define-key ediff-mode-map " " 'ediff-next-difference) (define-key ediff-mode-map "j" 'ediff-jump-to-difference) ------------------------------------------------------------ revno: 111764 committer: Dmitry Gutov branch nick: trunk timestamp: Wed 2013-02-13 12:15:05 +0400 message: * lisp/progmodes/ruby-mode.el (ruby-move-to-block): Improve performance. Instead of recalculating indentation fully for each line, sum up indentation depth based only on visited lines. (ruby-parse-partial): Increase the depth after "do" even when END is right after it. (ruby-parse-partial): When END is in the middle of a percent literal, increase the depth if the delimiter chars belong to the paren syntax class. * test/automated/ruby-mode-tests.el (ruby-move-to-block-skips-percent-literal): New test. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-13 08:10:41 +0000 +++ lisp/ChangeLog 2013-02-13 08:15:05 +0000 @@ -1,3 +1,14 @@ +2013-02-13 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-move-to-block): Improve + performance. Instead of recalculating indentation fully for each + line, sum up indentation depth based only on visited lines. + (ruby-parse-partial): Increase the depth after "do" even when END + is right after it. + (ruby-parse-partial): When END is in the middle of a percent + literal, increase the depth if the delimiter chars belong to the + paren syntax class. + 2013-02-13 Kirill A. Korinskiy * play/fortune.el (fortune-compile): Also make the compiled file === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2013-01-28 02:07:42 +0000 +++ lisp/progmodes/ruby-mode.el 2013-02-13 08:15:05 +0000 @@ -519,6 +519,12 @@ (concat "[^\\]\\(\\\\\\\\\\)*" w)) end t))) (setq in-string (point)) + (when (eq (char-syntax (string-to-char w)) ?\() + ;; The rest of the literal, when parsed separately, will + ;; have the depth of -1. So in the rare case when this + ;; number is used despite the in-string status, the + ;; depths will balance. + (setq depth (1+ depth))) (goto-char end))) (t (goto-char pnt)))) @@ -595,8 +601,7 @@ (not (or (eq ?_ w) (eq ?. w))))) (goto-char pnt) - (setq w (char-after (point))) - (not (eq ?! w)) + (not (eq ?! (char-after (point)))) (skip-chars-forward " \t") (goto-char (match-beginning 0)) (or (not (looking-at ruby-modifier-re)) @@ -877,11 +882,15 @@ (defun ruby-move-to-block (n) "Move to the beginning (N < 0) or the end (N > 0) of the current block, a sibling block, or an outer block. Do that (abs N) times." - (let ((orig (point)) - (start (ruby-calculate-indent)) - (signum (if (> n 0) 1 -1)) + (let ((signum (if (> n 0) 1 -1)) (backward (< n 0)) - down pos done) + (depth (or (nth 2 (ruby-parse-region (line-beginning-position) + (line-end-position))) + 0)) + down done) + (when (< (* depth signum) 0) + ;; Moving end -> end or beginning -> beginning. + (setq depth 0)) (dotimes (_ (abs n)) (setq done nil) (setq down (save-excursion @@ -905,17 +914,19 @@ ((and backward (looking-at "^=end\\>")) (re-search-backward "^=begin\\>")) (t - (setq pos (ruby-calculate-indent)) + (incf depth (or (nth 2 (ruby-parse-region (point) + (line-end-position))) + 0)) (cond ;; Deeper indentation, we found a block. ;; FIXME: We can't recognize empty blocks this way. - ((< start pos) + ((> (* signum depth) 0) (setq down t)) ;; Block found, and same indentation as when started, stop. - ((and down (= pos start)) + ((and down (zerop depth)) (setq done t)) ;; Shallower indentation, means outer block, can stop now. - ((> start pos) + ((< (* signum depth) 0) (setq done t))))) (if done (save-excursion === modified file 'test/ChangeLog' --- test/ChangeLog 2013-02-04 12:02:25 +0000 +++ test/ChangeLog 2013-02-13 08:15:05 +0000 @@ -1,3 +1,8 @@ +2013-02-13 Dmitry Gutov + + * automated/ruby-mode-tests.el + (ruby-move-to-block-skips-percent-literal): New test. + 2013-02-04 Chong Yidong * automated/thingatpt.el: New file. === modified file 'test/automated/ruby-mode-tests.el' --- test/automated/ruby-mode-tests.el 2013-01-28 01:20:42 +0000 +++ test/automated/ruby-mode-tests.el 2013-02-13 08:15:05 +0000 @@ -445,6 +445,24 @@ (ruby-move-to-block -2) (should (= 2 (line-number-at-pos)))) +(ert-deftest ruby-move-to-block-skips-percent-literal () + (dolist (s (list (ruby-test-string + "foo do + | a = %%w( + | ) + |end") + (ruby-test-string + "foo do + | a = %%w| + | | + |end"))) + (ruby-with-temp-buffer s + (goto-line 1) + (ruby-end-of-block) + (should (= 4 (line-number-at-pos))) + (ruby-beginning-of-block) + (should (= 1 (line-number-at-pos)))))) + (provide 'ruby-mode-tests) ;;; ruby-mode-tests.el ends here ------------------------------------------------------------ revno: 111763 fixes bug: http://debbugs.gnu.org/5338 author: Kirill A. Korinskiy committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-02-13 00:10:41 -0800 message: fortune-compile tiny change * lisp/play/fortune.el (fortune-compile): Also make the compiled file if it does not exist at all, not just if it is old. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-13 05:00:45 +0000 +++ lisp/ChangeLog 2013-02-13 08:10:41 +0000 @@ -1,3 +1,8 @@ +2013-02-13 Kirill A. Korinskiy + + * play/fortune.el (fortune-compile): Also make the compiled file + if it does not exist at all, not just if it is old. (Bug#5338) + 2013-02-13 Glenn Morris * emacs-lisp/package.el (package-menu-execute): Doc fix. === modified file 'lisp/play/fortune.el' --- lisp/play/fortune.el 2013-01-01 09:11:05 +0000 +++ lisp/play/fortune.el 2013-02-13 08:10:41 +0000 @@ -244,15 +244,17 @@ (let* ((fortune-file (expand-file-name (substitute-in-file-name file))) (fortune-dat (expand-file-name (substitute-in-file-name - (concat fortune-file fortune-database-extension))))) - (cond ((file-exists-p fortune-file) - (if (file-exists-p fortune-dat) - (cond ((file-newer-than-file-p fortune-file fortune-dat) - (message "Compiling new fortune database %s" fortune-dat) - (shell-command - (concat fortune-strfile fortune-strfile-options - " " fortune-file fortune-quiet-strfile-options)))))) - (t (error "Can't compile fortune file %s" fortune-file))))) + (concat fortune-file fortune-database-extension)))) + (fortune-dat-exist (file-exists-p fortune-dat))) + (cond ((file-exists-p fortune-file) + (if (or (not fortune-dat-exist) + (and fortune-dat-exist + (file-newer-than-file-p fortune-file fortune-dat))) + (message "Compiling new fortune database %s" fortune-dat) + (shell-command + (concat fortune-strfile fortune-strfile-options + " " fortune-file fortune-quiet-strfile-options)))) + (t (error "Can't compile fortune file %s" fortune-file))))) ;;; ************** ------------------------------------------------------------ revno: 111762 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2013-02-13 11:14:38 +0400 message: * font.c (font_range): Add pos_byte argument. Adjust comment and break long line. * font.h (font_range): Adjust prototype. * composite.c (autocmp_chars): Pass byte position to font_range. Break long line. Remove useless prototype and format comment. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-02-13 04:31:09 +0000 +++ src/ChangeLog 2013-02-13 07:14:38 +0000 @@ -1,3 +1,11 @@ +2013-02-13 Dmitry Antipov + + * font.c (font_range): Add pos_byte argument. Adjust comment + and break long line. + * font.h (font_range): Adjust prototype. + * composite.c (autocmp_chars): Pass byte position to font_range. + Break long line. Remove useless prototype and format comment. + 2013-02-13 Glenn Morris * keyboard.c (input-decode-map, key-translation-map): Doc fixes. === modified file 'src/composite.c' --- src/composite.c 2013-02-08 05:28:52 +0000 +++ src/composite.c 2013-02-13 07:14:38 +0000 @@ -642,13 +642,7 @@ Qcomposition, prop, string); } - -static Lisp_Object autocmp_chars (Lisp_Object, ptrdiff_t, ptrdiff_t, - ptrdiff_t, struct window *, - struct face *, Lisp_Object); - - -/* Lisp glyph-string handlers */ +/* Lisp glyph-string handlers. */ /* Hash table for automatic composition. The key is a header of a lgstring (Lispy glyph-string), and the value is a body of a @@ -905,7 +899,9 @@ object. Otherwise return nil. */ static Lisp_Object -autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t limit, struct window *win, struct face *face, Lisp_Object string) +autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos, + ptrdiff_t limit, struct window *win, struct face *face, + Lisp_Object string) { ptrdiff_t count = SPECPDL_INDEX (); FRAME_PTR f = XFRAME (win->frame); @@ -935,7 +931,7 @@ #ifdef HAVE_WINDOW_SYSTEM if (FRAME_WINDOW_P (f)) { - font_object = font_range (charpos, &to, win, face, string); + font_object = font_range (charpos, bytepos, &to, win, face, string); if (! FONT_OBJECT_P (font_object) || (! NILP (re) && to < limit === modified file 'src/font.c' --- src/font.c 2013-02-13 04:31:09 +0000 +++ src/font.c 2013-02-13 07:14:38 +0000 @@ -3689,11 +3689,11 @@ #ifdef HAVE_WINDOW_SYSTEM -/* Check how many characters after POS (at most to *LIMIT) can be - displayed by the same font in the window W. FACE, if non-NULL, is - the face selected for the character at POS. If STRING is not nil, - it is the string to check instead of the current buffer. In that - case, FACE must be not NULL. +/* Check how many characters after character/byte position POS/POS_BYTE + (at most to *LIMIT) can be displayed by the same font in the window W. + FACE, if non-NULL, is the face selected for the character at POS. + If STRING is not nil, it is the string to check instead of the current + buffer. In that case, FACE must be not NULL. The return value is the font-object for the character at POS. *LIMIT is set to the position where that font can't be used. @@ -3701,15 +3701,15 @@ It is assured that the current buffer (or STRING) is multibyte. */ Lisp_Object -font_range (ptrdiff_t pos, ptrdiff_t *limit, struct window *w, struct face *face, Lisp_Object string) +font_range (ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t *limit, + struct window *w, struct face *face, Lisp_Object string) { - ptrdiff_t pos_byte, ignore; + ptrdiff_t ignore; int c; Lisp_Object font_object = Qnil; if (NILP (string)) { - pos_byte = CHAR_TO_BYTE (pos); if (! face) { int face_id; @@ -3720,10 +3720,7 @@ } } else - { - eassert (face); - pos_byte = string_char_to_byte (string, pos); - } + eassert (face); while (pos < *limit) { === modified file 'src/font.h' --- src/font.h 2013-01-01 09:11:05 +0000 +++ src/font.h 2013-02-13 07:14:38 +0000 @@ -781,7 +781,7 @@ extern void register_font_driver (struct font_driver *driver, FRAME_PTR f); extern void free_font_driver_list (FRAME_PTR f); extern Lisp_Object font_update_drivers (FRAME_PTR f, Lisp_Object list); -extern Lisp_Object font_range (ptrdiff_t, ptrdiff_t *, +extern Lisp_Object font_range (ptrdiff_t, ptrdiff_t, ptrdiff_t *, struct window *, struct face *, Lisp_Object); extern void font_fill_lglyph_metrics (Lisp_Object, Lisp_Object);