Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 102923. ------------------------------------------------------------ revno: 102923 committer: Jay Belanger branch nick: trunk timestamp: Thu 2011-01-20 22:54:37 -0600 message: calc/calc-undo.el (calc-undo): Autoload it. calc/calc-ext.el (calc-init-extensions): Remove keybindings and autoload for `calc-undo'. calc/calc.el (calc-mode-map): Add keybindings for `calc-undo'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-01-21 03:48:26 +0000 +++ lisp/ChangeLog 2011-01-21 04:54:37 +0000 @@ -1,8 +1,12 @@ 2011-01-21 Jay Belanger - * calc/calc-prog.el - calc/calc-graph.el - calc/calc-map.el: Change `arglist' to `math-arglist' throughout. + * calc/calc-undo.el (calc-undo): Autoload it. + * calc/calc-ext.el (calc-init-extensions): Remove keybindings + and autoload for `calc-undo'. + * calc/calc.el (calc-mode-map): Add keybindings for `calc-undo'. + * calc/calc-prog.el: + * calc/calc-graph.el: + * calc/calc-map.el: Change `arglist' to `math-arglist' throughout. 2011-01-21 Štěpán Němec (tiny change) === modified file 'lisp/calc/calc-ext.el' --- lisp/calc/calc-ext.el 2011-01-21 01:04:56 +0000 +++ lisp/calc/calc-ext.el 2011-01-21 04:54:37 +0000 @@ -136,7 +136,6 @@ (define-key calc-mode-map "\C-w" 'calc-kill-region) (define-key calc-mode-map "\M-w" 'calc-copy-region-as-kill) (define-key calc-mode-map "\M-\C-w" 'kill-ring-save) - (define-key calc-mode-map [remap undo] 'calc-undo) (define-key calc-mode-map "\M-\C-m" 'calc-last-args) (define-key calc-mode-map "a" nil) @@ -1155,7 +1154,7 @@ calc-trail-out calc-trail-previous calc-trail-scroll-left calc-trail-scroll-right calc-trail-yank) - ("calc-undo" calc-last-args calc-redo calc-undo) + ("calc-undo" calc-last-args calc-redo) ("calc-units" calc-autorange-units calc-base-units calc-convert-temperature calc-convert-units calc-define-unit === modified file 'lisp/calc/calc-undo.el' --- lisp/calc/calc-undo.el 2011-01-15 23:16:57 +0000 +++ lisp/calc/calc-undo.el 2011-01-21 04:54:37 +0000 @@ -32,6 +32,7 @@ ;;; Undo. +;;;###autoload (defun calc-undo (n) (interactive "p") (when calc-executing-macro === modified file 'lisp/calc/calc.el' --- lisp/calc/calc.el 2011-01-15 23:16:57 +0000 +++ lisp/calc/calc.el 2011-01-21 04:54:37 +0000 @@ -1061,6 +1061,7 @@ (define-key map "\C-j" 'calc-over) (define-key map "\C-y" 'calc-yank) (define-key map [mouse-2] 'calc-yank) + (define-key map [remap undo] 'calc-undo) (mapc (lambda (x) (define-key map (char-to-string x) 'undefined)) "lOW") ------------------------------------------------------------ revno: 102922 committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2011-01-21 04:16:57 +0000 message: gnus-art.el (gnus-article-remove-images, gnus-article-show-images): Widen article buffer. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-01-20 23:43:27 +0000 +++ lisp/gnus/ChangeLog 2011-01-21 04:16:57 +0000 @@ -1,3 +1,8 @@ +2011-01-21 Katsumi Yamaoka + + * gnus-art.el (gnus-article-remove-images, gnus-article-show-images): + Widen article buffer. + 2011-01-20 Stefan Monnier * mm-util.el (mm-find-buffer-file-coding-system): Don't forget to kill === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2011-01-20 23:43:27 +0000 +++ lisp/gnus/gnus-art.el 2011-01-21 04:16:57 +0000 @@ -2275,19 +2275,23 @@ "Remove all images from the article buffer." (interactive) (gnus-with-article-buffer - (dolist (elem gnus-article-image-alist) - (gnus-delete-images (car elem))))) + (save-restriction + (widen) + (dolist (elem gnus-article-image-alist) + (gnus-delete-images (car elem)))))) (defun gnus-article-show-images () "Show any images that are in the HTML-rendered article buffer. This only works if the article in question is HTML." (interactive) (gnus-with-article-buffer - (dolist (region (gnus-find-text-property-region (point-min) (point-max) - 'image-displayer)) - (destructuring-bind (start end function) region - (funcall function (get-text-property start 'image-url) - start end))))) + (save-restriction + (widen) + (dolist (region (gnus-find-text-property-region (point-min) (point-max) + 'image-displayer)) + (destructuring-bind (start end function) region + (funcall function (get-text-property start 'image-url) + start end)))))) (defun gnus-article-treat-fold-newsgroups () "Unfold folded message headers. ------------------------------------------------------------ revno: 102921 committer: Jay Belanger branch nick: trunk timestamp: Thu 2011-01-20 21:48:26 -0600 message: calc/calc-prog.el calc/calc-graph.el calc/calc-map.el: Change `arglist' to `math-arglist' throughout. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-01-21 01:04:56 +0000 +++ lisp/ChangeLog 2011-01-21 03:48:26 +0000 @@ -1,3 +1,9 @@ +2011-01-21 Jay Belanger + + * calc/calc-prog.el + calc/calc-graph.el + calc/calc-map.el: Change `arglist' to `math-arglist' throughout. + 2011-01-21 Štěpán Němec (tiny change) * calc/calc-ext.el (calc-init-extensions): Map all `undo' === modified file 'lisp/calc/calc-graph.el' --- lisp/calc/calc-graph.el 2011-01-15 23:16:57 +0000 +++ lisp/calc/calc-graph.el 2011-01-21 03:48:26 +0000 @@ -575,16 +575,16 @@ (setq calc-graph-xstep 1) (error "%s is not a suitable basis for %s" calc-graph-xname calc-graph-yname))))) (or (math-realp calc-graph-yvalue) - (let ((arglist nil)) + (let ((math-arglist nil)) (setq calc-graph-yvalue (math-evaluate-expr calc-graph-yvalue)) (calc-default-formula-arglist calc-graph-yvalue) - (or arglist + (or math-arglist (error "%s does not contain any unassigned variables" calc-graph-yname)) - (and (cdr arglist) + (and (cdr math-arglist) (error "%s contains more than one variable: %s" - calc-graph-yname arglist)) + calc-graph-yname math-arglist)) (setq calc-graph-yvalue (math-expr-subst calc-graph-yvalue - (math-build-var-name (car arglist)) + (math-build-var-name (car math-arglist)) '(var DUMMY var-DUMMY))))) (setq calc-graph-ycache (assoc calc-graph-yvalue calc-graph-data-cache)) (delq calc-graph-ycache calc-graph-data-cache) @@ -736,17 +736,17 @@ calc-graph-zp calc-graph-yvalue calc-graph-xvec t)) (or (math-realp calc-graph-yvalue) - (let ((arglist nil)) + (let ((math-arglist nil)) (setq calc-graph-yvalue (math-evaluate-expr calc-graph-yvalue)) (calc-default-formula-arglist calc-graph-yvalue) - (setq arglist (sort arglist 'string-lessp)) - (or (cdr arglist) + (setq math-arglist (sort math-arglist 'string-lessp)) + (or (cdr math-arglist) (error "%s does not contain enough unassigned variables" calc-graph-yname)) - (and (cdr (cdr arglist)) - (error "%s contains too many variables: %s" calc-graph-yname arglist)) + (and (cdr (cdr math-arglist)) + (error "%s contains too many variables: %s" calc-graph-yname math-arglist)) (setq calc-graph-yvalue (math-multi-subst calc-graph-yvalue (mapcar 'math-build-var-name - arglist) + math-arglist) '((var DUMMY var-DUMMY) (var DUMMY2 var-DUMMY2)))))) (if (setq calc-graph-xvec (eq (car-safe calc-graph-xvalue) 'vec)) === modified file 'lisp/calc/calc-map.el' --- lisp/calc/calc-map.el 2011-01-15 23:16:57 +0000 +++ lisp/calc/calc-map.el 2011-01-21 03:48:26 +0000 @@ -572,7 +572,7 @@ (and nargs forcenargs (/= nargs forcenargs) (>= nargs 0) (error "Must be a %d-argument operator" nargs))) ((memq key '(?\$ ?\')) - (let* ((arglist nil) + (let* ((math-arglist nil) (has-args nil) (record-entry nil) (expr (if (eq key ?\$) @@ -592,13 +592,13 @@ (if (> calc-dollar-used 0) (progn (setq has-args calc-dollar-used - arglist (calc-invent-args has-args)) + math-arglist (calc-invent-args has-args)) (math-multi-subst (car func) - (reverse arglist) - arglist)) + (reverse math-arglist) + math-arglist)) (if (> calc-hashes-used 0) (setq has-args calc-hashes-used - arglist (calc-invent-args has-args))) + math-arglist (calc-invent-args has-args))) (car func)))))) (if (eq (car-safe expr) 'calcFunc-lambda) (setq oper (list "$" (- (length expr) 2) expr) @@ -607,16 +607,16 @@ (progn (calc-default-formula-arglist expr) (setq record-entry t - arglist (sort arglist 'string-lessp)) + math-arglist (sort math-arglist 'string-lessp)) (if calc-verify-arglist - (setq arglist (read-from-minibuffer + (setq math-arglist (read-from-minibuffer "Function argument list: " - (if arglist - (prin1-to-string arglist) + (if math-arglist + (prin1-to-string math-arglist) "()") minibuffer-local-map t))) - (setq arglist (mapcar (function + (setq math-arglist (mapcar (function (lambda (x) (list 'var x @@ -624,10 +624,10 @@ (concat "var-" (symbol-name x)))))) - arglist)))) + math-arglist)))) (setq oper (list "$" - (length arglist) - (append '(calcFunc-lambda) arglist + (length math-arglist) + (append '(calcFunc-lambda) math-arglist (list expr))) done t)) (if record-entry === modified file 'lisp/calc/calc-prog.el' --- lisp/calc/calc-prog.el 2011-01-15 23:16:57 +0000 +++ lisp/calc/calc-prog.el 2011-01-21 03:48:26 +0000 @@ -171,17 +171,17 @@ (interactive) (calc-wrapper (let* ((form (calc-top 1)) - (arglist nil) + (math-arglist nil) (is-lambda (and (eq (car-safe form) 'calcFunc-lambda) (>= (length form) 2))) odef key keyname cmd cmd-base cmd-base-default func calc-user-formula-alist is-symb) (if is-lambda - (setq arglist (mapcar (function (lambda (x) (nth 1 x))) + (setq math-arglist (mapcar (function (lambda (x) (nth 1 x))) (nreverse (cdr (reverse (cdr form))))) form (nth (1- (length form)) form)) (calc-default-formula-arglist form) - (setq arglist (sort arglist 'string-lessp))) + (setq math-arglist (sort math-arglist 'string-lessp))) (message "Define user key: z-") (setq key (read-char)) (if (= (calc-user-function-classify key) 0) @@ -267,17 +267,17 @@ (format "%05d" (% (random) 10000))))))) (if is-lambda - (setq calc-user-formula-alist arglist) + (setq calc-user-formula-alist math-arglist) (while (progn (setq calc-user-formula-alist (read-from-minibuffer "Function argument list: " - (if arglist - (prin1-to-string arglist) + (if math-arglist + (prin1-to-string math-arglist) "()") minibuffer-local-map t)) - (and (not (calc-subsetp calc-user-formula-alist arglist)) + (and (not (calc-subsetp calc-user-formula-alist math-arglist)) (not (y-or-n-p "Okay for arguments that don't appear in formula to be ignored? ")))))) (setq is-symb (and calc-user-formula-alist @@ -328,14 +328,14 @@ (setcdr kmap (cons (cons key cmd) (cdr kmap))))))) (message ""))) -(defvar arglist) ; dynamically bound in all callers +(defvar math-arglist) ; dynamically bound in all callers (defun calc-default-formula-arglist (form) (if (consp form) (if (eq (car form) 'var) - (if (or (memq (nth 1 form) arglist) + (if (or (memq (nth 1 form) math-arglist) (math-const-var form)) () - (setq arglist (cons (nth 1 form) arglist))) + (setq math-arglist (cons (nth 1 form) math-arglist))) (calc-default-formula-arglist-step (cdr form))))) (defun calc-default-formula-arglist-step (l) @@ -394,23 +394,23 @@ (intern (concat "calcFunc-" x)))))))) (comps (get func 'math-compose-forms)) entry entry2 - (arglist nil) + (math-arglist nil) (calc-user-formula-alist nil)) (if (math-zerop comp) (if (setq entry (assq calc-language comps)) (put func 'math-compose-forms (delq entry comps))) (calc-default-formula-arglist comp) - (setq arglist (sort arglist 'string-lessp)) + (setq math-arglist (sort math-arglist 'string-lessp)) (while (progn (setq calc-user-formula-alist (read-from-minibuffer "Composition argument list: " - (if arglist - (prin1-to-string arglist) + (if math-arglist + (prin1-to-string math-arglist) "()") minibuffer-local-map t)) - (and (not (calc-subsetp calc-user-formula-alist arglist)) + (and (not (calc-subsetp calc-user-formula-alist math-arglist)) (y-or-n-p "Okay for arguments that don't appear in formula to be invisible? ")))) (or (setq entry (assq calc-language comps)) ------------------------------------------------------------ revno: 102920 author: Štěpán Němec (tiny change) committer: Jay Belanger branch nick: trunk timestamp: Thu 2011-01-20 19:04:56 -0600 message: calc/calc-ext.el (calc-init-extensions): Map all `undo' keybindings to `calc-undo'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-01-20 22:36:12 +0000 +++ lisp/ChangeLog 2011-01-21 01:04:56 +0000 @@ -1,3 +1,8 @@ +2011-01-21 Štěpán Němec (tiny change) + + * calc/calc-ext.el (calc-init-extensions): Map all `undo' + keybindings to `calc-undo'. + 2011-01-20 Stefan Monnier Don't mess with *temp*. === modified file 'lisp/calc/calc-ext.el' --- lisp/calc/calc-ext.el 2011-01-16 02:21:30 +0000 +++ lisp/calc/calc-ext.el 2011-01-21 01:04:56 +0000 @@ -136,8 +136,7 @@ (define-key calc-mode-map "\C-w" 'calc-kill-region) (define-key calc-mode-map "\M-w" 'calc-copy-region-as-kill) (define-key calc-mode-map "\M-\C-w" 'kill-ring-save) - (define-key calc-mode-map "\C-_" 'calc-undo) - (define-key calc-mode-map "\C-xu" 'calc-undo) + (define-key calc-mode-map [remap undo] 'calc-undo) (define-key calc-mode-map "\M-\C-m" 'calc-last-args) (define-key calc-mode-map "a" nil) ------------------------------------------------------------ revno: 102919 author: Julien Danjou committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2011-01-20 23:43:27 +0000 message: mm-decode.el (mm-inline-media-tests): Add text/x-sh. gnus-art.el (gnus-mime-inline-part): Use mm-display-inline rather than mm-insert-inline to insert inline part: this respect mm-inline-media-tests displayers. mm-view.el (mm-display-shell-script-inline): New function. mm-decode.el (mm-inline-media-tests): Add x-shellscript and x-sh. mm-uu.el (mm-uu-type-alist): Add org block. (mm-uu-org-src-code-block-extract): New function. mm-view.el (mm-display-org-inline): New function. mm-decode.el (mm-automatic-display): Add text/org. mailcap.el (mailcap-mime-extensions): Add .org. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-01-20 22:36:12 +0000 +++ lisp/gnus/ChangeLog 2011-01-20 23:43:27 +0000 @@ -4,6 +4,27 @@ the temp buffer. * message.el (message-mailer-swallows-blank-line): Use with-temp-buffer. +2011-01-20 Julien Danjou + + * mm-decode.el (mm-inline-media-tests): Add text/x-sh. + + * gnus-art.el (gnus-mime-inline-part): Use mm-display-inline rather + than mm-insert-inline to insert inline part: this respect + mm-inline-media-tests displayers. + + * mm-view.el (mm-display-shell-script-inline): New function. + + * mm-decode.el (mm-inline-media-tests): Add x-shellscript and x-sh. + + * mm-uu.el (mm-uu-type-alist): Add org block. + (mm-uu-org-src-code-block-extract): New function. + + * mm-view.el (mm-display-org-inline): New function. + + * mm-decode.el (mm-automatic-display): Add text/org. + + * mailcap.el (mailcap-mime-extensions): Add .org. + 2011-01-19 Katsumi Yamaoka * gnus-art.el (gnus-article-highlight): Remove argument passed to === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2011-01-19 22:35:53 +0000 +++ lisp/gnus/gnus-art.el 2011-01-20 23:43:27 +0000 @@ -5249,15 +5249,7 @@ (if (mm-handle-undisplayer handle) (mm-remove-part handle)))) (forward-line 2) - (mm-insert-inline - handle - (if (or coding-system - (and charset - (setq coding-system - (mm-charset-to-coding-system charset)) - (not (eq coding-system 'ascii)))) - (mm-decode-coding-string contents coding-system) - (mm-string-to-multibyte contents))) + (mm-display-inline handle) (goto-char b))))) (defun gnus-mime-set-charset-parameters (handle charset) === modified file 'lisp/gnus/mailcap.el' --- lisp/gnus/mailcap.el 2011-01-14 17:18:41 +0000 +++ lisp/gnus/mailcap.el 2011-01-20 23:43:27 +0000 @@ -910,7 +910,8 @@ (".zip" . "application/zip") (".ai" . "application/postscript") (".jpe" . "image/jpeg") - (".jpeg" . "image/jpeg")) + (".jpeg" . "image/jpeg") + (".org" . "text/org")) "An alist of file extensions and corresponding MIME content-types. This exists for you to customize the information in Lisp. It is merged with values from mailcap files by `mailcap-parse-mimetypes'.") === modified file 'lisp/gnus/mm-decode.el' --- lisp/gnus/mm-decode.el 2011-01-16 02:21:30 +0000 +++ lisp/gnus/mm-decode.el 2011-01-20 23:43:27 +0000 @@ -237,7 +237,11 @@ (lambda (handle) (fboundp 'diff-mode))) ("application/emacs-lisp" mm-display-elisp-inline identity) ("application/x-emacs-lisp" mm-display-elisp-inline identity) + ("application/x-shellscript" mm-display-shell-script-inline identity) + ("application/x-sh" mm-display-shell-script-inline identity) + ("text/x-sh" mm-display-shell-script-inline identity) ("text/dns" mm-display-dns-inline identity) + ("text/org" mm-display-org-inline identity) ("text/html" mm-inline-text-html (lambda (handle) @@ -313,7 +317,8 @@ "application/pkcs7-signature" "application/x-pkcs7-mime" "application/pkcs7-mime" ;; Mutt still uses this even though it has already been withdrawn. - "application/pgp\\'") + "application/pgp\\'" + "text/org") "A list of MIME types to be displayed automatically." :type '(repeat regexp) :group 'mime-display) === modified file 'lisp/gnus/mm-uu.el' --- lisp/gnus/mm-uu.el 2011-01-14 17:18:41 +0000 +++ lisp/gnus/mm-uu.el 2011-01-20 23:43:27 +0000 @@ -186,7 +186,15 @@ "^\\\\end{document}" mm-uu-latex-extract nil - mm-uu-latex-test)) + mm-uu-latex-test) + (org-src-code-block + "^[ \t]*#\\+begin_" + "^[ \t]*#\\+end_" + mm-uu-org-src-code-block-extract) + (org-meta-line + "^[ \t]*#\\+[[:alpha:]]+: " + "$" + mm-uu-org-src-code-block-extract)) "A list of specifications for non-MIME attachments. Each element consist of the following entries: label, start-regexp, end-regexp, extract-function, test-function. @@ -383,6 +391,10 @@ (list mm-dissect-disposition (cons 'filename file-name)))) +(defun mm-uu-org-src-code-block-extract () + (mm-make-handle (mm-uu-copy-to-buffer start-point end-point) + '("text/org"))) + (defvar gnus-newsgroup-name) (defun mm-uu-emacs-sources-test () === modified file 'lisp/gnus/mm-view.el' --- lisp/gnus/mm-view.el 2011-01-14 17:18:41 +0000 +++ lisp/gnus/mm-view.el 2011-01-20 23:43:27 +0000 @@ -632,6 +632,14 @@ (defun mm-display-dns-inline (handle) (mm-display-inline-fontify handle 'dns-mode)) +(defun mm-display-org-inline (handle) + "Show an Org mode text from HANDLE inline." + (mm-display-inline-fontify handle 'org-mode)) + +(defun mm-display-shell-script-inline (handle) + "Show an shell script from HANDLE inline." + (mm-display-inline-fontify handle 'shell-script-mode)) + ;; id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) ;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 } (defvar mm-pkcs7-signed-magic ------------------------------------------------------------ revno: 102918 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2011-01-20 17:36:12 -0500 message: Don't mess with *temp*. * lisp/obsolete/spell.el: Move from textmodes/spell.el. (spell-string): * lisp/term.el (term-read-input-ring): * lisp/startup.el (display-startup-echo-area-message): * lisp/progmodes/antlr-mode.el (antlr-directory-dependencies): * lisp/gnus/message.el (message-mailer-swallows-blank-line): * lisp/comint.el (comint-read-input-ring): Use with-temp-buffer. * lisp/international/mule.el (ctext-pre-write-conversion): Don't hardcode point-min==1. * lisp/gnus/mm-util.el (mm-find-buffer-file-coding-system): Don't forget to kill the temp buffer. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-01-20 18:13:30 +0000 +++ lisp/ChangeLog 2011-01-20 22:36:12 +0000 @@ -1,3 +1,16 @@ +2011-01-20 Stefan Monnier + + Don't mess with *temp*. + * obsolete/spell.el: Move from textmodes/spell.el. + (spell-string): + * term.el (term-read-input-ring): + * startup.el (display-startup-echo-area-message): + * progmodes/antlr-mode.el (antlr-directory-dependencies): + * comint.el (comint-read-input-ring): Use with-temp-buffer. + * international/mule.el (ctext-pre-write-conversion): Don't hardcode + point-min==1. + + 2011-01-20 Ken Manheimer * allout.el: Summary - migrate to defining allout mode using @@ -8,8 +21,8 @@ allout-mode-map is now a keymap by virtue of being a defalias to allout-mode-map-value, which contains the actual keymap structure. - (allout-mode): Use define-minor-mode rather than defun. Remove - now-unnecessary minor-mode setup activities from the body. + (allout-mode): Use define-minor-mode rather than defun. + Remove now-unnecessary minor-mode setup activities from the body. Specify :keymap as allout-mode-map so the minor-mode-map-alist entry will be '(allout-mode . allout-mode-map) - see allout-mode-map-value, below. Adjust docstring to track changes. @@ -19,7 +32,7 @@ keymap is allout-mode-map-value, via defalias. (allout-mode-map-value): The variable holding the actual mode keymap structure, by virtue of defalias from allout-mode-map. - (allout-compose-and-institute-keymap): Renamed from + (allout-compose-and-institute-keymap): Rename from allout-bind-keys, and including the binding-composition functionality of the former produce-allout-mode-map and allout-setup-mode-map. @@ -27,14 +40,14 @@ allout-setup-mode-map. Reassign allout-mode-map-value value and update the defalias. (allout-command-prefix) (allout-prefixed-keybindings) - (allout-unprefixed-keybindings): Use - allout-compose-and-institute-keymap to process the bindings. + (allout-unprefixed-keybindings): + Use allout-compose-and-institute-keymap to process the bindings. (allout-unprefixed-keybindings): Remove extraneous '?' question marks. (allout-prefixed-keybindings): Elide binding to (prefixed) \C-h - - user can customize if they want to use that binding. Bind - allout-copy-topic-as-kill to (prefixed) \M-k. Bind - allout-up-current-level to (prefixed) \C-u. (I think i mistakenly + user can customize if they want to use that binding. + Bind allout-copy-topic-as-kill to (prefixed) \M-k. + Bind allout-up-current-level to (prefixed) \C-u. (I think i mistakenly elided that, previously, instead of the one for \C-h.) (allout-hotspot-key-handler): Remove attempt to resolve the key through the literal key-string lookup on allout-keybindings-list. === modified file 'lisp/comint.el' --- lisp/comint.el 2011-01-16 02:21:30 +0000 +++ lisp/comint.el 2011-01-20 22:36:12 +0000 @@ -918,41 +918,36 @@ (message "Cannot read history file %s" comint-input-ring-file-name))) (t - (let* ((history-buf (get-buffer-create " *temp*")) - (file comint-input-ring-file-name) + (let* ((file comint-input-ring-file-name) (count 0) (size comint-input-ring-size) (ring (make-ring size))) - (unwind-protect - (with-current-buffer history-buf - (widen) - (erase-buffer) - (insert-file-contents file) - ;; Save restriction in case file is already visited... - ;; Watch for those date stamps in history files! - (goto-char (point-max)) - (let (start end history) - (while (and (< count size) - (re-search-backward comint-input-ring-separator - nil t) - (setq end (match-beginning 0))) - (setq start - (if (re-search-backward comint-input-ring-separator - nil t) - (match-end 0) - (point-min))) - (setq history (buffer-substring start end)) - (goto-char start) - (if (and (not (string-match comint-input-history-ignore - history)) - (or (null comint-input-ignoredups) - (ring-empty-p ring) - (not (string-equal (ring-ref ring 0) - history)))) - (progn - (ring-insert-at-beginning ring history) - (setq count (1+ count))))))) - (kill-buffer history-buf)) + (with-temp-buffer + (insert-file-contents file) + ;; Save restriction in case file is already visited... + ;; Watch for those date stamps in history files! + (goto-char (point-max)) + (let (start end history) + (while (and (< count size) + (re-search-backward comint-input-ring-separator + nil t) + (setq end (match-beginning 0))) + (setq start + (if (re-search-backward comint-input-ring-separator + nil t) + (match-end 0) + (point-min))) + (setq history (buffer-substring start end)) + (goto-char start) + (if (and (not (string-match comint-input-history-ignore + history)) + (or (null comint-input-ignoredups) + (ring-empty-p ring) + (not (string-equal (ring-ref ring 0) + history)))) + (progn + (ring-insert-at-beginning ring history) + (setq count (1+ count))))))) (setq comint-input-ring ring comint-input-ring-index nil))))) === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-01-19 22:35:53 +0000 +++ lisp/gnus/ChangeLog 2011-01-20 22:36:12 +0000 @@ -1,3 +1,9 @@ +2011-01-20 Stefan Monnier + + * mm-util.el (mm-find-buffer-file-coding-system): Don't forget to kill + the temp buffer. + * message.el (message-mailer-swallows-blank-line): Use with-temp-buffer. + 2011-01-19 Katsumi Yamaoka * gnus-art.el (gnus-article-highlight): Remove argument passed to @@ -22,8 +28,8 @@ 2011-01-13 Chong Yidong - * message.el (message-tool-bar-gnome): Tweak tool-bar items. Add - :vert-only tags. + * message.el (message-tool-bar-gnome): Tweak tool-bar items. + Add :vert-only tags. (message-mail): New arg RETURN-ACTION. (message-return-action): New var. (message-bury): Use it. @@ -38,8 +44,8 @@ * nnimap.el (nnimap-convert-partial-article): Protect against zero-length body parts. - * mm-decode.el (mm-preferred-alternative-precedence): Discourage - showing empty parts. + * mm-decode.el (mm-preferred-alternative-precedence): + Discourage showing empty parts. * gnus-int.el (gnus-request-accept-article): Don't try to update marks and stuff if the backend didn't return the article number. This fixes @@ -295,8 +301,8 @@ 2010-12-13 Lars Magne Ingebrigtsen - * gnus-sum.el (gnus-summary-enter-digest-group): Mention - gnus-auto-select-on-ephemeral-exit. + * gnus-sum.el (gnus-summary-enter-digest-group): + Mention gnus-auto-select-on-ephemeral-exit. * proto-stream.el (proto-stream-open-network-only): Fix the calling convention of the network-only option. @@ -535,8 +541,8 @@ (nnir-mode): Install nnir-specific hooks for updating the registry. * gnus-sum.el - (gnus-article-original-subject,gnus-newsgroup-original-name): Remove - obsolete variables. + (gnus-article-original-subject,gnus-newsgroup-original-name): + Remove obsolete variables. (gnus-summary-move-article): Remove use of obsolete variables. (gnus-summary-local-variables): Make move and delete hooks local to summary buffers. @@ -652,7 +658,7 @@ * nntp.el (nntp-open-connection): Report what the connection error is. - * proto-stream.el (open-protocol-stream): Renamed from + * proto-stream.el (open-protocol-stream): Rename from open-proto-stream. 2010-11-27 Lars Magne Ingebrigtsen @@ -933,8 +939,8 @@ * shr.el (shr-parse-style): Replace \n with space in style parsing. - * shr-color.el (shr-color-hsl-to-rgb-fractions): Use - shr-color-hue-to-rgb. + * shr-color.el (shr-color-hsl-to-rgb-fractions): + Use shr-color-hue-to-rgb. (shr-color->hexadecimal): Call shr-color-hsl-to-rgb-fractions. 2010-11-23 Lars Magne Ingebrigtsen === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2011-01-15 20:38:27 +0000 +++ lisp/gnus/message.el 2011-01-20 22:36:12 +0000 @@ -1184,14 +1184,11 @@ (if (and (string-match "sparc-sun-sunos\\(\\'\\|[^5]\\)" system-configuration) (file-readable-p "/etc/sendmail.cf") - (let ((buffer (get-buffer-create " *temp*"))) - (unwind-protect - (with-current-buffer buffer - (insert-file-contents "/etc/sendmail.cf") - (goto-char (point-min)) - (let ((case-fold-search nil)) - (re-search-forward "^OR\\>" nil t))) - (kill-buffer buffer)))) + (with-temp-buffer + (insert-file-contents "/etc/sendmail.cf") + (goto-char (point-min)) + (let ((case-fold-search nil)) + (re-search-forward "^OR\\>" nil t)))) ;; According to RFC822, "The field-name must be composed of printable ;; ASCII characters (i. e., characters that have decimal values between ;; 33 and 126, except colon)", i. e., any chars except ctl chars, === modified file 'lisp/gnus/mm-util.el' --- lisp/gnus/mm-util.el 2011-01-14 17:18:41 +0000 +++ lisp/gnus/mm-util.el 2011-01-20 22:36:12 +0000 @@ -1604,7 +1604,7 @@ (insert decomp) (setq filename (file-name-sans-extension filename))) (goto-char (point-min)) - (prog1 + (unwind-protect (cond ((boundp 'set-auto-coding-function) ;; Emacs (if filename === modified file 'lisp/international/mule.el' --- lisp/international/mule.el 2011-01-15 23:16:57 +0000 +++ lisp/international/mule.el 2011-01-20 22:36:12 +0000 @@ -1611,7 +1611,7 @@ (set-buffer (generate-new-buffer " *temp")) (set-buffer-multibyte (multibyte-string-p from)) (insert from) - (setq from 1 to (point-max))) + (setq from (point-min) to (point-max))) (save-restriction (narrow-to-region from to) (goto-char from) === renamed file 'lisp/textmodes/spell.el' => 'lisp/obsolete/spell.el' --- lisp/textmodes/spell.el 2011-01-16 02:21:30 +0000 +++ lisp/obsolete/spell.el 2011-01-20 22:36:12 +0000 @@ -5,6 +5,7 @@ ;; Maintainer: FSF ;; Keywords: wp, unix +;; Obsolete-since: 23.1 ;; This file is part of GNU Emacs. @@ -146,22 +147,21 @@ (defun spell-string (string) "Check spelling of string supplied as argument." (interactive "sSpell string: ") - (let ((buf (get-buffer-create " *temp*"))) - (with-current-buffer buf - (widen) - (erase-buffer) - (insert string "\n") - (if (string= "spell" spell-command) - (call-process-region (point-min) (point-max) "spell" - t t) - (call-process-region (point-min) (point-max) shell-file-name - t t nil "-c" spell-command)) - (if (= 0 (buffer-size)) - (message "%s is correct" string) - (goto-char (point-min)) - (while (search-forward "\n" nil t) - (replace-match " ")) - (message "%sincorrect" (buffer-substring 1 (point-max))))))) + (with-temp-buffer + (widen) + (erase-buffer) + (insert string "\n") + (if (string= "spell" spell-command) + (call-process-region (point-min) (point-max) "spell" + t t) + (call-process-region (point-min) (point-max) shell-file-name + t t nil "-c" spell-command)) + (if (= 0 (buffer-size)) + (message "%s is correct" string) + (goto-char (point-min)) + (while (search-forward "\n" nil t) + (replace-match " ")) + (message "%sincorrect" (buffer-substring 1 (point-max)))))) ;;;###autoload (make-obsolete 'spell-string "The `spell' package is obsolete - use `ispell'." "23.1") === modified file 'lisp/progmodes/antlr-mode.el' --- lisp/progmodes/antlr-mode.el 2011-01-15 23:16:57 +0000 +++ lisp/progmodes/antlr-mode.el 2011-01-20 22:36:12 +0000 @@ -2182,36 +2182,32 @@ export vocabulary specified in that file." (let ((grammar (directory-files dirname t "\\.g\\'"))) (when grammar - (let ((temp-buffer (get-buffer-create - (generate-new-buffer-name " *temp*"))) - (antlr-imenu-name nil) ; dynamic-let: no imenu - (expanded-regexp (concat (format (regexp-quote - (cadr antlr-special-file-formats)) - ".+") - "\\'")) + (let ((antlr-imenu-name nil) ; dynamic-let: no imenu + (expanded-regexp + (concat (format (regexp-quote + (cadr antlr-special-file-formats)) + ".+") + "\\'")) classes dependencies) - (unwind-protect - (with-current-buffer temp-buffer - (widen) ; just in case... - (dolist (file grammar) - (when (and (file-regular-p file) - (null (string-match expanded-regexp file))) - (insert-file-contents file t nil nil t) - (normal-mode t) ; necessary for major-mode, syntax + (with-temp-buffer + (dolist (file grammar) + (when (and (file-regular-p file) + (null (string-match expanded-regexp file))) + (insert-file-contents file t nil nil t) + (normal-mode t) ; necessary for major-mode, syntax ; table and `antlr-language' - (when (derived-mode-p 'antlr-mode) - (let* ((file-deps (antlr-file-dependencies)) - (file (car file-deps))) - (when file-deps - (dolist (class-def (caadr file-deps)) - (let ((file-evocab (cons file (cdr class-def))) - (class-spec (assoc (car class-def) classes))) - (if class-spec - (nconc (cdr class-spec) (list file-evocab)) - (push (list (car class-def) file-evocab) - classes)))) - (push file-deps dependencies))))))) - (kill-buffer temp-buffer)) + (when (derived-mode-p 'antlr-mode) + (let* ((file-deps (antlr-file-dependencies)) + (file (car file-deps))) + (when file-deps + (dolist (class-def (caadr file-deps)) + (let ((file-evocab (cons file (cdr class-def))) + (class-spec (assoc (car class-def) classes))) + (if class-spec + (nconc (cdr class-spec) (list file-evocab)) + (push (list (car class-def) file-evocab) + classes)))) + (push file-deps dependencies))))))) (cons (nreverse classes) (nreverse dependencies)))))) === modified file 'lisp/startup.el' --- lisp/startup.el 2011-01-16 02:21:30 +0000 +++ lisp/startup.el 2011-01-20 22:36:12 +0000 @@ -2017,7 +2017,7 @@ (defun display-startup-echo-area-message () (let ((resize-mini-windows t)) - (or noninteractive ;(input-pending-p) init-file-had-error + (or noninteractive ;(input-pending-p) init-file-had-error ;; t if the init file says to inhibit the echo area startup message. (and inhibit-startup-echo-area-message user-init-file @@ -2027,24 +2027,21 @@ (user-login-name) init-file-user))) ;; Wasn't set with custom; see if .emacs has a setq. - (let ((buffer (get-buffer-create " *temp*"))) - (prog1 - (condition-case nil - (with-current-buffer buffer - (insert-file-contents user-init-file) - (re-search-forward - (concat - "([ \t\n]*setq[ \t\n]+" - "inhibit-startup-echo-area-message[ \t\n]+" - (regexp-quote - (prin1-to-string - (if (equal init-file-user "") - (user-login-name) - init-file-user))) - "[ \t\n]*)") - nil t)) - (error nil)) - (kill-buffer buffer))))) + (condition-case nil + (with-temp-buffer + (insert-file-contents user-init-file) + (re-search-forward + (concat + "([ \t\n]*setq[ \t\n]+" + "inhibit-startup-echo-area-message[ \t\n]+" + (regexp-quote + (prin1-to-string + (if (equal init-file-user "") + (user-login-name) + init-file-user))) + "[ \t\n]*)") + nil t)) + (error nil)))) (message "%s" (startup-echo-area-message))))) (defun display-startup-screen (&optional concise) === modified file 'lisp/term.el' --- lisp/term.el 2011-01-16 02:21:30 +0000 +++ lisp/term.el 2011-01-20 22:36:12 +0000 @@ -1537,29 +1537,24 @@ (message "Cannot read history file %s" term-input-ring-file-name))) (t - (let ((history-buf (get-buffer-create " *temp*")) - (file term-input-ring-file-name) + (let ((file term-input-ring-file-name) (count 0) (ring (make-ring term-input-ring-size))) - (unwind-protect - (with-current-buffer history-buf - (widen) - (erase-buffer) - (insert-file-contents file) - ;; Save restriction in case file is already visited... - ;; Watch for those date stamps in history files! - (goto-char (point-max)) - (while (and (< count term-input-ring-size) - (re-search-backward "^[ \t]*\\([^#\n].*\\)[ \t]*$" - nil t)) - (let ((history (buffer-substring (match-beginning 1) - (match-end 1)))) - (when (or (null term-input-ignoredups) - (ring-empty-p ring) - (not (string-equal (ring-ref ring 0) history))) - (ring-insert-at-beginning ring history))) - (setq count (1+ count)))) - (kill-buffer history-buf)) + (with-temp-buffer + (insert-file-contents file) + ;; Save restriction in case file is already visited... + ;; Watch for those date stamps in history files! + (goto-char (point-max)) + (while (and (< count term-input-ring-size) + (re-search-backward "^[ \t]*\\([^#\n].*\\)[ \t]*$" + nil t)) + (let ((history (buffer-substring (match-beginning 1) + (match-end 1)))) + (when (or (null term-input-ignoredups) + (ring-empty-p ring) + (not (string-equal (ring-ref ring 0) history))) + (ring-insert-at-beginning ring history))) + (setq count (1+ count)))) (setq term-input-ring ring term-input-ring-index nil))))) === modified file 'src/ChangeLog' --- src/ChangeLog 2011-01-20 06:43:04 +0000 +++ src/ChangeLog 2011-01-20 22:36:12 +0000 @@ -667,9 +667,9 @@ 2011-01-11 Tassilo Horn - * image.c (imagemagick_load_image, Finit_image_library): Free - intermediate image after creating a MagickWand from it. Terminate - MagickWand environment after image loading. + * image.c (imagemagick_load_image, Finit_image_library): + Free intermediate image after creating a MagickWand from it. + Terminate MagickWand environment after image loading. 2011-01-10 Michael Albinus @@ -740,7 +740,7 @@ 2011-01-04 Jan Moringen - * dbusbind.c (Fdbus_register_method): Added optional parameter + * dbusbind.c (Fdbus_register_method): Add optional parameter dont_register_service. Updated docstring accordingly. 2011-01-04 Glenn Morris ------------------------------------------------------------ revno: 102917 committer: Ken Manheimer branch nick: trunk timestamp: Thu 2011-01-20 16:57:15 -0500 message: (allout-institute-keymap): Use fset instead of reapplying defalias. (allout-hotspot-key-handler): Check for non-control-modified bindings for hotspot characters if there is no control-modified versions. diff: === modified file 'lisp/allout.el' --- lisp/allout.el 2011-01-20 18:13:30 +0000 +++ lisp/allout.el 2011-01-20 21:57:15 +0000 @@ -169,10 +169,11 @@ ;; used in minor-mode-map-alist to indirect to the actual ;; allout-mode-map-var value, which can be adjusted and reassigned. + ;; allout-mode-map-value for keymap reference in various places: (setq allout-mode-map-value map) - ;; The defalias reexecution is necessary when allout-mode-map-value is - ;; changing from nil, and it doesn't hurt to do it every time, so: - (defalias 'allout-mode-map allout-mode-map-value)) + ;; the function value keymap of allout-mode-map is used in + ;; minor-mode-map-alist - update it: + (fset allout-mode-map allout-mode-map-value)) ;;;_ * intialize the mode map: ;; ensure that allout-mode-map has some setting even if allout-mode hasn't ;; been invoked: @@ -3416,13 +3417,18 @@ (not modified) (<= 33 key-num) (setq mapped-binding - ;; translate as a keybinding: - (key-binding (vconcat allout-command-prefix - (vector - (if (and (<= 97 key-num) ; "a" - (>= 122 key-num)) ; "z" - (- key-num 96) key-num))) - t))) + (or + ;; try control-modified versions of keys: + (key-binding (vconcat allout-command-prefix + (vector + (if (and (<= 97 key-num) ; "a" + (>= 122 key-num)) ; "z" + (- key-num 96) key-num))) + t) + ;; try non-modified versions of keys: + (key-binding (vconcat allout-command-prefix + (vector key-num)) + t)))) ;; Qualified as an allout command -- do hot-spot operation. (setq allout-post-goto-bullet t) ;; accept-defaults nil, or else we get allout-item-icon-key-handler. ------------------------------------------------------------ revno: 102916 committer: Ken Manheimer branch nick: trunk timestamp: Thu 2011-01-20 13:13:30 -0500 message: allout.el: Summary - migrate to defining allout mode using define-minor-mode instead of defun. Significantly clean-up internal keymap provisions, refactoring a bit and removing a lot of accumulated cruft. allout-mode-map is now a keymap by virtue of being an defalias to allout-mode-map-value, which contains the actual keymap structure. (allout-mode): Use define-minor-mode rather than defun. Remove now-unnecessary minor-mode setup activities from the body. Specify :keymap as allout-mode-map so the minor-mode-map-alist entry will be '(allout-mode . allout-mode-map) - see allout-mode-map-value, below. Adjust docstring to track changes. (allout-minor-mode): Remove this defalias, now that we're using define-minor-mode. (allout-mode-map): Set value to be 'allout-mode-map. The actual keymap is allout-mode-map-value, via defalias. (allout-mode-map-value): The variable holding the actual mode keymap structure, by virtue of defalias from allout-mode-map. (allout-compose-and-institute-keymap): Renamed from allout-bind-keys, and including the binding-composition functionality of the former produce-allout-mode-map and allout-setup-mode-map. (allout-institute-keymap): Take over the "setup" part of the former allout-setup-mode-map. Reassign allout-mode-map-value value and update the defalias. (allout-command-prefix) (allout-prefixed-keybindings) (allout-unprefixed-keybindings): Use allout-compose-and-institute-keymap to process the bindings. (allout-unprefixed-keybindings): Remove extraneous '?' question marks. (allout-prefixed-keybindings): Elide binding to (prefixed) \C-h - user can customize if they want to use that binding. Bind allout-copy-topic-as-kill to (prefixed) \M-k. Bind allout-up-current-level to (prefixed) \C-u. (I think i mistakenly elided that, previously, instead of the one for \C-h.) (allout-hotspot-key-handler): Remove attempt to resolve the key through the literal key-string lookup on allout-keybindings-list. That probably hasn't worked for a Long Time, and removal of allout-keybindings-list further simplifies the keybindings situation. (allout-pre-command-business): Use allout-mode-map-value instead of allout-mode-map. (allout-preempt-trailing-ctrl-h): Remove. The user can customize the bindings if they want to use a keybinding having a trailing \C-h. No deprecation needed since this feature was never in a release. (allout-keybindings-list): Remove. It's not been useful for a while. (See allout-hotspot-key-handler changes, above.) (produce-allout-mode-map): Remove. Consolidate into allout-compose-and-institute-keymap. (allout-mode-map-adjustments): Remove. No longer necessary with removal of allout-preempt-trailing-ctrl-h. (allout-setup-mode-map): Remove. Consolidate into allout-compose-and-institute-keymap and allout-institute-keymap. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-01-20 07:17:22 +0000 +++ lisp/ChangeLog 2011-01-20 18:13:30 +0000 @@ -1,3 +1,61 @@ +2011-01-20 Ken Manheimer + + * allout.el: Summary - migrate to defining allout mode using + define-minor-mode instead of defun. Significantly clean-up + internal keymap provisions, refactoring and, in the process, + removing a lot of accumulated cruft. + + allout-mode-map is now a keymap by virtue of being a defalias to + allout-mode-map-value, which contains the actual keymap structure. + + (allout-mode): Use define-minor-mode rather than defun. Remove + now-unnecessary minor-mode setup activities from the body. + Specify :keymap as allout-mode-map so the minor-mode-map-alist + entry will be '(allout-mode . allout-mode-map) - see + allout-mode-map-value, below. Adjust docstring to track changes. + (allout-minor-mode): Remove this defalias, now that we're using + define-minor-mode. + (allout-mode-map): Set value to be 'allout-mode-map. The actual + keymap is allout-mode-map-value, via defalias. + (allout-mode-map-value): The variable holding the actual mode + keymap structure, by virtue of defalias from allout-mode-map. + (allout-compose-and-institute-keymap): Renamed from + allout-bind-keys, and including the binding-composition + functionality of the former produce-allout-mode-map and + allout-setup-mode-map. + (allout-institute-keymap): Take over the "setup" part of the former + allout-setup-mode-map. Reassign allout-mode-map-value value and + update the defalias. + (allout-command-prefix) (allout-prefixed-keybindings) + (allout-unprefixed-keybindings): Use + allout-compose-and-institute-keymap to process the bindings. + (allout-unprefixed-keybindings): Remove extraneous '?' question + marks. + (allout-prefixed-keybindings): Elide binding to (prefixed) \C-h - + user can customize if they want to use that binding. Bind + allout-copy-topic-as-kill to (prefixed) \M-k. Bind + allout-up-current-level to (prefixed) \C-u. (I think i mistakenly + elided that, previously, instead of the one for \C-h.) + (allout-hotspot-key-handler): Remove attempt to resolve the key + through the literal key-string lookup on allout-keybindings-list. + That probably hasn't worked for a Long Time, and removal of + allout-keybindings-list further simplifies the keybindings + situation. + (allout-pre-command-business): Use allout-mode-map-value instead + of allout-mode-map. + (allout-preempt-trailing-ctrl-h): Remove. The user can customize + the bindings if they want to use a keybinding having a trailing + \C-h. No deprecation needed since this feature was never in a + release. + (allout-keybindings-list): Remove. It's not been useful for a + while. (See allout-hotspot-key-handler changes, above.) + (produce-allout-mode-map): Remove. Consolidate into + allout-compose-and-institute-keymap. + (allout-mode-map-adjustments): Remove. No longer necessary with + removal of allout-preempt-trailing-ctrl-h. + (allout-setup-mode-map): Remove. Consolidate into + allout-compose-and-institute-keymap and allout-institute-keymap. + 2011-01-20 Glenn Morris * vc/vc-svn.el (vc-svn-after-dir-status): Tweak previous change. === modified file 'lisp/allout.el' --- lisp/allout.el 2011-01-16 02:21:30 +0000 +++ lisp/allout.el 2011-01-20 18:13:30 +0000 @@ -108,23 +108,39 @@ ;;;_ + Layout, Mode, and Topic Header Configuration (defvar allout-command-prefix) ; defined below -(defvar allout-mode-map) ;;;_ > allout-keybindings incidentals: -;;;_ > allout-bind-keys &optional varname value -(defun allout-bind-keys (&optional varname value) - "Rebuild the `allout-mode-map' according to the keybinding specs. - -Useful standalone, to init the map, or in customizing the +;;;_ : internal key binding stuff - in this section for load-order. +;;;_ = allout-mode-map +(defvar allout-mode-map 'allout-mode-map + "Keybindings place-holder for (allout) outline minor mode. + +Do NOT set the value of this variable. Instead, customize +`allout-command-prefix', `allout-prefixed-keybindings', and +`allout-unprefixed-keybindings'.") +;;;_ = allout-mode-map-value +(defvar allout-mode-map-value nil + "Keymap for allout outline minor mode. + +Do NOT set the value of this variable. Instead, customize +`allout-command-prefix', `allout-prefixed-keybindings', and +`allout-unprefixed-keybindings'.") +;;;_ = make allout-mode-map-value an alias for allout-mode-map: +;; this needs to be revised when the value is changed, sigh. +(defalias 'allout-mode-map allout-mode-map-value) +;;;_ > allout-compose-and-institute-keymap (&optional varname value) +(defun allout-compose-and-institute-keymap (&optional varname value) + "Create the allout keymap according to the keybinding specs, and set it. + +Useful standalone or to effect customizations of the respective allout-mode keybinding variables, `allout-command-prefix', `allout-prefixed-keybindings', and `allout-unprefixed-keybindings'" ;; Set the customization variable, if any: (when varname (set-default varname value)) - (let ((map (make-sparse-keymap)) - key) + (let ((map (make-sparse-keymap))) (when (boundp 'allout-prefixed-keybindings) - ;; Be tolerant of the moments when the variables are first being defined. + ;; tolerate first definitions of the variables: (dolist (entry allout-prefixed-keybindings) (define-key map ;; XXX vector vs non-vector key descriptions? @@ -134,9 +150,33 @@ (when (boundp 'allout-unprefixed-keybindings) (dolist (entry allout-unprefixed-keybindings) (define-key map (car (read-from-string (car entry))) (cadr entry)))) - (setq allout-mode-map map) - map - )) + (substitute-key-definition 'beginning-of-line 'allout-beginning-of-line + map global-map) + (substitute-key-definition 'move-beginning-of-line 'allout-beginning-of-line + map global-map) + (substitute-key-definition 'end-of-line 'allout-end-of-line + map global-map) + (substitute-key-definition 'move-end-of-line 'allout-end-of-line + map global-map) + (allout-institute-keymap map))) +;;;_ > allout-institute-keymap (map) +(defun allout-institute-keymap (map) + "Associate allout-mode bindings with allout as a minor mode." + ;; Architecture: + ;; allout-mode-map var is a keymap by virtue of being a defalias for + ;; allout-mode-map-value, which has the actual keymap value. + ;; allout-mode-map's symbol value is just 'allout-mode-map, so it can be + ;; used in minor-mode-map-alist to indirect to the actual + ;; allout-mode-map-var value, which can be adjusted and reassigned. + + (setq allout-mode-map-value map) + ;; The defalias reexecution is necessary when allout-mode-map-value is + ;; changing from nil, and it doesn't hurt to do it every time, so: + (defalias 'allout-mode-map allout-mode-map-value)) +;;;_ * intialize the mode map: +;; ensure that allout-mode-map has some setting even if allout-mode hasn't +;; been invoked: +(allout-compose-and-institute-keymap) ;;;_ = allout-command-prefix (defcustom allout-command-prefix "\C-c " "Key sequence to be used as prefix for outline mode command key bindings. @@ -145,7 +185,7 @@ willing to let allout use a bunch of \C-c keybindings." :type 'string :group 'allout-keybindings - :set 'allout-bind-keys) + :set 'allout-compose-and-institute-keymap) ;;;_ = allout-keybindings-binding (define-widget 'allout-keybindings-binding 'lazy "Structure of allout keybindings customization items." @@ -157,7 +197,7 @@ (defcustom allout-prefixed-keybindings '(("[(control ?n)]" allout-next-visible-heading) ("[(control ?p)]" allout-previous-visible-heading) -;; ("[(control ?u)]" allout-up-current-level) + ("[(control ?u)]" allout-up-current-level) ("[(control ?f)]" allout-forward-current-level) ("[(control ?b)]" allout-backward-current-level) ("[(control ?a)]" allout-beginning-of-current-entry) @@ -166,7 +206,8 @@ ("[(control ?i)]" allout-show-children) ("[(control ?s)]" allout-show-current-subtree) ("[(control ?t)]" allout-toggle-current-subtree-exposure) - ("[(control ?h)]" allout-hide-current-subtree) +;; Let user customize if they want to preempt describe-prefix-bindings ^h use. +;; ("[(control ?h)]" allout-hide-current-subtree) ("[?h]" allout-hide-current-subtree) ("[(control ?o)]" allout-show-current-entry) ("[?!]" allout-show-all) @@ -181,7 +222,7 @@ ("[?*]" allout-rebullet-current-heading) ("[?']" allout-number-siblings) ("[(control ?k)]" allout-kill-topic) - ("[??]" allout-copy-topic-as-kill) + ("[(meta ?k)]" allout-copy-topic-as-kill) ("[?@]" allout-resolve-xref) ("[?=?c]" allout-copy-exposed-to-buffer) ("[?=?i]" allout-indented-exposed-to-buffer) @@ -205,14 +246,14 @@ prevails." :type 'allout-keybindings-binding :group 'allout-keybindings - :set 'allout-bind-keys + :set 'allout-compose-and-institute-keymap ) ;;;_ = allout-unprefixed-keybindings (defcustom allout-unprefixed-keybindings '(("[(control ?k)]" allout-kill-line) - ("[??(meta ?k)]" allout-copy-line-as-kill) + ("[(meta ?k)]" allout-copy-line-as-kill) ("[(control ?y)]" allout-yank) - ("[??(meta ?y)]" allout-yank-pop) + ("[(meta ?y)]" allout-yank-pop) ) "Allout-mode functions bound to keys without any added prefix. @@ -228,68 +269,9 @@ See the existing keys for examples." :type 'allout-keybindings-binding :group 'allout-keybindings - :set 'allout-bind-keys + :set 'allout-compose-and-institute-keymap ) -;;;_ = allout-preempt-trailing-ctrl-h -(defcustom allout-preempt-trailing-ctrl-h nil - "Use -\C-h, instead of leaving it for describe-prefix-bindings?" - :type 'boolean - :group 'allout) - -;;;_ = allout-keybindings-list -;;; You have to reactivate allout-mode to change this var's current setting. -(defvar allout-keybindings-list () - "*List of `allout-mode' key / function bindings, for `allout-mode-map'. -String or vector key will be prefaced with `allout-command-prefix', -unless optional third, non-nil element is present.") -(setq allout-keybindings-list - '( - ; Motion commands: - ("\C-n" allout-next-visible-heading) - ("\C-p" allout-previous-visible-heading) - ("\C-u" allout-up-current-level) - ("\C-f" allout-forward-current-level) - ("\C-b" allout-backward-current-level) - ("\C-a" allout-beginning-of-current-entry) - ("\C-e" allout-end-of-entry) - ; Exposure commands: - ([(control i)] allout-show-children) ; xemacs translates "\C-i" to tab - ("\C-i" allout-show-children) ; but we still need this for hotspot - ("\C-s" allout-show-current-subtree) - ;; binding to \C-h is included if allout-preempt-trailing-ctrl-h, - ;; so user controls whether or not to preempt the conventional ^H - ;; binding to help-command. - ("\C-h" allout-hide-current-subtree) - ("\C-t" allout-toggle-current-subtree-exposure) - ("h" allout-hide-current-subtree) - ("\C-o" allout-show-current-entry) - ("!" allout-show-all) - ("x" allout-toggle-current-subtree-encryption) - ; Alteration commands: - (" " allout-open-sibtopic) - ("." allout-open-subtopic) - ("," allout-open-supertopic) - ("'" allout-shift-in) - (">" allout-shift-in) - ("<" allout-shift-out) - ("\C-m" allout-rebullet-topic) - ("*" allout-rebullet-current-heading) - ("#" allout-number-siblings) - ("\C-k" allout-kill-line t) - ([?\M-k] allout-copy-line-as-kill t) - ("\C-y" allout-yank t) - ([?\M-y] allout-yank-pop t) - ("\C-k" allout-kill-topic) - ([?\M-k] allout-copy-topic-as-kill) - ; Miscellaneous commands: - ;([?\C-\ ] allout-mark-topic) - ("@" allout-resolve-xref) - ("=c" allout-copy-exposed-to-buffer) - ("=i" allout-indented-exposed-to-buffer) - ("=t" allout-latexify-exposed) - ("=p" allout-flatten-exposed-to-buffer))) - ;;;_ = allout-auto-activation (defcustom allout-auto-activation nil "Regulates auto-activation modality of allout outlines -- see `allout-init'. @@ -1239,36 +1221,6 @@ "[^" allout-primary-bullet "]")) "\\)" )))) -;;;_ : Key bindings -;;;_ = allout-mode-map -(defvar allout-mode-map nil "Keybindings for (allout) outline minor mode.") -;;;_ > produce-allout-mode-map (keymap-alist &optional base-map) -(defun produce-allout-mode-map (keymap-list &optional base-map) - "Produce keymap for use as `allout-mode-map', from KEYMAP-LIST. - -Built on top of optional BASE-MAP, or empty sparse map if none specified. -See doc string for `allout-keybindings-list' for format of binding list." - (let ((map (or base-map (make-sparse-keymap))) - (pref (list allout-command-prefix))) - (mapc (function - (lambda (cell) - (let ((add-pref (null (cdr (cdr cell)))) - (key-suff (list (car cell)))) - (apply 'define-key - (list map - (apply 'vconcat (if add-pref - (append pref key-suff) - key-suff)) - (car (cdr cell))))))) - keymap-list) - map)) -;;;_ > allout-mode-map-adjustments (base-map) -(defun allout-mode-map-adjustments (base-map) - "Do conditional additions to specified base-map, like inclusion of \\C-h." - (if allout-preempt-trailing-ctrl-h - (cons '("\C-h" allout-hide-current-subtree) base-map) - base-map) - ) ;;;_ : Menu bar (defvar allout-mode-exposure-menu) (defvar allout-mode-editing-menu) @@ -1277,7 +1229,7 @@ (defun produce-allout-mode-menubar-entries () (require 'easymenu) (easy-menu-define allout-mode-exposure-menu - allout-mode-map + allout-mode-map-value "Allout outline exposure menu." '("Exposure" ["Show Entry" allout-show-current-entry t] @@ -1288,7 +1240,7 @@ "----" ["Show All" allout-show-all t])) (easy-menu-define allout-mode-editing-menu - allout-mode-map + allout-mode-map-value "Allout outline editing menu." '("Headings" ["Open Sibling" allout-open-sibtopic t] @@ -1305,7 +1257,7 @@ allout-toggle-current-subtree-encryption (> (allout-current-depth) 1)])) (easy-menu-define allout-mode-navigation-menu - allout-mode-map + allout-mode-map-value "Allout outline navigation menu." '("Navigation" ["Next Visible Heading" allout-next-visible-heading t] @@ -1322,7 +1274,7 @@ ["End of Entry" allout-end-of-entry t] ["End of Subtree" allout-end-of-current-subtree t])) (easy-menu-define allout-mode-misc-menu - allout-mode-map + allout-mode-map-value "Allout outlines miscellaneous bindings." '("Misc" ["Version" allout-version t] @@ -1776,19 +1728,16 @@ '(allout-overlay-insert-in-front-handler))) (put 'allout-exposure-category 'modification-hooks '(allout-overlay-interior-modification-handler))) -;;;_ > allout-mode (&optional force) +;;;_ > define-minor-mode allout-mode ;;;_ : Defun: ;;;###autoload -(defun allout-mode (&optional force) +(define-minor-mode allout-mode ;;;_ . Doc string: "Toggle minor mode for controlling exposure and editing of text outlines. -\\ +\\ Allout outline mode always runs as a minor mode. -Optional FORCE non-nil, or command with no universal argument, -means force activation. - Allout outline mode provides extensive outline oriented formatting and manipulation. It enables structural editing of outlines, as well as navigation and exposure. It also is @@ -1816,14 +1765,16 @@ instructions on priming your emacs session for automatic activation of `allout-mode'. -The bindings are dictated by the customizable `allout-keybindings-list' -variable. We recommend customizing `allout-command-prefix' to use just -`\\C-c' as the command prefix, if the allout bindings don't conflict with -any personal bindings you have on \\C-c. In any case, outline structure -navigation and authoring is simplified by positioning the cursor on an -item's bullet character, the \"hot-spot\" -- then you can invoke allout -commands with just the un-prefixed, un-control-shifted command letters. -This is described further in the HOT-SPOT Operation section. +The bindings are those listed in `allout-prefixed-keybindings' +and `allout-unprefixed-keybindings'. We recommend customizing +`allout-command-prefix' to use just `\\C-c' as the command +prefix, if the allout bindings don't conflict with any personal +bindings you have on \\C-c. In any case, outline structure +navigation and authoring is simplified by positioning the cursor +on an item's bullet character, the \"hot-spot\" -- then you can +invoke allout commands with just the un-prefixed, +un-control-shifted command letters. This is described further in +the HOT-SPOT Operation section. Exposure Control: ---------------- @@ -2043,7 +1994,8 @@ CLOSED: A TOPIC whose immediate OFFSPRING and body-text is CONCEALED. OPEN: A TOPIC that is not CLOSED, though its OFFSPRING or BODY may be." ;;;_ . Code - (interactive "P") + :lighter " Allout" + :keymap 'allout-mode-map (let ((write-file-hook-var-name (cond ((boundp 'write-file-functions) 'write-file-functions) @@ -2054,7 +2006,7 @@ allout-layout allout-default-layout))) - (if (and (allout-mode-p) (not force)) + (if (not (allout-mode-p)) (progn ;; Deactivation: @@ -2069,18 +2021,14 @@ (remove-hook 'post-command-hook 'allout-post-command-business t) (remove-hook 'before-change-functions 'allout-before-change-handler t) (remove-hook 'isearch-mode-end-hook 'allout-isearch-end-handler t) - (remove-hook write-file-hook-var-name 'allout-write-file-hook-handler - t) + (remove-hook write-file-hook-var-name + 'allout-write-file-hook-handler t) (remove-hook 'auto-save-hook 'allout-auto-save-hook-handler t) (remove-overlays (point-min) (point-max) - 'category 'allout-exposure-category) - - (setq allout-mode nil) - (run-hooks 'allout-mode-deactivate-hook) - (run-hooks 'allout-mode-off-hook)) - - ;; Activation: + 'category 'allout-exposure-category)) + + ;; Activating: (if allout-old-style-prefixes ;; Inhibit all the fancy formatting: (allout-add-resumptions '(allout-primary-bullet "*"))) @@ -2098,17 +2046,9 @@ allout-bob-regexp extend)) - ;; Produce map from current version of allout-keybindings-list: - (allout-setup-mode-map) + (allout-compose-and-institute-keymap) (produce-allout-mode-menubar-entries) - ;; Include on minor-mode-map-alist, if not already there: - (if (not (member '(allout-mode . allout-mode-map) - minor-mode-map-alist)) - (setq minor-mode-map-alist - (cons '(allout-mode . allout-mode-map) - minor-mode-map-alist))) - (add-to-invisibility-spec '(allout . t)) (allout-add-resumptions '(line-move-ignore-invisible t)) @@ -2142,13 +2082,7 @@ ;; allout-auto-fill will use the stashed values and so forth. (allout-add-resumptions '(auto-fill-function allout-auto-fill))) - (or (assq 'allout-mode minor-mode-alist) - (setq minor-mode-alist - (cons '(allout-mode " Allout") minor-mode-alist))) - (allout-setup-menubar) - (setq allout-mode t) - (run-hooks 'allout-mode-hook) ;; Do auto layout if warranted: (when (and allout-layout @@ -2182,36 +2116,6 @@ ) ; define-minor-mode ;;;_ > allout-minor-mode alias (defalias 'allout-minor-mode 'allout-mode) -;;;_ > allout-setup-mode-map ()) -(defun allout-setup-mode-map () - "Establish allout-mode bindings." - (setq-default allout-mode-map - (produce-allout-mode-map - (allout-mode-map-adjustments allout-keybindings-list))) - (setq allout-mode-map - (produce-allout-mode-map - (allout-mode-map-adjustments allout-keybindings-list))) - (substitute-key-definition 'beginning-of-line - 'allout-beginning-of-line - allout-mode-map global-map) - (substitute-key-definition 'move-beginning-of-line - 'allout-beginning-of-line - allout-mode-map global-map) - (substitute-key-definition 'end-of-line - 'allout-end-of-line - allout-mode-map global-map) - (substitute-key-definition 'move-end-of-line - 'allout-end-of-line - allout-mode-map global-map) - (fset 'allout-mode-map allout-mode-map)) - -;; ensure that allout-mode-map has some setting even if allout-mode hasn't -;; been invoked: -(allout-setup-mode-map) - -;;;_ > allout-minor-mode -(defalias 'allout-minor-mode 'allout-mode) - ;;;_ > allout-unload-function (defun allout-unload-function () "Unload the allout outline library." @@ -3425,7 +3329,7 @@ then unset it. Set by `allout-pre-command-business' when implementing hot-spot operation, where literal characters typed over a topic bullet are mapped to the command of the corresponding control-key on the -`allout-mode-map'.") +`allout-mode-map-value'.") (make-variable-buffer-local 'allout-post-goto-bullet) ;;;_ = allout-command-counter (defvar allout-command-counter 0 @@ -3464,11 +3368,12 @@ Among other things, implements special behavior when the cursor is on the topic bullet character. -When the cursor is on the bullet character, self-insert characters are -reinterpreted as the corresponding control-character in the -`allout-mode-map'. The `allout-mode' `post-command-hook' insures that -the cursor which has moved as a result of such reinterpretation is -positioned on the bullet character of the destination topic. +When the cursor is on the bullet character, self-insert +characters are reinterpreted as the corresponding +control-character in the `allout-mode-map-value'. The +`allout-mode' `post-command-hook' insures that the cursor which +has moved as a result of such reinterpretation is positioned on +the bullet character of the destination topic. The upshot is that you can get easy, single (ie, unmodified) key outline maneuvering operations by positioning the cursor on the bullet @@ -3495,9 +3400,6 @@ Returns the qualifying command, if any, else nil." (interactive) (let* ((modified (event-modifiers last-command-event)) - (key-string (if (numberp last-command-event) - (char-to-string - (event-basic-type last-command-event)))) (key-num (cond ((numberp last-command-event) last-command-event) ;; for XEmacs character type: ((and (fboundp 'characterp) @@ -3514,16 +3416,13 @@ (not modified) (<= 33 key-num) (setq mapped-binding - (or (and (assoc key-string allout-keybindings-list) - ;; translate literal membership on list: - (cadr (assoc key-string allout-keybindings-list))) - ;; translate as a keybinding: - (key-binding (vconcat allout-command-prefix - (vector - (if (and (<= 97 key-num) ; "a" - (>= 122 key-num)) ; "z" - (- key-num 96) key-num))) - t)))) + ;; translate as a keybinding: + (key-binding (vconcat allout-command-prefix + (vector + (if (and (<= 97 key-num) ; "a" + (>= 122 key-num)) ; "z" + (- key-num 96) key-num))) + t))) ;; Qualified as an allout command -- do hot-spot operation. (setq allout-post-goto-bullet t) ;; accept-defaults nil, or else we get allout-item-icon-key-handler. ------------------------------------------------------------ revno: 102915 committer: Glenn Morris branch nick: trunk timestamp: Wed 2011-01-19 23:17:22 -0800 message: * lisp/vc/vc-svn.el (vc-svn-after-dir-status): Tweak previous change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-01-20 06:40:36 +0000 +++ lisp/ChangeLog 2011-01-20 07:17:22 +0000 @@ -1,5 +1,7 @@ 2011-01-20 Glenn Morris + * vc/vc-svn.el (vc-svn-after-dir-status): Tweak previous change. + * simple.el (read-expression-history): Remove, it's in minibuf.c. 2011-01-20 Chong Yidong === modified file 'lisp/vc/vc-svn.el' --- lisp/vc/vc-svn.el 2011-01-19 03:49:00 +0000 +++ lisp/vc/vc-svn.el 2011-01-20 07:17:22 +0000 @@ -180,8 +180,9 @@ (let ((state (cdr (assq (aref (match-string 1) 0) state-map))) (propstat (cdr (assq (aref (match-string 2) 0) state-map))) (filename (match-string 4))) - (if (memq propstat '(conflict edited)) - (setq state propstat)) + (and (memq propstat '(conflict edited)) + (not (eq state 'conflict)) ; conflict always wins + (setq state propstat)) (and remote (string-equal (match-string 3) "*") ;; FIXME are there other possible combinations? (cond ((eq state 'edited) (setq state 'needs-merge))