diff options
| author | Paul Eggert | 2011-03-22 10:33:16 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-03-22 10:33:16 -0700 |
| commit | 8af8e70ee535bd2d657a034e1452f78925c9ca38 (patch) | |
| tree | 8b6f95a4c234ec1cf90972f5589b0cefd23e4cd5 | |
| parent | b12ef4116793ce9cc422c22d98b02261995df143 (diff) | |
| parent | 4b978a677c2f684d7988cdd2dccb73d109c6bb1e (diff) | |
| download | emacs-8af8e70ee535bd2d657a034e1452f78925c9ca38.tar.gz emacs-8af8e70ee535bd2d657a034e1452f78925c9ca38.zip | |
Merge from mainline.
| -rw-r--r-- | .gitignore | 6 | ||||
| -rw-r--r-- | ChangeLog | 9 | ||||
| -rwxr-xr-x | autogen.sh | 2 | ||||
| -rwxr-xr-x | autogen/copy_autogen | 9 | ||||
| -rw-r--r-- | etc/NEWS | 1 | ||||
| -rw-r--r-- | lisp/ChangeLog | 69 | ||||
| -rw-r--r-- | lisp/abbrev.el | 36 | ||||
| -rw-r--r-- | lisp/cus-theme.el | 10 | ||||
| -rw-r--r-- | lisp/custom.el | 128 | ||||
| -rw-r--r-- | lisp/eshell/esh-opt.el | 55 | ||||
| -rw-r--r-- | lisp/gnus/ChangeLog | 17 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 38 | ||||
| -rw-r--r-- | lisp/gnus/gnus-sum.el | 5 | ||||
| -rw-r--r-- | lisp/gnus/mm-util.el | 7 | ||||
| -rw-r--r-- | lisp/gnus/mm-view.el | 17 | ||||
| -rw-r--r-- | lisp/ido.el | 5 | ||||
| -rw-r--r-- | lisp/image.el | 26 | ||||
| -rw-r--r-- | lisp/minibuffer.el | 20 | ||||
| -rw-r--r-- | lisp/net/rcirc.el | 37 | ||||
| -rw-r--r-- | lisp/simple.el | 18 | ||||
| -rw-r--r-- | lisp/subr.el | 2 | ||||
| -rw-r--r-- | lisp/vc/log-view.el | 3 |
22 files changed, 337 insertions, 183 deletions
diff --git a/.gitignore b/.gitignore index 57537b8a503..b2f17779d68 100644 --- a/.gitignore +++ b/.gitignore | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | configure | ||
| 2 | aclocal.m4 | ||
| 3 | lib/Makefile.in | ||
| 4 | src/config.in | ||
| 1 | autom4te.cache | 5 | autom4te.cache |
| 2 | makefile | 6 | makefile |
| 3 | *~ | 7 | *~ |
| @@ -5,5 +9,3 @@ makefile | |||
| 5 | 9 | ||
| 6 | /bin/ | 10 | /bin/ |
| 7 | /site-lisp/ | 11 | /site-lisp/ |
| 8 | |||
| 9 | # arch-tag: 75cd3c50-1875-4814-8360-190f7de38302 | ||
| @@ -1,16 +1,19 @@ | |||
| 1 | 2011-03-21 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-03-22 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * Makefile.in (GNULIB_MODULES): Add socklen. | 3 | * Makefile.in (GNULIB_MODULES): Add socklen. |
| 4 | * configure.in: Do not check for sys/socket.h, since socklen does that. | 4 | * configure.in: Do not check for sys/socket.h, since socklen does that. |
| 5 | * m4/socklen.m4: New automatically-generated file, from gnulib. | 5 | * m4/socklen.m4: New automatically-generated file, from gnulib. |
| 6 | 6 | ||
| 7 | 2011-03-21 Paul Eggert <eggert@cs.ucla.edu> | ||
| 8 | |||
| 9 | fakemail: Remove dependency on ignore-value. | 7 | fakemail: Remove dependency on ignore-value. |
| 10 | * Makefile.in (GNULIB_MODULES): Add stdio. | 8 | * Makefile.in (GNULIB_MODULES): Add stdio. |
| 11 | * lib/stdio.in.h, m4/stdio_h.m4: New files, automatically | 9 | * lib/stdio.in.h, m4/stdio_h.m4: New files, automatically |
| 12 | imported from gnulib. | 10 | imported from gnulib. |
| 13 | * .bzrignore: Add lib/stdio.h. | 11 | * .bzrignore: Add lib/stdio.h. |
| 12 | 2011-03-22 Glenn Morris <rgm@gnu.org> | ||
| 13 | |||
| 14 | * autogen/copy_autogen: Work from ./ or ../. | ||
| 15 | Fix time-stamps. | ||
| 16 | * autogen.sh: Doc fix. | ||
| 14 | 17 | ||
| 15 | 2011-03-20 Glenn Morris <rgm@gnu.org> | 18 | 2011-03-20 Glenn Morris <rgm@gnu.org> |
| 16 | 19 | ||
diff --git a/autogen.sh b/autogen.sh index a56b8d77826..03c39ee9456 100755 --- a/autogen.sh +++ b/autogen.sh | |||
| @@ -184,7 +184,7 @@ instead of this script. | |||
| 184 | If all else fails, you can try using the pre-built versions of the | 184 | If all else fails, you can try using the pre-built versions of the |
| 185 | generated files by doing: | 185 | generated files by doing: |
| 186 | 186 | ||
| 187 | cd autogen && ./copy_autogen | 187 | ./autogen/copy_autogen |
| 188 | 188 | ||
| 189 | This is not recommended - see the comments in \`copy_autogen'. | 189 | This is not recommended - see the comments in \`copy_autogen'. |
| 190 | 190 | ||
diff --git a/autogen/copy_autogen b/autogen/copy_autogen index 4abdbd87c0f..2096636c38b 100755 --- a/autogen/copy_autogen +++ b/autogen/copy_autogen | |||
| @@ -8,12 +8,17 @@ | |||
| 8 | ## regenerate configure and will fail if you do not have the required | 8 | ## regenerate configure and will fail if you do not have the required |
| 9 | ## tools. You will have to run this script again. | 9 | ## tools. You will have to run this script again. |
| 10 | 10 | ||
| 11 | test -d autogen && cd autogen | ||
| 12 | |||
| 11 | if test ! -e config.in; then | 13 | if test ! -e config.in; then |
| 12 | echo "You must run this script from the autogen/ directory." | 14 | echo "Cannot find autogen/ directory." |
| 13 | exit 1 | 15 | exit 1 |
| 14 | fi | 16 | fi |
| 15 | 17 | ||
| 16 | cp configure aclocal.m4 ../ | 18 | ## Order implied by top-level Makefile's rules, for time-stamps. |
| 19 | cp aclocal.m4 ../ | ||
| 20 | cp configure ../ | ||
| 21 | touch ../src/stamp-h.in | ||
| 17 | cp config.in ../src/ | 22 | cp config.in ../src/ |
| 18 | cp Makefile.in ../lib/ | 23 | cp Makefile.in ../lib/ |
| 19 | 24 | ||
| @@ -746,6 +746,7 @@ sc.el, x-menu.el, rnews.el, rnewspost.el | |||
| 746 | * Lisp changes in Emacs 24.1 | 746 | * Lisp changes in Emacs 24.1 |
| 747 | 747 | ||
| 748 | ** byte-compile-disable-print-circle is obsolete. | 748 | ** byte-compile-disable-print-circle is obsolete. |
| 749 | ** deferred-action-list and deferred-action-function are obsolete. | ||
| 749 | ** Removed the stack-trace-on-error variable. | 750 | ** Removed the stack-trace-on-error variable. |
| 750 | Also the debugger can now "continue" from an error, which means it will jump | 751 | Also the debugger can now "continue" from an error, which means it will jump |
| 751 | to the error handler as if the debugger had not been invoked instead of | 752 | to the error handler as if the debugger had not been invoked instead of |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b12445b466f..6b7dd5a0463 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,72 @@ | |||
| 1 | 2011-03-22 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * abbrev.el (write-abbrev-file): Use utf-8 for writing if it can | ||
| 4 | encode all chars in abbrevs; otherwise use emacs-mule or | ||
| 5 | utf-8-emacs. (Bug#8308) | ||
| 6 | |||
| 7 | 2011-03-22 Juanma Barranquero <lekktu@gmail.com> | ||
| 8 | |||
| 9 | * simple.el (backward-delete-char-untabify): | ||
| 10 | Avoid warning about using `delete-backward-char'. | ||
| 11 | |||
| 12 | * image.el (image-type-file-name-regexps): Make it variable. | ||
| 13 | `imagemagick-register-types' modifies it, and the user may want | ||
| 14 | to add new extensions for known image types. | ||
| 15 | (imagemagick-register-types): Throw error if not using ImageMagick. | ||
| 16 | |||
| 17 | 2011-03-22 Leo Liu <sdl.web@gmail.com> | ||
| 18 | |||
| 19 | * net/rcirc.el (rcirc-completion-at-point): Return nil if point is | ||
| 20 | located before rcirc-prompt-end-marker. | ||
| 21 | (rcirc-complete): Error if point is not after rcirc prompt. | ||
| 22 | Handle the case when table is nil. | ||
| 23 | (rcirc-user-authenticated): Define to fix compiler warning. | ||
| 24 | |||
| 25 | 2011-03-22 Chong Yidong <cyd@stupidchicken.com> | ||
| 26 | |||
| 27 | * custom.el (custom--inhibit-theme-enable): Make it affect only | ||
| 28 | custom-theme-set-variables and custom-theme-set-faces. | ||
| 29 | (provide-theme): Ignore custom--inhibit-theme-enable. | ||
| 30 | (load-theme): Enable the theme explicitly if NO-ENABLE is non-nil. | ||
| 31 | (custom-enabling-themes): Delete variable. | ||
| 32 | (enable-theme): Accept only loaded themes as arguments. Ignore | ||
| 33 | the special custom-enabled-themes variable. | ||
| 34 | (custom-enabled-themes): Forbid themes from setting this. | ||
| 35 | Eliminate use of custom-enabling-themes. | ||
| 36 | (custom-push-theme): Quote "changed" custom var entry. | ||
| 37 | |||
| 38 | 2011-03-21 Leo Liu <sdl.web@gmail.com> | ||
| 39 | |||
| 40 | * ido.el (ido-read-internal): Add ido-selected to history instead | ||
| 41 | of user input. | ||
| 42 | |||
| 43 | 2011-03-21 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 44 | |||
| 45 | * subr.el (deferred-action-list, deferred-action-function): | ||
| 46 | Mark obsolete. | ||
| 47 | |||
| 48 | 2011-03-21 Leo Liu <sdl.web@gmail.com> | ||
| 49 | |||
| 50 | * vc/log-view.el: Remove (require 'wid-edit), not needed after the | ||
| 51 | change on 2011-02-13 (bug#8309). | ||
| 52 | |||
| 53 | * minibuffer.el (read-file-name-function): Change default value. | ||
| 54 | (read-file-name--defaults): Rename from read-file-name-defaults. | ||
| 55 | (read-file-name-default): Rename from read-file-name. | ||
| 56 | (read-file-name): Call read-file-name-function. | ||
| 57 | |||
| 58 | 2011-03-21 Glenn Morris <rgm@gnu.org> | ||
| 59 | |||
| 60 | * eshell/esh-opt.el (eshell-eval-using-options, eshell-process-args): | ||
| 61 | Doc fixes. | ||
| 62 | |||
| 63 | 2011-03-21 Chong Yidong <cyd@stupidchicken.com> | ||
| 64 | |||
| 65 | * cus-theme.el: Add missing provide statement. | ||
| 66 | (customize-create-theme): Extract theme value correctly. | ||
| 67 | (custom-theme-visit-theme): Autoload. | ||
| 68 | (customize-create-theme): Prompt before inserting default faces. | ||
| 69 | |||
| 1 | 2011-03-20 Jay Belanger <jay.p.belanger@gmail.com> | 70 | 2011-03-20 Jay Belanger <jay.p.belanger@gmail.com> |
| 2 | 71 | ||
| 3 | * calc/calc-menu.el (calc-units-menu): Add entries for logarithmic | 72 | * calc/calc-menu.el (calc-units-menu): Add entries for logarithmic |
diff --git a/lisp/abbrev.el b/lisp/abbrev.el index fbca214a649..3b383a5f5b8 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el | |||
| @@ -225,21 +225,29 @@ specified in `abbrev-file-name' is used." | |||
| 225 | abbrev-file-name))) | 225 | abbrev-file-name))) |
| 226 | (or (and file (> (length file) 0)) | 226 | (or (and file (> (length file) 0)) |
| 227 | (setq file abbrev-file-name)) | 227 | (setq file abbrev-file-name)) |
| 228 | (let ((coding-system-for-write 'emacs-mule)) | 228 | (let ((coding-system-for-write 'utf-8)) |
| 229 | (with-temp-file file | 229 | (with-temp-buffer |
| 230 | (insert ";;-*-coding: emacs-mule;-*-\n") | ||
| 231 | (dolist (table | 230 | (dolist (table |
| 232 | ;; We sort the table in order to ease the automatic | 231 | ;; We sort the table in order to ease the automatic |
| 233 | ;; merging of different versions of the user's abbrevs | 232 | ;; merging of different versions of the user's abbrevs |
| 234 | ;; file. This is useful, for example, for when the | 233 | ;; file. This is useful, for example, for when the |
| 235 | ;; user keeps their home directory in a revision | 234 | ;; user keeps their home directory in a revision |
| 236 | ;; control system, and is therefore keeping multiple | 235 | ;; control system, and is therefore keeping multiple |
| 237 | ;; slightly-differing copies loosely synchronized. | 236 | ;; slightly-differing copies loosely synchronized. |
| 238 | (sort (copy-sequence abbrev-table-name-list) | 237 | (sort (copy-sequence abbrev-table-name-list) |
| 239 | (lambda (s1 s2) | 238 | (lambda (s1 s2) |
| 240 | (string< (symbol-name s1) | 239 | (string< (symbol-name s1) |
| 241 | (symbol-name s2))))) | 240 | (symbol-name s2))))) |
| 242 | (insert-abbrev-table-description table nil))))) | 241 | (insert-abbrev-table-description table nil)) |
| 242 | (when (unencodable-char-position (point-min) (point-max) 'utf-8) | ||
| 243 | (setq coding-system-for-write | ||
| 244 | (if (> emacs-major-version 24) | ||
| 245 | 'utf-8-emacs | ||
| 246 | ;; For compatibility with Emacs 22 (See Bug#8308) | ||
| 247 | 'emacs-mule))) | ||
| 248 | (goto-char (point-min)) | ||
| 249 | (insert (format ";;-*-coding: %s;-*-\n" coding-system-for-write)) | ||
| 250 | (write-region nil nil file nil 0)))) | ||
| 243 | 251 | ||
| 244 | (defun add-mode-abbrev (arg) | 252 | (defun add-mode-abbrev (arg) |
| 245 | "Define mode-specific abbrev for last word(s) before point. | 253 | "Define mode-specific abbrev for last word(s) before point. |
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el index cdc066aa91a..4f9428d497b 100644 --- a/lisp/cus-theme.el +++ b/lisp/cus-theme.el | |||
| @@ -100,6 +100,9 @@ named *Custom Theme*." | |||
| 100 | (make-local-variable 'custom-theme-insert-face-marker) | 100 | (make-local-variable 'custom-theme-insert-face-marker) |
| 101 | (make-local-variable 'custom-theme-insert-variable-marker) | 101 | (make-local-variable 'custom-theme-insert-variable-marker) |
| 102 | (make-local-variable 'custom-theme--listed-faces) | 102 | (make-local-variable 'custom-theme--listed-faces) |
| 103 | (when (called-interactively-p 'interactive) | ||
| 104 | (unless (y-or-n-p "Include basic face customizations in this theme? ") | ||
| 105 | (setq custom-theme--listed-faces nil))) | ||
| 103 | 106 | ||
| 104 | (if (eq theme 'user) | 107 | (if (eq theme 'user) |
| 105 | (widget-insert "This buffer contains all the Custom settings you have made. | 108 | (widget-insert "This buffer contains all the Custom settings you have made. |
| @@ -188,7 +191,7 @@ remove them from your saved Custom file.\n\n")) | |||
| 188 | (while vars | 191 | (while vars |
| 189 | (if (eq (car vars) 'custom-enabled-themes) | 192 | (if (eq (car vars) 'custom-enabled-themes) |
| 190 | (progn (pop vars) (pop values)) | 193 | (progn (pop vars) (pop values)) |
| 191 | (custom-theme-add-var-1 (pop vars) (pop values))))) | 194 | (custom-theme-add-var-1 (pop vars) (eval (pop values)))))) |
| 192 | (setq custom-theme-insert-variable-marker (point-marker)) | 195 | (setq custom-theme-insert-variable-marker (point-marker)) |
| 193 | (widget-insert " ") | 196 | (widget-insert " ") |
| 194 | (widget-create 'push-button | 197 | (widget-create 'push-button |
| @@ -297,8 +300,9 @@ SPEC, if non-nil, should be a face spec to which to set the widget." | |||
| 297 | 300 | ||
| 298 | ;;; Reading and writing | 301 | ;;; Reading and writing |
| 299 | 302 | ||
| 303 | ;;;###autoload | ||
| 300 | (defun custom-theme-visit-theme (theme) | 304 | (defun custom-theme-visit-theme (theme) |
| 301 | "Load the custom theme THEME's settings into the current buffer." | 305 | "Set up a Custom buffer to edit custom theme THEME." |
| 302 | (interactive | 306 | (interactive |
| 303 | (list | 307 | (list |
| 304 | (intern (completing-read "Find custom theme: " | 308 | (intern (completing-read "Find custom theme: " |
| @@ -663,4 +667,6 @@ Theme files are named *-theme.el in `")) | |||
| 663 | (widget-toggle-action widget event) | 667 | (widget-toggle-action widget event) |
| 664 | (setq custom-theme-allow-multiple-selections (widget-value widget))) | 668 | (setq custom-theme-allow-multiple-selections (widget-value widget))) |
| 665 | 669 | ||
| 670 | (provide 'cus-theme) | ||
| 671 | |||
| 666 | ;;; cus-theme.el ends here | 672 | ;;; cus-theme.el ends here |
diff --git a/lisp/custom.el b/lisp/custom.el index cf06fe27f4d..e837c501438 100644 --- a/lisp/custom.el +++ b/lisp/custom.el | |||
| @@ -849,10 +849,10 @@ See `custom-known-themes' for a list of known themes." | |||
| 849 | ;; theme is later disabled. | 849 | ;; theme is later disabled. |
| 850 | (cond ((and (eq prop 'theme-value) | 850 | (cond ((and (eq prop 'theme-value) |
| 851 | (boundp symbol)) | 851 | (boundp symbol)) |
| 852 | (let ((sv (get symbol 'standard-value))) | 852 | (let ((sv (get symbol 'standard-value)) |
| 853 | (unless (and sv | 853 | (val (symbol-value symbol))) |
| 854 | (equal (eval (car sv)) (symbol-value symbol))) | 854 | (unless (and sv (equal (eval (car sv)) val)) |
| 855 | (setq old (list (list 'changed (symbol-value symbol))))))) | 855 | (setq old `((changed ,(custom-quote val))))))) |
| 856 | ((and (facep symbol) | 856 | ((and (facep symbol) |
| 857 | (not (face-attr-match-p | 857 | (not (face-attr-match-p |
| 858 | symbol | 858 | symbol |
| @@ -1081,10 +1081,10 @@ name." | |||
| 1081 | :version "24.1") | 1081 | :version "24.1") |
| 1082 | 1082 | ||
| 1083 | (defvar custom--inhibit-theme-enable nil | 1083 | (defvar custom--inhibit-theme-enable nil |
| 1084 | "If non-nil, loading a theme does not enable it. | 1084 | "Whether the custom-theme-set-* functions act immediately. |
| 1085 | This internal variable is set by `load-theme' when its NO-ENABLE | 1085 | If nil, `custom-theme-set-variables' and `custom-theme-set-faces' |
| 1086 | argument is non-nil, and it affects `custom-theme-set-variables', | 1086 | change the current values of the given variable or face. If |
| 1087 | `custom-theme-set-faces', and `provide-theme'." ) | 1087 | non-nil, they just make a record of the theme settings.") |
| 1088 | 1088 | ||
| 1089 | (defun provide-theme (theme) | 1089 | (defun provide-theme (theme) |
| 1090 | "Indicate that this file provides THEME. | 1090 | "Indicate that this file provides THEME. |
| @@ -1094,15 +1094,7 @@ property `theme-feature' (which is usually a symbol created by | |||
| 1094 | (unless (custom-theme-name-valid-p theme) | 1094 | (unless (custom-theme-name-valid-p theme) |
| 1095 | (error "Custom theme cannot be named %S" theme)) | 1095 | (error "Custom theme cannot be named %S" theme)) |
| 1096 | (custom-check-theme theme) | 1096 | (custom-check-theme theme) |
| 1097 | (provide (get theme 'theme-feature)) | 1097 | (provide (get theme 'theme-feature))) |
| 1098 | (unless custom--inhibit-theme-enable | ||
| 1099 | ;; By default, loading a theme also enables it. | ||
| 1100 | (push theme custom-enabled-themes) | ||
| 1101 | ;; `user' must always be the highest-precedence enabled theme. | ||
| 1102 | ;; Make that remain true. (This has the effect of making user | ||
| 1103 | ;; settings override the ones just loaded, too.) | ||
| 1104 | (let ((custom-enabling-themes t)) | ||
| 1105 | (enable-theme 'user)))) | ||
| 1106 | 1098 | ||
| 1107 | (defcustom custom-safe-themes '(default) | 1099 | (defcustom custom-safe-themes '(default) |
| 1108 | "List of themes that are considered safe to load. | 1100 | "List of themes that are considered safe to load. |
| @@ -1154,9 +1146,11 @@ Return t if THEME was successfully loaded, nil otherwise." | |||
| 1154 | (expand-file-name "themes/" data-directory))) | 1146 | (expand-file-name "themes/" data-directory))) |
| 1155 | (member hash custom-safe-themes) | 1147 | (member hash custom-safe-themes) |
| 1156 | (custom-theme-load-confirm hash)) | 1148 | (custom-theme-load-confirm hash)) |
| 1157 | (let ((custom--inhibit-theme-enable no-enable)) | 1149 | (let ((custom--inhibit-theme-enable t)) |
| 1158 | (eval-buffer) | 1150 | (eval-buffer)) |
| 1159 | t))))) | 1151 | (unless no-enable |
| 1152 | (enable-theme theme)) | ||
| 1153 | t)))) | ||
| 1160 | 1154 | ||
| 1161 | (defun custom-theme-load-confirm (hash) | 1155 | (defun custom-theme-load-confirm (hash) |
| 1162 | "Query the user about loading a Custom theme that may not be safe. | 1156 | "Query the user about loading a Custom theme that may not be safe. |
| @@ -1235,68 +1229,70 @@ NAME should be a symbol." | |||
| 1235 | 1229 | ||
| 1236 | ;;; Enabling and disabling loaded themes. | 1230 | ;;; Enabling and disabling loaded themes. |
| 1237 | 1231 | ||
| 1238 | (defvar custom-enabling-themes nil) | ||
| 1239 | |||
| 1240 | (defun enable-theme (theme) | 1232 | (defun enable-theme (theme) |
| 1241 | "Reenable all variable and face settings defined by THEME. | 1233 | "Reenable all variable and face settings defined by THEME. |
| 1242 | The newly enabled theme gets the highest precedence (after `user'). | 1234 | THEME should be either `user', or a theme loaded via `load-theme'. |
| 1243 | If it is already enabled, just give it highest precedence (after `user'). | 1235 | After this function completes, THEME will have the highest |
| 1244 | 1236 | precedence (after `user')." | |
| 1245 | If THEME does not specify any theme settings, this tries to load | ||
| 1246 | the theme from its theme file, by calling `load-theme'." | ||
| 1247 | (interactive (list (intern | 1237 | (interactive (list (intern |
| 1248 | (completing-read | 1238 | (completing-read |
| 1249 | "Enable custom theme: " | 1239 | "Enable custom theme: " |
| 1250 | obarray (lambda (sym) (get sym 'theme-settings)))))) | 1240 | obarray (lambda (sym) (get sym 'theme-settings)) t)))) |
| 1251 | (if (not (custom-theme-p theme)) | 1241 | (if (not (custom-theme-p theme)) |
| 1252 | (load-theme theme) | 1242 | (error "Undefined Custom theme %s" theme)) |
| 1253 | ;; This could use a bit of optimization -- cyd | 1243 | (let ((settings (get theme 'theme-settings))) |
| 1254 | (let ((settings (get theme 'theme-settings))) | 1244 | ;; Loop through theme settings, recalculating vars/faces. |
| 1255 | (dolist (s settings) | 1245 | (dolist (s settings) |
| 1256 | (let* ((prop (car s)) | 1246 | (let* ((prop (car s)) |
| 1257 | (symbol (cadr s)) | 1247 | (symbol (cadr s)) |
| 1258 | (spec-list (get symbol prop))) | 1248 | (spec-list (get symbol prop))) |
| 1259 | (put symbol prop (cons (cddr s) (assq-delete-all theme spec-list))) | 1249 | (put symbol prop (cons (cddr s) (assq-delete-all theme spec-list))) |
| 1260 | (if (eq prop 'theme-value) | 1250 | (cond |
| 1261 | (custom-theme-recalc-variable symbol) | 1251 | ((eq prop 'theme-face) |
| 1262 | (custom-theme-recalc-face symbol))))) | 1252 | (custom-theme-recalc-face symbol)) |
| 1263 | (unless (eq theme 'user) | 1253 | ((eq prop 'theme-value) |
| 1264 | (setq custom-enabled-themes | 1254 | ;; Don't change `custom-enabled-themes'; that's special. |
| 1265 | (cons theme (delq theme custom-enabled-themes))) | 1255 | (unless (eq symbol 'custom-enabled-themes) |
| 1266 | (unless custom-enabling-themes | 1256 | (custom-theme-recalc-variable symbol))))))) |
| 1267 | (enable-theme 'user))))) | 1257 | (unless (eq theme 'user) |
| 1258 | (setq custom-enabled-themes | ||
| 1259 | (cons theme (delq theme custom-enabled-themes))) | ||
| 1260 | ;; Give the `user' theme the highest priority. | ||
| 1261 | (enable-theme 'user))) | ||
| 1268 | 1262 | ||
| 1269 | (defcustom custom-enabled-themes nil | 1263 | (defcustom custom-enabled-themes nil |
| 1270 | "List of enabled Custom Themes, highest precedence first. | 1264 | "List of enabled Custom Themes, highest precedence first. |
| 1265 | This list does not include the `user' theme, which is set by | ||
| 1266 | Customize and always takes precedence over other Custom Themes. | ||
| 1271 | 1267 | ||
| 1272 | This does not include the `user' theme, which is set by Customize, | 1268 | This variable cannot be defined inside a Custom theme; there, it |
| 1273 | and always takes precedence over other Custom Themes." | 1269 | is simply ignored." |
| 1274 | :group 'customize | 1270 | :group 'customize |
| 1275 | :type '(repeat symbol) | 1271 | :type '(repeat symbol) |
| 1276 | :set-after '(custom-theme-directory custom-theme-load-path | 1272 | :set-after '(custom-theme-directory custom-theme-load-path |
| 1277 | custom-safe-themes) | 1273 | custom-safe-themes) |
| 1278 | :risky t | 1274 | :risky t |
| 1279 | :set (lambda (symbol themes) | 1275 | :set (lambda (symbol themes) |
| 1280 | ;; Avoid an infinite loop when custom-enabled-themes is | 1276 | (let (failures) |
| 1281 | ;; defined in a theme (e.g. `user'). Enabling the theme sets | 1277 | (setq themes (delq 'user (delete-dups themes))) |
| 1282 | ;; custom-enabled-themes, which enables the theme... | 1278 | ;; Disable all themes not in THEMES. |
| 1283 | (unless custom-enabling-themes | 1279 | (if (boundp symbol) |
| 1284 | (let ((custom-enabling-themes t) failures) | 1280 | (dolist (theme (symbol-value symbol)) |
| 1285 | (setq themes (delq 'user (delete-dups themes))) | 1281 | (if (not (memq theme themes)) |
| 1286 | (if (boundp symbol) | 1282 | (disable-theme theme)))) |
| 1287 | (dolist (theme (symbol-value symbol)) | 1283 | ;; Call `enable-theme' or `load-theme' on each of THEMES. |
| 1288 | (if (not (memq theme themes)) | 1284 | (dolist (theme (reverse themes)) |
| 1289 | (disable-theme theme)))) | 1285 | (condition-case nil |
| 1290 | (dolist (theme (reverse themes)) | 1286 | (if (custom-theme-p theme) |
| 1291 | (condition-case nil | 1287 | (enable-theme theme) |
| 1292 | (enable-theme theme) | 1288 | (load-theme theme)) |
| 1293 | (error (progn (push theme failures) | 1289 | (error (setq failures (cons theme failures) |
| 1294 | (setq themes (delq theme themes)))))) | 1290 | themes (delq theme themes))))) |
| 1295 | (enable-theme 'user) | 1291 | (enable-theme 'user) |
| 1296 | (custom-set-default symbol themes) | 1292 | (custom-set-default symbol themes) |
| 1297 | (if failures | 1293 | (if failures |
| 1298 | (message "Failed to enable themes: %s" | 1294 | (message "Failed to enable theme: %s" |
| 1299 | (mapconcat 'symbol-name failures " "))))))) | 1295 | (mapconcat 'symbol-name failures ", ")))))) |
| 1300 | 1296 | ||
| 1301 | (defsubst custom-theme-enabled-p (theme) | 1297 | (defsubst custom-theme-enabled-p (theme) |
| 1302 | "Return non-nil if THEME is enabled." | 1298 | "Return non-nil if THEME is enabled." |
diff --git a/lisp/eshell/esh-opt.el b/lisp/eshell/esh-opt.el index d7162406879..a9e8f11c39a 100644 --- a/lisp/eshell/esh-opt.el +++ b/lisp/eshell/esh-opt.el | |||
| @@ -35,13 +35,51 @@ Eshell commands implemented in Lisp." | |||
| 35 | 35 | ||
| 36 | ;;; User Functions: | 36 | ;;; User Functions: |
| 37 | 37 | ||
| 38 | (defmacro eshell-eval-using-options (name macro-args | 38 | (defmacro eshell-eval-using-options (name macro-args options &rest body-forms) |
| 39 | options &rest body-forms) | ||
| 40 | "Process NAME's MACRO-ARGS using a set of command line OPTIONS. | 39 | "Process NAME's MACRO-ARGS using a set of command line OPTIONS. |
| 41 | After doing so, settings will be stored in local symbols as declared | 40 | After doing so, stores settings in local symbols as declared by OPTIONS; |
| 42 | by OPTIONS; FORMS will then be evaluated -- assuming all was OK. | 41 | then evaluates BODY-FORMS -- assuming all was OK. |
| 43 | 42 | ||
| 44 | The syntax of OPTIONS is: | 43 | OPTIONS is a list, beginning with one or more elements of the form: |
| 44 | \(SHORT LONG VALUE SYMBOL HELP-STRING) | ||
| 45 | Each of these elements represents a particular command-line switch. | ||
| 46 | |||
| 47 | SHORT is either nil, or a character that can be used as a switch -SHORT. | ||
| 48 | LONG is either nil, or a string that can be used as a switch --LONG. | ||
| 49 | At least one of SHORT and LONG must be non-nil. | ||
| 50 | VALUE is the value associated with the option. It can be either: | ||
| 51 | t - the option needs a value to be specified after the switch; | ||
| 52 | nil - the option is given the value t; | ||
| 53 | anything else - specifies the actual value for the option. | ||
| 54 | SYMBOL is either nil, or the name of the Lisp symbol that will be bound | ||
| 55 | to VALUE. A nil SYMBOL calls `eshell-show-usage', and so is appropriate | ||
| 56 | for a \"--help\" type option. | ||
| 57 | HELP-STRING is a documentation string for the option. | ||
| 58 | |||
| 59 | Any remaining elements of OPTIONS are :KEYWORD arguments. Some take | ||
| 60 | arguments, some do not. The recognized :KEYWORDS are: | ||
| 61 | |||
| 62 | :external STRING | ||
| 63 | STRING is an external command to run if there are unknown switches. | ||
| 64 | |||
| 65 | :usage STRING | ||
| 66 | STRING is the initial part of the command's documentation string. | ||
| 67 | It appears before the options are listed. | ||
| 68 | |||
| 69 | :post-usage STRING | ||
| 70 | STRING is an optional trailing part of the command's documentation string. | ||
| 71 | It appears after the options, but before the final part of the | ||
| 72 | documentation about the associated external command (if there is one). | ||
| 73 | |||
| 74 | :show-usage | ||
| 75 | If present, then show the usage message if the command is called with no | ||
| 76 | arguments. | ||
| 77 | |||
| 78 | :preserve-args | ||
| 79 | If present, do not pass MACRO-ARGS through `eshell-flatten-list' | ||
| 80 | and `eshell-stringify-list'. | ||
| 81 | |||
| 82 | For example, OPTIONS might look like: | ||
| 45 | 83 | ||
| 46 | '((?C nil nil multi-column \"multi-column display\") | 84 | '((?C nil nil multi-column \"multi-column display\") |
| 47 | (nil \"help\" nil nil \"show this usage display\") | 85 | (nil \"help\" nil nil \"show this usage display\") |
| @@ -52,8 +90,9 @@ The syntax of OPTIONS is: | |||
| 52 | Sort entries alphabetically across.\") | 90 | Sort entries alphabetically across.\") |
| 53 | 91 | ||
| 54 | `eshell-eval-using-options' returns the value of the last form in | 92 | `eshell-eval-using-options' returns the value of the last form in |
| 55 | BODY-FORMS. If instead an external command is run, the tag | 93 | BODY-FORMS. If instead an external command is run (because of |
| 56 | `eshell-external' will be thrown with the new process for its value. | 94 | an unknown option), the tag `eshell-external' will be thrown with |
| 95 | the new process for its value. | ||
| 57 | 96 | ||
| 58 | Lastly, any remaining arguments will be available in a locally | 97 | Lastly, any remaining arguments will be available in a locally |
| 59 | interned variable `args' (created using a `let' form)." | 98 | interned variable `args' (created using a `let' form)." |
| @@ -200,7 +239,7 @@ switch is unrecognized." | |||
| 200 | 239 | ||
| 201 | (defun eshell-process-args (name args options) | 240 | (defun eshell-process-args (name args options) |
| 202 | "Process the given ARGS using OPTIONS. | 241 | "Process the given ARGS using OPTIONS. |
| 203 | This assumes that symbols have been intern'd by `eshell-with-options'." | 242 | This assumes that symbols have been intern'd by `eshell-eval-using-options'." |
| 204 | (let ((ai 0) arg) | 243 | (let ((ai 0) arg) |
| 205 | (while (< ai (length args)) | 244 | (while (< ai (length args)) |
| 206 | (setq arg (nth ai args)) | 245 | (setq arg (nth ai args)) |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 7eca03bd93b..d728d1957b1 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | 2011-03-21 Julien Danjou <julien@danjou.info> | ||
| 2 | |||
| 3 | * mm-view.el (mm-display-inline-fontify): Make mode optional, and call | ||
| 4 | normal-mode if not set. Set temp buffer unmodified to avoid kill-buffer | ||
| 5 | query. | ||
| 6 | (mm-inline-text): Render normal text with fontification whenever | ||
| 7 | possible. | ||
| 8 | |||
| 9 | * gnus-sum.el (gnus-summary-save-parts-1): | ||
| 10 | * gnus-art.el (gnus-article-browse-html-save-cid-content) | ||
| 11 | (gnus-article-browse-html-parts, gnus-mime-delete-part) | ||
| 12 | (gnus-mime-copy-part, gnus-mime-inline-part, gnus-insert-mime-button): | ||
| 13 | Use `mm-handle-filename'. | ||
| 14 | |||
| 15 | * mm-util.el (mm-handle-filename): New function, return the filename of | ||
| 16 | an handle. | ||
| 17 | |||
| 1 | 2011-03-18 Julien Danjou <julien@danjou.info> | 18 | 2011-03-18 Julien Danjou <julien@danjou.info> |
| 2 | 19 | ||
| 3 | * gnus-util.el (gnus-buffer-live-p): Simplify gnus-buffer-live-p. | 20 | * gnus-util.el (gnus-buffer-live-p): Simplify gnus-buffer-live-p. |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 7c7e0531926..97677988f0a 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -2811,14 +2811,11 @@ Return file name." | |||
| 2811 | ((equal (concat "<" cid ">") (mm-handle-id handle)) | 2811 | ((equal (concat "<" cid ">") (mm-handle-id handle)) |
| 2812 | (setq file | 2812 | (setq file |
| 2813 | (expand-file-name | 2813 | (expand-file-name |
| 2814 | (or (mail-content-type-get | 2814 | (or (mm-handle-filename handle) |
| 2815 | (mm-handle-disposition handle) 'filename) | 2815 | (concat |
| 2816 | (mail-content-type-get | 2816 | (make-temp-name "cid") |
| 2817 | (setq type (mm-handle-type handle)) 'name) | 2817 | (car (rassoc (car (mm-handle-type handle)) mailcap-mime-extensions)))) |
| 2818 | (concat | 2818 | directory)) |
| 2819 | (make-temp-name "cid") | ||
| 2820 | (car (rassoc (car type) mailcap-mime-extensions)))) | ||
| 2821 | directory)) | ||
| 2822 | (mm-save-part-to-file handle file) | 2819 | (mm-save-part-to-file handle file) |
| 2823 | (throw 'found file)))))))) | 2820 | (throw 'found file)))))))) |
| 2824 | 2821 | ||
| @@ -2835,10 +2832,7 @@ message header will be added to the bodies of the \"text/html\" parts." | |||
| 2835 | ((or (equal (car (setq type (mm-handle-type handle))) "text/html") | 2832 | ((or (equal (car (setq type (mm-handle-type handle))) "text/html") |
| 2836 | (and (equal (car type) "message/external-body") | 2833 | (and (equal (car type) "message/external-body") |
| 2837 | (or header | 2834 | (or header |
| 2838 | (setq file (or (mail-content-type-get type 'name) | 2835 | (setq file (mm-handle-filename handle))) |
| 2839 | (mail-content-type-get | ||
| 2840 | (mm-handle-disposition handle) | ||
| 2841 | 'filename)))) | ||
| 2842 | (or (mm-handle-cache handle) | 2836 | (or (mm-handle-cache handle) |
| 2843 | (condition-case code | 2837 | (condition-case code |
| 2844 | (progn (mm-extern-cache-contents handle) t) | 2838 | (progn (mm-extern-cache-contents handle) t) |
| @@ -5043,14 +5037,11 @@ Deleting parts may malfunction or destroy the article; continue? ")) | |||
| 5043 | (let* ((data (get-text-property (point) 'gnus-data)) | 5037 | (let* ((data (get-text-property (point) 'gnus-data)) |
| 5044 | (id (get-text-property (point) 'gnus-part)) | 5038 | (id (get-text-property (point) 'gnus-part)) |
| 5045 | (handles gnus-article-mime-handles) | 5039 | (handles gnus-article-mime-handles) |
| 5046 | (none "(none)") | ||
| 5047 | (description | 5040 | (description |
| 5048 | (let ((desc (mm-handle-description data))) | 5041 | (let ((desc (mm-handle-description data))) |
| 5049 | (when desc | 5042 | (when desc |
| 5050 | (mail-decode-encoded-word-string desc)))) | 5043 | (mail-decode-encoded-word-string desc)))) |
| 5051 | (filename | 5044 | (filename (or (mm-handle-filename (mm-handle-disposition data)) "(none)")) |
| 5052 | (or (mail-content-type-get (mm-handle-disposition data) 'filename) | ||
| 5053 | none)) | ||
| 5054 | (type (mm-handle-media-type data))) | 5045 | (type (mm-handle-media-type data))) |
| 5055 | (unless data | 5046 | (unless data |
| 5056 | (error "No MIME part under point")) | 5047 | (error "No MIME part under point")) |
| @@ -5168,10 +5159,7 @@ are decompressed." | |||
| 5168 | (unless handle | 5159 | (unless handle |
| 5169 | (setq handle (get-text-property (point) 'gnus-data))) | 5160 | (setq handle (get-text-property (point) 'gnus-data))) |
| 5170 | (when handle | 5161 | (when handle |
| 5171 | (let ((filename (or (mail-content-type-get (mm-handle-type handle) | 5162 | (let ((filename (mm-handle-filename handle)) |
| 5172 | 'name) | ||
| 5173 | (mail-content-type-get (mm-handle-disposition handle) | ||
| 5174 | 'filename))) | ||
| 5175 | contents dont-decode charset coding-system) | 5163 | contents dont-decode charset coding-system) |
| 5176 | (mm-with-unibyte-buffer | 5164 | (mm-with-unibyte-buffer |
| 5177 | (mm-insert-part handle) | 5165 | (mm-insert-part handle) |
| @@ -5261,12 +5249,7 @@ Compressed files like .gz and .bz2 are decompressed." | |||
| 5261 | (mm-with-unibyte-buffer | 5249 | (mm-with-unibyte-buffer |
| 5262 | (mm-insert-part handle) | 5250 | (mm-insert-part handle) |
| 5263 | (setq contents | 5251 | (setq contents |
| 5264 | (or (mm-decompress-buffer | 5252 | (or (mm-decompress-buffer (mm-handle-filename handle) nil t) |
| 5265 | (or (mail-content-type-get (mm-handle-type handle) | ||
| 5266 | 'name) | ||
| 5267 | (mail-content-type-get (mm-handle-disposition handle) | ||
| 5268 | 'filename)) | ||
| 5269 | nil t) | ||
| 5270 | (buffer-string)))) | 5253 | (buffer-string)))) |
| 5271 | (cond | 5254 | (cond |
| 5272 | ((not arg) | 5255 | ((not arg) |
| @@ -5671,8 +5654,7 @@ all parts." | |||
| 5671 | 5654 | ||
| 5672 | (defun gnus-insert-mime-button (handle gnus-tmp-id &optional displayed) | 5655 | (defun gnus-insert-mime-button (handle gnus-tmp-id &optional displayed) |
| 5673 | (let ((gnus-tmp-name | 5656 | (let ((gnus-tmp-name |
| 5674 | (or (mail-content-type-get (mm-handle-type handle) 'name) | 5657 | (or (mm-handle-filename handle) |
| 5675 | (mail-content-type-get (mm-handle-disposition handle) 'filename) | ||
| 5676 | (mail-content-type-get (mm-handle-type handle) 'url) | 5658 | (mail-content-type-get (mm-handle-type handle) 'url) |
| 5677 | "")) | 5659 | "")) |
| 5678 | (gnus-tmp-type (mm-handle-media-type handle)) | 5660 | (gnus-tmp-type (mm-handle-media-type handle)) |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 29a98b7d11d..9b22bbe39da 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -12142,10 +12142,7 @@ If REVERSE, save parts that do not match TYPE." | |||
| 12142 | mm-file-name-rewrite-functions | 12142 | mm-file-name-rewrite-functions |
| 12143 | (file-name-nondirectory | 12143 | (file-name-nondirectory |
| 12144 | (or | 12144 | (or |
| 12145 | (mail-content-type-get | 12145 | (mm-handle-filename handle) |
| 12146 | (mm-handle-disposition handle) 'filename) | ||
| 12147 | (mail-content-type-get | ||
| 12148 | (mm-handle-type handle) 'name) | ||
| 12149 | (format "%s.%d.%d" gnus-newsgroup-name | 12146 | (format "%s.%d.%d" gnus-newsgroup-name |
| 12150 | (cdr gnus-article-current) | 12147 | (cdr gnus-article-current) |
| 12151 | gnus-summary-save-parts-counter)))) | 12148 | gnus-summary-save-parts-counter)))) |
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index 435c3bba00f..d53784e8cc4 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el | |||
| @@ -1667,6 +1667,13 @@ gzip, bzip2, etc. are allowed." | |||
| 1667 | (when decomp | 1667 | (when decomp |
| 1668 | (kill-buffer (current-buffer))))))) | 1668 | (kill-buffer (current-buffer))))))) |
| 1669 | 1669 | ||
| 1670 | (defun mm-handle-filename (handle) | ||
| 1671 | "Return filename of HANDLE if any." | ||
| 1672 | (or (mail-content-type-get (mm-handle-type handle) | ||
| 1673 | 'name) | ||
| 1674 | (mail-content-type-get (mm-handle-disposition handle) | ||
| 1675 | 'filename))) | ||
| 1676 | |||
| 1670 | (provide 'mm-util) | 1677 | (provide 'mm-util) |
| 1671 | 1678 | ||
| 1672 | ;;; mm-util.el ends here | 1679 | ;;; mm-util.el ends here |
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index d63d20239dc..39d49af0600 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el | |||
| @@ -455,7 +455,7 @@ | |||
| 455 | (narrow-to-region (point) (point)) | 455 | (narrow-to-region (point) (point)) |
| 456 | (mm-insert-part handle) | 456 | (mm-insert-part handle) |
| 457 | (goto-char (point-max))) | 457 | (goto-char (point-max))) |
| 458 | (insert (mm-decode-string (mm-get-part handle) charset))) | 458 | (mm-display-inline-fontify handle)) |
| 459 | (when (and mm-fill-flowed | 459 | (when (and mm-fill-flowed |
| 460 | (equal type "plain") | 460 | (equal type "plain") |
| 461 | (equal (cdr (assoc 'format (mm-handle-type handle))) | 461 | (equal (cdr (assoc 'format (mm-handle-type handle))) |
| @@ -565,15 +565,16 @@ | |||
| 565 | (face-property 'default prop) (current-buffer)))) | 565 | (face-property 'default prop) (current-buffer)))) |
| 566 | (delete-region ,(point-min-marker) ,(point-max-marker))))))))) | 566 | (delete-region ,(point-min-marker) ,(point-max-marker))))))))) |
| 567 | 567 | ||
| 568 | (defun mm-display-inline-fontify (handle mode) | 568 | (defun mm-display-inline-fontify (handle &optional mode) |
| 569 | "Insert HANDLE inline fontifying with MODE. | ||
| 570 | If MODE is not set, try to find mode automatically." | ||
| 569 | (let ((charset (mail-content-type-get (mm-handle-type handle) 'charset)) | 571 | (let ((charset (mail-content-type-get (mm-handle-type handle) 'charset)) |
| 570 | text coding-system) | 572 | text coding-system) |
| 571 | (unless (eq charset 'gnus-decoded) | 573 | (unless (eq charset 'gnus-decoded) |
| 572 | (mm-with-unibyte-buffer | 574 | (mm-with-unibyte-buffer |
| 573 | (mm-insert-part handle) | 575 | (mm-insert-part handle) |
| 574 | (mm-decompress-buffer | 576 | (mm-decompress-buffer |
| 575 | (or (mail-content-type-get (mm-handle-disposition handle) 'name) | 577 | (mm-handle-filename handle) |
| 576 | (mail-content-type-get (mm-handle-disposition handle) 'filename)) | ||
| 577 | t t) | 578 | t t) |
| 578 | (unless charset | 579 | (unless charset |
| 579 | (setq coding-system (mm-find-buffer-file-coding-system))) | 580 | (setq coding-system (mm-find-buffer-file-coding-system))) |
| @@ -601,7 +602,10 @@ | |||
| 601 | (font-lock-support-mode nil) | 602 | (font-lock-support-mode nil) |
| 602 | ;; I find font-lock a bit too verbose. | 603 | ;; I find font-lock a bit too verbose. |
| 603 | (font-lock-verbose nil)) | 604 | (font-lock-verbose nil)) |
| 604 | (funcall mode) | 605 | (setq buffer-file-name (mm-handle-filename handle)) |
| 606 | (if mode | ||
| 607 | (funcall mode) | ||
| 608 | (normal-mode)) | ||
| 605 | ;; The mode function might have already turned on font-lock. | 609 | ;; The mode function might have already turned on font-lock. |
| 606 | (unless (symbol-value 'font-lock-mode) | 610 | (unless (symbol-value 'font-lock-mode) |
| 607 | (font-lock-fontify-buffer))) | 611 | (font-lock-fontify-buffer))) |
| @@ -614,6 +618,9 @@ | |||
| 614 | nil) | 618 | nil) |
| 615 | nil nil nil nil nil 'text-prop)) | 619 | nil nil nil nil nil 'text-prop)) |
| 616 | (setq text (buffer-string)) | 620 | (setq text (buffer-string)) |
| 621 | ;; Set buffer unmodified to avoid confirmation when killing the | ||
| 622 | ;; buffer. | ||
| 623 | (set-buffer-modified-p nil) | ||
| 617 | (kill-buffer (current-buffer))) | 624 | (kill-buffer (current-buffer))) |
| 618 | (mm-insert-inline handle text))) | 625 | (mm-insert-inline handle text))) |
| 619 | 626 | ||
diff --git a/lisp/ido.el b/lisp/ido.el index 2a5c7cf2f0e..df7516993b7 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -1978,7 +1978,9 @@ If INITIAL is non-nil, it specifies the initial input string." | |||
| 1978 | (ido-completing-read t) | 1978 | (ido-completing-read t) |
| 1979 | (ido-require-match require-match) | 1979 | (ido-require-match require-match) |
| 1980 | (ido-use-mycompletion-depth (1+ (minibuffer-depth))) | 1980 | (ido-use-mycompletion-depth (1+ (minibuffer-depth))) |
| 1981 | (show-paren-mode nil)) | 1981 | (show-paren-mode nil) |
| 1982 | ;; Postpone history adding till later | ||
| 1983 | (history-add-new-input nil)) | ||
| 1982 | ;; prompt the user for the file name | 1984 | ;; prompt the user for the file name |
| 1983 | (setq ido-exit nil) | 1985 | (setq ido-exit nil) |
| 1984 | (setq ido-final-text | 1986 | (setq ido-final-text |
| @@ -2158,6 +2160,7 @@ If INITIAL is non-nil, it specifies the initial input string." | |||
| 2158 | 2160 | ||
| 2159 | (t | 2161 | (t |
| 2160 | (setq done t)))))) | 2162 | (setq done t)))))) |
| 2163 | (and history (add-to-history history ido-selected)) | ||
| 2161 | ido-selected)) | 2164 | ido-selected)) |
| 2162 | 2165 | ||
| 2163 | (defun ido-edit-input () | 2166 | (defun ido-edit-input () |
diff --git a/lisp/image.el b/lisp/image.el index 627d4c69e44..3b90ac46bd1 100644 --- a/lisp/image.el +++ b/lisp/image.el | |||
| @@ -60,7 +60,7 @@ IMAGE-TYPE must be a pair (PREDICATE . TYPE). PREDICATE is called | |||
| 60 | with one argument, a string containing the image data. If PREDICATE returns | 60 | with one argument, a string containing the image data. If PREDICATE returns |
| 61 | a non-nil value, TYPE is the image's type.") | 61 | a non-nil value, TYPE is the image's type.") |
| 62 | 62 | ||
| 63 | (defconst image-type-file-name-regexps | 63 | (defvar image-type-file-name-regexps |
| 64 | '(("\\.png\\'" . png) | 64 | '(("\\.png\\'" . png) |
| 65 | ("\\.gif\\'" . gif) | 65 | ("\\.gif\\'" . gif) |
| 66 | ("\\.jpe?g\\'" . jpeg) | 66 | ("\\.jpe?g\\'" . jpeg) |
| @@ -710,17 +710,19 @@ shall be displayed." | |||
| 710 | ;;;###autoload | 710 | ;;;###autoload |
| 711 | (defun imagemagick-register-types () | 711 | (defun imagemagick-register-types () |
| 712 | "Register the file types that ImageMagick is able to handle." | 712 | "Register the file types that ImageMagick is able to handle." |
| 713 | (let ((im-types (imagemagick-types))) | 713 | (if (fboundp 'imagemagick-types) |
| 714 | (dolist (im-inhibit imagemagick-types-inhibit) | 714 | (let ((im-types (imagemagick-types))) |
| 715 | (setq im-types (remove im-inhibit im-types))) | 715 | (dolist (im-inhibit imagemagick-types-inhibit) |
| 716 | (dolist (im-type im-types) | 716 | (setq im-types (remove im-inhibit im-types))) |
| 717 | (let ((extension (downcase (symbol-name im-type)))) | 717 | (dolist (im-type im-types) |
| 718 | (push | 718 | (let ((extension (downcase (symbol-name im-type)))) |
| 719 | (cons (concat "\\." extension "\\'") 'image-mode) | 719 | (push |
| 720 | auto-mode-alist) | 720 | (cons (concat "\\." extension "\\'") 'image-mode) |
| 721 | (push | 721 | auto-mode-alist) |
| 722 | (cons (concat "\\." extension "\\'") 'imagemagick) | 722 | (push |
| 723 | image-type-file-name-regexps))))) | 723 | (cons (concat "\\." extension "\\'") 'imagemagick) |
| 724 | image-type-file-name-regexps)))) | ||
| 725 | (error "Emacs was not built with ImageMagick support"))) | ||
| 724 | 726 | ||
| 725 | (provide 'image) | 727 | (provide 'image) |
| 726 | 728 | ||
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index fa36da01cd9..e541be9fdd9 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -1486,8 +1486,9 @@ except that it passes the file name through `substitute-in-file-name'." | |||
| 1486 | 'completion--file-name-table) | 1486 | 'completion--file-name-table) |
| 1487 | "Internal subroutine for `read-file-name'. Do not call this.") | 1487 | "Internal subroutine for `read-file-name'. Do not call this.") |
| 1488 | 1488 | ||
| 1489 | (defvar read-file-name-function nil | 1489 | (defvar read-file-name-function 'read-file-name-default |
| 1490 | "If this is non-nil, `read-file-name' does its work by calling this function.") | 1490 | "The function called by `read-file-name' to do its work. |
| 1491 | It should accept the same arguments as `read-file-name'.") | ||
| 1491 | 1492 | ||
| 1492 | (defcustom read-file-name-completion-ignore-case | 1493 | (defcustom read-file-name-completion-ignore-case |
| 1493 | (if (memq system-type '(ms-dos windows-nt darwin cygwin)) | 1494 | (if (memq system-type '(ms-dos windows-nt darwin cygwin)) |
| @@ -1525,7 +1526,7 @@ such as making the current buffer visit no file in the case of | |||
| 1525 | (declare-function x-file-dialog "xfns.c" | 1526 | (declare-function x-file-dialog "xfns.c" |
| 1526 | (prompt dir &optional default-filename mustmatch only-dir-p)) | 1527 | (prompt dir &optional default-filename mustmatch only-dir-p)) |
| 1527 | 1528 | ||
| 1528 | (defun read-file-name-defaults (&optional dir initial) | 1529 | (defun read-file-name--defaults (&optional dir initial) |
| 1529 | (let ((default | 1530 | (let ((default |
| 1530 | (cond | 1531 | (cond |
| 1531 | ;; With non-nil `initial', use `dir' as the first default. | 1532 | ;; With non-nil `initial', use `dir' as the first default. |
| @@ -1592,6 +1593,12 @@ treated as equivalent to nil. | |||
| 1592 | 1593 | ||
| 1593 | See also `read-file-name-completion-ignore-case' | 1594 | See also `read-file-name-completion-ignore-case' |
| 1594 | and `read-file-name-function'." | 1595 | and `read-file-name-function'." |
| 1596 | (funcall (or read-file-name-function #'read-file-name-default) | ||
| 1597 | prompt dir default-filename mustmatch initial predicate)) | ||
| 1598 | |||
| 1599 | (defun read-file-name-default (prompt &optional dir default-filename mustmatch initial predicate) | ||
| 1600 | "Default method for reading file names. | ||
| 1601 | See `read-file-name' for the meaning of the arguments." | ||
| 1595 | (unless dir (setq dir default-directory)) | 1602 | (unless dir (setq dir default-directory)) |
| 1596 | (unless (file-name-absolute-p dir) (setq dir (expand-file-name dir))) | 1603 | (unless (file-name-absolute-p dir) (setq dir (expand-file-name dir))) |
| 1597 | (unless default-filename | 1604 | (unless default-filename |
| @@ -1613,9 +1620,6 @@ and `read-file-name-function'." | |||
| 1613 | (minibuffer--double-dollars dir))) | 1620 | (minibuffer--double-dollars dir))) |
| 1614 | (initial (cons (minibuffer--double-dollars initial) 0))))) | 1621 | (initial (cons (minibuffer--double-dollars initial) 0))))) |
| 1615 | 1622 | ||
| 1616 | (if read-file-name-function | ||
| 1617 | (funcall read-file-name-function | ||
| 1618 | prompt dir default-filename mustmatch initial predicate) | ||
| 1619 | (let ((completion-ignore-case read-file-name-completion-ignore-case) | 1623 | (let ((completion-ignore-case read-file-name-completion-ignore-case) |
| 1620 | (minibuffer-completing-file-name t) | 1624 | (minibuffer-completing-file-name t) |
| 1621 | (pred (or predicate 'file-exists-p)) | 1625 | (pred (or predicate 'file-exists-p)) |
| @@ -1651,7 +1655,7 @@ and `read-file-name-function'." | |||
| 1651 | (lambda () | 1655 | (lambda () |
| 1652 | (with-current-buffer | 1656 | (with-current-buffer |
| 1653 | (window-buffer (minibuffer-selected-window)) | 1657 | (window-buffer (minibuffer-selected-window)) |
| 1654 | (read-file-name-defaults dir initial))))) | 1658 | (read-file-name--defaults dir initial))))) |
| 1655 | (completing-read prompt 'read-file-name-internal | 1659 | (completing-read prompt 'read-file-name-internal |
| 1656 | pred mustmatch insdef | 1660 | pred mustmatch insdef |
| 1657 | 'file-name-history default-filename))) | 1661 | 'file-name-history default-filename))) |
| @@ -1725,7 +1729,7 @@ and `read-file-name-function'." | |||
| 1725 | (if history-delete-duplicates | 1729 | (if history-delete-duplicates |
| 1726 | (delete val1 file-name-history) | 1730 | (delete val1 file-name-history) |
| 1727 | file-name-history))))))) | 1731 | file-name-history))))))) |
| 1728 | val))))) | 1732 | val)))) |
| 1729 | 1733 | ||
| 1730 | (defun internal-complete-buffer-except (&optional buffer) | 1734 | (defun internal-complete-buffer-except (&optional buffer) |
| 1731 | "Perform completion on all buffers excluding BUFFER. | 1735 | "Perform completion on all buffers excluding BUFFER. |
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 71aa0dd22bc..eb4ad01ecd7 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el | |||
| @@ -491,6 +491,7 @@ If ARG is non-nil, instead prompt for connection parameters." | |||
| 491 | (defvar rcirc-server nil) ; server provided by server | 491 | (defvar rcirc-server nil) ; server provided by server |
| 492 | (defvar rcirc-server-name nil) ; server name given by 001 response | 492 | (defvar rcirc-server-name nil) ; server name given by 001 response |
| 493 | (defvar rcirc-timeout-timer nil) | 493 | (defvar rcirc-timeout-timer nil) |
| 494 | (defvar rcirc-user-authenticated nil) | ||
| 494 | (defvar rcirc-user-disconnect nil) | 495 | (defvar rcirc-user-disconnect nil) |
| 495 | (defvar rcirc-connecting nil) | 496 | (defvar rcirc-connecting nil) |
| 496 | (defvar rcirc-process nil) | 497 | (defvar rcirc-process nil) |
| @@ -828,18 +829,21 @@ The list is updated automatically by `defun-rcirc-command'.") | |||
| 828 | 829 | ||
| 829 | (defun rcirc-completion-at-point () | 830 | (defun rcirc-completion-at-point () |
| 830 | "Function used for `completion-at-point-functions' in `rcirc-mode'." | 831 | "Function used for `completion-at-point-functions' in `rcirc-mode'." |
| 831 | (let* ((beg (save-excursion | 832 | (and (rcirc-looking-at-input) |
| 832 | (if (re-search-backward " " rcirc-prompt-end-marker t) | 833 | (let* ((beg (save-excursion |
| 833 | (1+ (point)) | 834 | (if (re-search-backward " " rcirc-prompt-end-marker t) |
| 834 | rcirc-prompt-end-marker))) | 835 | (1+ (point)) |
| 835 | (table (if (and (= beg rcirc-prompt-end-marker) | 836 | rcirc-prompt-end-marker))) |
| 836 | (eq (char-after beg) ?/)) | 837 | (table (if (and (= beg rcirc-prompt-end-marker) |
| 837 | (delete-dups | 838 | (eq (char-after beg) ?/)) |
| 838 | (nconc | 839 | (delete-dups |
| 839 | (sort (copy-sequence rcirc-client-commands) 'string-lessp) | 840 | (nconc (sort (copy-sequence rcirc-client-commands) |
| 840 | (sort (copy-sequence rcirc-server-commands) 'string-lessp))) | 841 | 'string-lessp) |
| 841 | (rcirc-channel-nicks (rcirc-buffer-process) rcirc-target)))) | 842 | (sort (copy-sequence rcirc-server-commands) |
| 842 | (list beg (point) table))) | 843 | 'string-lessp))) |
| 844 | (rcirc-channel-nicks (rcirc-buffer-process) | ||
| 845 | rcirc-target)))) | ||
| 846 | (list beg (point) table)))) | ||
| 843 | 847 | ||
| 844 | (defvar rcirc-completions nil) | 848 | (defvar rcirc-completions nil) |
| 845 | (defvar rcirc-completion-start nil) | 849 | (defvar rcirc-completion-start nil) |
| @@ -848,6 +852,8 @@ The list is updated automatically by `defun-rcirc-command'.") | |||
| 848 | "Cycle through completions from list of nicks in channel or IRC commands. | 852 | "Cycle through completions from list of nicks in channel or IRC commands. |
| 849 | IRC command completion is performed only if '/' is the first input char." | 853 | IRC command completion is performed only if '/' is the first input char." |
| 850 | (interactive) | 854 | (interactive) |
| 855 | (unless (rcirc-looking-at-input) | ||
| 856 | (error "Point not located after rcirc prompt")) | ||
| 851 | (if (eq last-command this-command) | 857 | (if (eq last-command this-command) |
| 852 | (setq rcirc-completions | 858 | (setq rcirc-completions |
| 853 | (append (cdr rcirc-completions) (list (car rcirc-completions)))) | 859 | (append (cdr rcirc-completions) (list (car rcirc-completions)))) |
| @@ -855,9 +861,10 @@ IRC command completion is performed only if '/' is the first input char." | |||
| 855 | (table (rcirc-completion-at-point))) | 861 | (table (rcirc-completion-at-point))) |
| 856 | (setq rcirc-completion-start (car table)) | 862 | (setq rcirc-completion-start (car table)) |
| 857 | (setq rcirc-completions | 863 | (setq rcirc-completions |
| 858 | (all-completions (buffer-substring rcirc-completion-start | 864 | (and rcirc-completion-start |
| 859 | (cadr table)) | 865 | (all-completions (buffer-substring rcirc-completion-start |
| 860 | (nth 2 table))))) | 866 | (cadr table)) |
| 867 | (nth 2 table)))))) | ||
| 861 | (let ((completion (car rcirc-completions))) | 868 | (let ((completion (car rcirc-completions))) |
| 862 | (when completion | 869 | (when completion |
| 863 | (delete-region rcirc-completion-start (point)) | 870 | (delete-region rcirc-completion-start (point)) |
diff --git a/lisp/simple.el b/lisp/simple.el index 7391ff82585..bd7d5da257e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -3392,16 +3392,16 @@ and KILLP is t if a prefix arg was specified." | |||
| 3392 | (delete-char 1))) | 3392 | (delete-char 1))) |
| 3393 | (forward-char -1) | 3393 | (forward-char -1) |
| 3394 | (setq count (1- count)))))) | 3394 | (setq count (1- count)))))) |
| 3395 | (delete-backward-char | 3395 | (let* ((skip (cond ((eq backward-delete-char-untabify-method 'hungry) " \t") |
| 3396 | (let ((skip (cond ((eq backward-delete-char-untabify-method 'hungry) " \t") | ||
| 3397 | ((eq backward-delete-char-untabify-method 'all) | 3396 | ((eq backward-delete-char-untabify-method 'all) |
| 3398 | " \t\n\r")))) | 3397 | " \t\n\r"))) |
| 3399 | (if skip | 3398 | (n (if skip |
| 3400 | (let ((wh (- (point) (save-excursion (skip-chars-backward skip) | 3399 | (let ((wh (- (point) (save-excursion (skip-chars-backward skip) |
| 3401 | (point))))) | 3400 | (point))))) |
| 3402 | (+ arg (if (zerop wh) 0 (1- wh)))) | 3401 | (+ arg (if (zerop wh) 0 (1- wh)))) |
| 3403 | arg)) | 3402 | arg))) |
| 3404 | killp)) | 3403 | ;; Avoid warning about delete-backward-char |
| 3404 | (with-no-warnings (delete-backward-char n killp)))) | ||
| 3405 | 3405 | ||
| 3406 | (defun zap-to-char (arg char) | 3406 | (defun zap-to-char (arg char) |
| 3407 | "Kill up to and including ARGth occurrence of CHAR. | 3407 | "Kill up to and including ARGth occurrence of CHAR. |
diff --git a/lisp/subr.el b/lisp/subr.el index 6f39a41709e..8ea4becdc11 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -1101,6 +1101,8 @@ is converted into a string by expressing it in decimal." | |||
| 1101 | 1101 | ||
| 1102 | (make-obsolete-variable 'define-key-rebound-commands nil "23.2") | 1102 | (make-obsolete-variable 'define-key-rebound-commands nil "23.2") |
| 1103 | (make-obsolete-variable 'redisplay-end-trigger-functions 'jit-lock-register "23.1") | 1103 | (make-obsolete-variable 'redisplay-end-trigger-functions 'jit-lock-register "23.1") |
| 1104 | (make-obsolete-variable 'deferred-action-list 'post-command-hook "24.1") | ||
| 1105 | (make-obsolete-variable 'deferred-action-function 'post-command-hook "24.1") | ||
| 1104 | (make-obsolete 'window-redisplay-end-trigger nil "23.1") | 1106 | (make-obsolete 'window-redisplay-end-trigger nil "23.1") |
| 1105 | (make-obsolete 'set-window-redisplay-end-trigger nil "23.1") | 1107 | (make-obsolete 'set-window-redisplay-end-trigger nil "23.1") |
| 1106 | 1108 | ||
diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el index fa731e77a6e..cb1c181fa61 100644 --- a/lisp/vc/log-view.el +++ b/lisp/vc/log-view.el | |||
| @@ -121,9 +121,6 @@ | |||
| 121 | :group 'pcl-cvs | 121 | :group 'pcl-cvs |
| 122 | :prefix "log-view-") | 122 | :prefix "log-view-") |
| 123 | 123 | ||
| 124 | ;; Needed because log-view-mode-map inherits from widget-keymap. (Bug#5311) | ||
| 125 | (require 'wid-edit) | ||
| 126 | |||
| 127 | (easy-mmode-defmap log-view-mode-map | 124 | (easy-mmode-defmap log-view-mode-map |
| 128 | '( | 125 | '( |
| 129 | ;; FIXME: (copy-keymap special-mode-map) instead | 126 | ;; FIXME: (copy-keymap special-mode-map) instead |