Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 99936. ------------------------------------------------------------ revno: 99936 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2010-04-18 22:32:47 -0400 message: * custom.el (defcustom): Add edebug spec. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-04-18 23:49:58 +0000 +++ lisp/ChangeLog 2010-04-19 02:32:47 +0000 @@ -1,3 +1,7 @@ +2010-04-19 Stefan Monnier + + * custom.el (defcustom): Add edebug spec. + 2010-04-18 Juri Linkov Test for special mode-class in view-buffer instead of view-file (bug#5513). === modified file 'lisp/custom.el' --- lisp/custom.el 2010-02-26 04:42:07 +0000 +++ lisp/custom.el 2010-04-19 02:32:47 +0000 @@ -304,7 +304,7 @@ See Info node `(elisp) Customization' in the Emacs Lisp manual for more information." - (declare (doc-string 3)) + (declare (doc-string 3) (debug (name body))) ;; It is better not to use backquote in this file, ;; because that makes a bootstrapping problem ;; if you need to recompile all the Lisp files using interpreted code. ------------------------------------------------------------ revno: 99935 committer: Juri Linkov branch nick: trunk timestamp: Mon 2010-04-19 02:49:58 +0300 message: Test for special mode-class in view-buffer instead of view-file (bug#5513). * view.el (view-file, view-buffer): Move test for special mode-class from view-file to view-buffer. * tar-mode.el (tar-extract): Turn if's into one cond like in arc-mode.el. diff: === modified file 'etc/NEWS' --- etc/NEWS 2010-04-18 23:08:52 +0000 +++ etc/NEWS 2010-04-18 23:49:58 +0000 @@ -148,6 +148,8 @@ * Incompatible Lisp Changes in Emacs 24.1 +** Test for special mode-class was moved from view-file to view-buffer. + ** Passing a nil argument to a minor mode function now turns the mode ON unconditionally. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-04-18 23:08:52 +0000 +++ lisp/ChangeLog 2010-04-18 23:49:58 +0000 @@ -1,5 +1,15 @@ 2010-04-18 Juri Linkov + Test for special mode-class in view-buffer instead of view-file (bug#5513). + + * view.el (view-file, view-buffer): Move test for special mode-class + from view-file to view-buffer. + + * tar-mode.el (tar-extract): Turn if's into one cond + like in arc-mode.el. + +2010-04-18 Juri Linkov + Add 7z archive format support (bug#5475). * arc-mode.el (archive-zip-extract): Try to find 7z executable. === modified file 'lisp/arc-mode.el' --- lisp/arc-mode.el 2010-04-18 23:08:52 +0000 +++ lisp/arc-mode.el 2010-04-18 23:49:58 +0000 @@ -1062,8 +1062,8 @@ (archive-maybe-update t)) (or (not (buffer-name buffer)) (cond - (view-p (view-buffer - buffer (and just-created 'kill-buffer-if-not-modified))) + (view-p + (view-buffer buffer (and just-created 'kill-buffer-if-not-modified))) ((eq other-window-p 'display) (display-buffer buffer)) (other-window-p (switch-to-buffer-other-window buffer)) (t (switch-to-buffer buffer)))))) === modified file 'lisp/tar-mode.el' --- lisp/tar-mode.el 2010-01-13 08:35:10 +0000 +++ lisp/tar-mode.el 2010-04-18 23:49:58 +0000 @@ -852,14 +852,12 @@ (set (make-local-variable 'tar-superior-descriptor) descriptor) (setq buffer-read-only read-only-p) (tar-subfile-mode 1))) - (if view-p - (view-buffer - buffer (and just-created 'kill-buffer-if-not-modified)) - (if (eq other-window-p 'display) - (display-buffer buffer) - (if other-window-p - (switch-to-buffer-other-window buffer) - (switch-to-buffer buffer))))))) + (cond + (view-p + (view-buffer buffer (and just-created 'kill-buffer-if-not-modified))) + ((eq other-window-p 'display) (display-buffer buffer)) + (other-window-p (switch-to-buffer-other-window buffer)) + (t (switch-to-buffer buffer)))))) (defun tar-extract-other-window () === modified file 'lisp/view.el' --- lisp/view.el 2010-03-12 17:47:22 +0000 +++ lisp/view.el 2010-04-18 23:49:58 +0000 @@ -262,13 +262,7 @@ (unless (file-exists-p file) (error "%s does not exist" file)) (let ((had-a-buf (get-file-buffer file)) (buffer (find-file-noselect file))) - (if (eq (with-current-buffer buffer - (get major-mode 'mode-class)) - 'special) - (progn - (switch-to-buffer buffer) - (message "Not using View mode because the major mode is special")) - (view-buffer buffer (and (not had-a-buf) 'kill-buffer-if-not-modified))))) + (view-buffer buffer (and (not had-a-buf) 'kill-buffer-if-not-modified)))) ;;;###autoload (defun view-file-other-window (file) @@ -334,10 +328,16 @@ Exiting View mode will then discard the user's edits. Setting EXIT-ACTION to `kill-buffer-if-not-modified' avoids this." (interactive "bView buffer: ") - (let ((undo-window (list (window-buffer) (window-start) (window-point)))) - (switch-to-buffer buffer) - (view-mode-enter (cons (selected-window) (cons nil undo-window)) - exit-action))) + (if (eq (with-current-buffer buffer + (get major-mode 'mode-class)) + 'special) + (progn + (switch-to-buffer buffer) + (message "Not using View mode because the major mode is special")) + (let ((undo-window (list (window-buffer) (window-start) (window-point)))) + (switch-to-buffer buffer) + (view-mode-enter (cons (selected-window) (cons nil undo-window)) + exit-action)))) ;;;###autoload (defun view-buffer-other-window (buffer &optional not-return exit-action) ------------------------------------------------------------ revno: 99934 committer: Juri Linkov branch nick: trunk timestamp: Mon 2010-04-19 02:08:52 +0300 message: Add 7z archive format support (bug#5475). * arc-mode.el (archive-zip-extract): Try to find 7z executable. (archive-7z-extract): New defcustom. (archive-find-type): Add magic string for 7z. (archive-extract-by-stdout): Add new optional arg `stderr-file'. If `stderr-file' is non-nil, use `(t stderr-file)' for the `buffer' arg of `call-process'. (archive-zip-extract): Check `archive-zip-extract' for "7z" and call the function `archive-7z-extract' with the variable `archive-7z-extract' let-bound to `archive-zip-extract'. (archive-7z-summarize, archive-7z-extract): New functions. * international/mule.el (auto-coding-alist): * files.el (auto-mode-alist): Add 7z file extension. diff: === modified file 'etc/NEWS' --- etc/NEWS 2010-04-15 23:51:12 +0000 +++ etc/NEWS 2010-04-18 23:08:52 +0000 @@ -85,6 +85,8 @@ * Changes in Specialized Modes and Packages in Emacs 24.1 +** Archive Mode has basic support to browse 7z archives. + ** partial-completion-mode is now obsolete. ** mpc.el: Can use pseudo tags of the form tag1|tag2 as a union of two tags. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-04-18 21:49:33 +0000 +++ lisp/ChangeLog 2010-04-18 23:08:52 +0000 @@ -1,3 +1,21 @@ +2010-04-18 Juri Linkov + + Add 7z archive format support (bug#5475). + + * arc-mode.el (archive-zip-extract): Try to find 7z executable. + (archive-7z-extract): New defcustom. + (archive-find-type): Add magic string for 7z. + (archive-extract-by-stdout): Add new optional arg `stderr-file'. + If `stderr-file' is non-nil, use `(t stderr-file)' for the + `buffer' arg of `call-process'. + (archive-zip-extract): Check `archive-zip-extract' for "7z" and + call the function `archive-7z-extract' with the variable + `archive-7z-extract' let-bound to `archive-zip-extract'. + (archive-7z-summarize, archive-7z-extract): New functions. + + * international/mule.el (auto-coding-alist): + * files.el (auto-mode-alist): Add 7z file extension. + 2010-04-18 Stefan Monnier * loadup.el: Setup hash-cons for pure data. === modified file 'lisp/arc-mode.el' --- lisp/arc-mode.el 2010-02-12 19:35:45 +0000 +++ lisp/arc-mode.el 2010-04-18 23:08:52 +0000 @@ -52,17 +52,17 @@ ;; ARCHIVE TYPES: Currently only the archives below are handled, but the ;; structure for handling just about anything is in place. ;; -;; Arc Lzh Zip Zoo Rar -;; ---------------------------------------- -;; View listing Intern Intern Intern Intern Y -;; Extract member Y Y Y Y Y -;; Save changed member Y Y Y Y N -;; Add new member N N N N N -;; Delete member Y Y Y Y N -;; Rename member Y Y N N N -;; Chmod - Y Y - N -;; Chown - Y - - N -;; Chgrp - Y - - N +;; Arc Lzh Zip Zoo Rar 7z +;; -------------------------------------------- +;; View listing Intern Intern Intern Intern Y Y +;; Extract member Y Y Y Y Y Y +;; Save changed member Y Y Y Y N N +;; Add new member N N N N N N +;; Delete member Y Y Y Y N N +;; Rename member Y Y N N N N +;; Chmod - Y Y - N N +;; Chown - Y - - N N +;; Chgrp - Y - - N N ;; ;; Special thanks to Bill Brodie for very useful tips ;; on the first released version of this package. @@ -217,17 +217,17 @@ ;; Zip archive configuration (defcustom archive-zip-extract - (if (and (not (executable-find "unzip")) - (executable-find "pkunzip")) - '("pkunzip" "-e" "-o-") - '("unzip" "-qq" "-c")) + (cond ((executable-find "unzip") '("unzip" "-qq" "-c")) + ((executable-find "7z") '("7z" "x" "-so")) + ((executable-find "pkunzip") '("pkunzip" "-e" "-o-")) + (t '("unzip" "-qq" "-c"))) "Program and its options to run in order to extract a zip file member. Extraction should happen to standard output. Archive and member name will be added." :type '(list (string :tag "Program") - (repeat :tag "Options" - :inline t - (string :format "%v"))) + (repeat :tag "Options" + :inline t + (string :format "%v"))) :group 'archive-zip) ;; For several reasons the latter behavior is not desirable in general. @@ -315,6 +315,20 @@ :inline t (string :format "%v"))) :group 'archive-zoo) +;; ------------------------------ +;; 7z archive configuration + +(defcustom archive-7z-extract + '("7z" "x" "-so") + "Program and its options to run in order to extract a 7z file member. +Extraction should happen to standard output. Archive and member name will +be added." + :type '(list (string :tag "Program") + (repeat :tag "Options" + :inline t + (string :format "%v"))) + :group 'archive-7z) + ;; ------------------------------------------------------------------------- ;;; Section: Variables @@ -732,6 +746,7 @@ ((and (looking-at "MZ") (re-search-forward "Rar!" (+ (point) 100000) t)) 'rar-exe) + ((looking-at "7z\274\257\047\034") '7z) (t (error "Buffer format not recognized"))))) ;; ------------------------------------------------------------------------- @@ -1081,11 +1096,11 @@ (archive-delete-local tmpfile) success)) -(defun archive-extract-by-stdout (archive name command) +(defun archive-extract-by-stdout (archive name command &optional stderr-file) (apply 'call-process (car command) nil - t + (if stderr-file (list t stderr-file) t) nil (append (cdr command) (list archive name)))) @@ -1787,16 +1802,22 @@ (apply 'vector (nreverse files)))) (defun archive-zip-extract (archive name) - (if (member-ignore-case (car archive-zip-extract) '("pkunzip" "pkzip")) - (archive-*-extract archive name archive-zip-extract) + (cond + ((member-ignore-case (car archive-zip-extract) '("pkunzip" "pkzip")) + (archive-*-extract archive name archive-zip-extract)) + ((equal (car archive-zip-extract) "7z") + (let ((archive-7z-extract archive-zip-extract)) + (archive-7z-extract archive name))) + (t (archive-extract-by-stdout archive ;; unzip expands wildcards in NAME, so we need to quote it. ;; FIXME: Does pkunzip need similar treatment? + ;; (7z doesn't need to quote wildcards) (if (equal (car archive-zip-extract) "unzip") (shell-quote-argument name) name) - archive-zip-extract))) + archive-zip-extract)))) (defun archive-zip-write-file-member (archive descr) (archive-*-write-file-member @@ -2004,7 +2025,65 @@ (if tmpbuf (kill-buffer tmpbuf)) (delete-file tmpfile)))) - +;; ------------------------------------------------------------------------- +;;; Section: 7z Archives + +(defun archive-7z-summarize () + (let ((maxname 10) + (maxsize 5) + (file buffer-file-name) + (files ())) + (with-temp-buffer + (call-process "7z" nil t nil "l" "-slt" file) + (goto-char (point-min)) + (re-search-forward "^-+\n") + (while (re-search-forward "^Path = \\(.*\\)\n" nil t) + (goto-char (match-end 0)) + (let ((name (match-string 1)) + (size (save-excursion + (and (re-search-forward "^Size = \\(.*\\)\n") + (match-string 1)))) + (time (save-excursion + (and (re-search-forward "^Modified = \\(.*\\)\n") + (match-string 1))))) + (if (> (length name) maxname) (setq maxname (length name))) + (if (> (length size) maxsize) (setq maxsize (length size))) + (push (vector name name nil nil time nil nil size) + files)))) + (setq files (nreverse files)) + (goto-char (point-min)) + (let* ((format (format " %%%ds %%s %%s" maxsize)) + (sep (format format (make-string maxsize ?-) "-------------------" "")) + (column (length sep))) + (insert (format format "Size " "Date Time " " Filename") "\n") + (insert sep (make-string maxname ?-) "\n") + (archive-summarize-files (mapcar (lambda (desc) + (let ((text + (format format + (aref desc 7) + (aref desc 4) + (aref desc 1)))) + (vector text + column + (length text)))) + files)) + (insert sep (make-string maxname ?-) "\n") + (apply 'vector files)))) + +(defun archive-7z-extract (archive name) + (let ((tmpfile (make-temp-file "7z-stderr"))) + ;; 7z doesn't provide a `quiet' option to suppress non-essential + ;; stderr messages. So redirect stderr to a temp file and display it + ;; in the echo area when it contains error messages. + (prog1 (archive-extract-by-stdout + archive name archive-7z-extract tmpfile) + (with-temp-buffer + (insert-file-contents tmpfile) + (unless (search-forward "Everything is Ok" nil t) + (message "%s" (buffer-string))) + (delete-file tmpfile))))) + +;; ------------------------------------------------------------------------- ;;; Section `ar' archives. ;; TODO: we currently only handle the basic format of ar archives, === modified file 'lisp/files.el' --- lisp/files.el 2010-03-31 01:51:54 +0000 +++ lisp/files.el 2010-04-18 23:08:52 +0000 @@ -2252,8 +2252,8 @@ ;; The list of archive file extensions should be in sync with ;; `auto-coding-alist' with `no-conversion' coding system. ("\\.\\(\ -arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|\ -ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\)\\'" . archive-mode) +arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|7z\\|\ +ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" . archive-mode) ("\\.\\(sx[dmicw]\\|od[fgpst]\\|oxt\\)\\'" . archive-mode) ;OpenOffice.org ("\\.\\(deb\\|[oi]pk\\)\\'" . archive-mode) ; Debian/Opkg packages. ;; Mailer puts message to be edited in === modified file 'lisp/international/mule.el' --- lisp/international/mule.el 2010-01-13 08:35:10 +0000 +++ lisp/international/mule.el 2010-04-18 23:08:52 +0000 @@ -1626,8 +1626,8 @@ ;; .exe and .EXE are added to support archive-mode looking at DOS ;; self-extracting exe archives. (purecopy '(("\\.\\(\ -arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|\ -ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\)\\'" +arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|7z\\|\ +ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" . no-conversion-multibyte) ("\\.\\(exe\\|EXE\\)\\'" . no-conversion) ("\\.\\(sx[dmicw]\\|odt\\|tar\\|tgz\\)\\'" . no-conversion) ------------------------------------------------------------ revno: 99933 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2010-04-18 17:49:33 -0400 message: Hash-cons pure data. * alloc.c (Fpurecopy): Hash-cons if requested. (syms_of_alloc): Update purify-flag docstring. * loadup.el: Setup hash-cons for pure data. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-04-18 21:45:44 +0000 +++ lisp/ChangeLog 2010-04-18 21:49:33 +0000 @@ -1,5 +1,7 @@ 2010-04-18 Stefan Monnier + * loadup.el: Setup hash-cons for pure data. + Fix duplicate entries in cedet's loaddefs.el files. * emacs-lisp/autoload.el (autoload-file-load-name): Be more clever. Should make most file-local generated-autoload-file unnecessary. === modified file 'lisp/loadup.el' --- lisp/loadup.el 2010-02-18 09:08:37 +0000 +++ lisp/loadup.el 2010-04-18 21:49:33 +0000 @@ -64,6 +64,10 @@ (expand-file-name "international" dir) (expand-file-name "textmodes" dir))))) +(if (eq t purify-flag) + ;; Hash consing saved around 11% of pure space in my tests. + (setq purify-flag (make-hash-table :test 'equal))) + (message "Using load-path %s" load-path) (if (or (member (nth 3 command-line-args) '("dump" "bootstrap")) @@ -345,6 +349,10 @@ ;; At this point, we're ready to resume undo recording for scratch. (buffer-enable-undo "*scratch*") +;; Avoid error if user loads some more libraries now and make sure the +;; hash-consing hash table is GC'd. +(setq purify-flag nil) + (if (null (garbage-collect)) (setq pure-space-overflow t)) @@ -378,9 +386,6 @@ (add-name-to-file "emacs" name t))) (kill-emacs))) -;; Avoid error if user loads some more libraries now. -(setq purify-flag nil) - ;; For machines with CANNOT_DUMP defined in config.h, ;; this file must be loaded each time Emacs is run. ;; So run the startup code now. First, remove `-l loadup' from args. === modified file 'src/ChangeLog' --- src/ChangeLog 2010-04-18 11:24:59 +0000 +++ src/ChangeLog 2010-04-18 21:49:33 +0000 @@ -1,3 +1,8 @@ +2010-04-18 Stefan Monnier + + * alloc.c (Fpurecopy): Hash-cons if requested. + (syms_of_alloc): Update purify-flag docstring. + 2010-04-18 Jan Djärv * gtkutil.c (xg_set_geometry): Set size in geometry string also. === modified file 'src/alloc.c' --- src/alloc.c 2010-03-20 00:46:01 +0000 +++ src/alloc.c 2010-04-18 21:49:33 +0000 @@ -4893,14 +4893,21 @@ if (PURE_POINTER_P (XPNTR (obj))) return obj; + if (HASH_TABLE_P (Vpurify_flag)) /* Hash consing. */ + { + Lisp_Object tmp = Fgethash (obj, Vpurify_flag, Qnil); + if (!NILP (tmp)) + return tmp; + } + if (CONSP (obj)) - return pure_cons (XCAR (obj), XCDR (obj)); + obj = pure_cons (XCAR (obj), XCDR (obj)); else if (FLOATP (obj)) - return make_pure_float (XFLOAT_DATA (obj)); + obj = make_pure_float (XFLOAT_DATA (obj)); else if (STRINGP (obj)) - return make_pure_string (SDATA (obj), SCHARS (obj), - SBYTES (obj), - STRING_MULTIBYTE (obj)); + obj = make_pure_string (SDATA (obj), SCHARS (obj), + SBYTES (obj), + STRING_MULTIBYTE (obj)); else if (COMPILEDP (obj) || VECTORP (obj)) { register struct Lisp_Vector *vec; @@ -4920,10 +4927,15 @@ } else XSETVECTOR (obj, vec); - return obj; } else if (MARKERP (obj)) error ("Attempt to copy a marker to pure storage"); + else + /* Not purified, don't hash-cons. */ + return obj; + + if (HASH_TABLE_P (Vpurify_flag)) /* Hash consing. */ + Fputhash (obj, obj, Vpurify_flag); return obj; } @@ -6371,7 +6383,9 @@ DEFVAR_LISP ("purify-flag", &Vpurify_flag, doc: /* Non-nil means loading Lisp code in order to dump an executable. -This means that certain objects should be allocated in shared (pure) space. */); +This means that certain objects should be allocated in shared (pure) space. +It can also be set to a hash-table, in which case this table is used to +do hash-consing of the objects allocated to pure space. */); DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages, doc: /* Non-nil means display messages at start and end of garbage collection. */); ------------------------------------------------------------ revno: 99932 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2010-04-18 17:45:44 -0400 message: Fix duplicate entries in cedet's loaddefs.el files. * emacs-lisp/autoload.el (autoload-file-load-name): Be more clever. Should make most file-local generated-autoload-file unnecessary. (print-readably): Silence warnings. (autoload-find-destination): Take load-name as an arg to make sure it's the same as the one that will be in the file. (autoload-generate-file-autoloads): Adjust to above changes. Try to make the dataflow a bit simpler. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-04-18 21:37:29 +0000 +++ lisp/ChangeLog 2010-04-18 21:45:44 +0000 @@ -1,5 +1,14 @@ 2010-04-18 Stefan Monnier + Fix duplicate entries in cedet's loaddefs.el files. + * emacs-lisp/autoload.el (autoload-file-load-name): Be more clever. + Should make most file-local generated-autoload-file unnecessary. + (print-readably): Silence warnings. + (autoload-find-destination): Take load-name as an arg to make sure + it's the same as the one that will be in the file. + (autoload-generate-file-autoloads): Adjust to above changes. + Try to make the dataflow a bit simpler. + * cvs-status.el (cvs-refontify): Remove unused. 2010-04-18 Jay Belanger === modified file 'lisp/emacs-lisp/autoload.el' --- lisp/emacs-lisp/autoload.el 2010-03-18 06:47:12 +0000 +++ lisp/emacs-lisp/autoload.el 2010-04-18 21:45:44 +0000 @@ -328,7 +328,29 @@ "File local variable to prevent scanning this file for autoload cookies.") (defun autoload-file-load-name (file) - (let ((name (file-name-nondirectory file))) + "Compute the name that will be used to load FILE." + ;; OUTFILE should be the name of the global loaddefs.el file, which + ;; is expected to be at the root directory of the files we're + ;; scanning for autoloads and will be in the `load-path'. + (let* ((outfile (default-value 'generated-autoload-file)) + (name (file-relative-name file (file-name-directory outfile))) + (names '()) + (dir (file-name-directory outfile))) + ;; If `name' has directory components, only keep the + ;; last few that are really needed. + (while name + (setq name (directory-file-name name)) + (push (file-name-nondirectory name) names) + (setq name (file-name-directory name))) + (while (not name) + (cond + ((null (cdr names)) (setq name (car names))) + ((file-exists-p (expand-file-name "subdirs.el" dir)) + ;; FIXME: here we only check the existence of subdirs.el, + ;; without checking its content. This makes it generate wrong load + ;; names for cases like lisp/term which is not added to load-path. + (setq dir (expand-file-name (pop names) dir))) + (t (setq name (mapconcat 'identity names "/"))))) (if (string-match "\\.elc?\\(\\.\\|\\'\\)" name) (substring name 0 (match-beginning 0)) name))) @@ -343,6 +365,8 @@ (interactive "fGenerate autoloads for file: ") (autoload-generate-file-autoloads file (current-buffer))) +(defvar print-readably) + ;; When called from `generate-file-autoloads' we should ignore ;; `generated-autoload-file' altogether. When called from ;; `update-file-autoloads' we don't know `outbuf'. And when called from @@ -373,9 +397,8 @@ (visited (get-file-buffer file)) (otherbuf nil) (absfile (expand-file-name file)) - relfile ;; nil until we found a cookie. - output-start) + output-start ostart) (with-current-buffer (or visited ;; It is faster to avoid visiting the file. (autoload-find-file file)) @@ -385,7 +408,10 @@ (setq load-name (if (stringp generated-autoload-load-name) generated-autoload-load-name - (autoload-file-load-name file))) + (autoload-file-load-name absfile))) + (when (and outfile + (not (equal outfile (autoload-generated-file)))) + (setq otherbuf t)) (save-excursion (save-restriction (widen) @@ -396,26 +422,22 @@ ((looking-at (regexp-quote generate-autoload-cookie)) ;; If not done yet, figure out where to insert this text. (unless output-start - (when (and outfile - (not (equal outfile (autoload-generated-file)))) - ;; A file-local setting of autoload-generated-file says - ;; we should ignore OUTBUF. - (setq outbuf nil) - (setq otherbuf t)) - (unless outbuf - (setq outbuf (autoload-find-destination absfile)) - (unless outbuf - ;; The file has autoload cookies, but they're - ;; already up-to-date. If OUTFILE is nil, the - ;; entries are in the expected OUTBUF, otherwise - ;; they're elsewhere. - (throw 'done outfile))) - (with-current-buffer outbuf - (setq relfile (file-relative-name absfile)) - (setq output-start (point))) - ;; (message "file=%S, relfile=%S, dest=%S" - ;; file relfile (autoload-generated-file)) - ) + (let ((outbuf + (or (if otherbuf + ;; A file-local setting of + ;; autoload-generated-file says we + ;; should ignore OUTBUF. + nil + outbuf) + (autoload-find-destination absfile load-name) + ;; The file has autoload cookies, but they're + ;; already up-to-date. If OUTFILE is nil, the + ;; entries are in the expected OUTBUF, + ;; otherwise they're elsewhere. + (throw 'done otherbuf)))) + (with-current-buffer outbuf + (setq output-start (point-marker) + ostart (point))))) (search-forward generate-autoload-cookie) (skip-chars-forward " \t") (if (eolp) @@ -427,7 +449,8 @@ (if autoload (push (nth 1 form) autoloads-done) (setq autoload form)) - (let ((autoload-print-form-outbuf outbuf)) + (let ((autoload-print-form-outbuf + (marker-buffer output-start))) (autoload-print-form autoload))) (error (message "Error in %s: %S" file err))) @@ -442,7 +465,7 @@ (forward-char 1)) (point)) (progn (forward-line 1) (point))) - outbuf))) + (marker-buffer output-start)))) ((looking-at ";") ;; Don't read the comment. (forward-line 1)) @@ -454,40 +477,44 @@ (let ((secondary-autoloads-file-buf (if (local-variable-p 'generated-autoload-file) (current-buffer)))) - (with-current-buffer outbuf + (with-current-buffer (marker-buffer output-start) (save-excursion ;; Insert the section-header line which lists the file name ;; and which functions are in it, etc. + (assert (= ostart output-start)) (goto-char output-start) - (autoload-insert-section-header - outbuf autoloads-done load-name relfile - (if secondary-autoloads-file-buf - ;; MD5 checksums are much better because they do not - ;; change unless the file changes (so they'll be - ;; equal on two different systems and will change - ;; less often than time-stamps, thus leading to fewer - ;; unneeded changes causing spurious conflicts), but - ;; using time-stamps is a very useful optimization, - ;; so we use time-stamps for the main autoloads file - ;; (loaddefs.el) where we have special ways to - ;; circumvent the "random change problem", and MD5 - ;; checksum in secondary autoload files where we do - ;; not need the time-stamp optimization because it is - ;; already provided by the primary autoloads file. - (md5 secondary-autoloads-file-buf - ;; We'd really want to just use - ;; `emacs-internal' instead. - nil nil 'emacs-mule-unix) - (nth 5 (file-attributes relfile)))) - (insert ";;; Generated autoloads from " relfile "\n")) + (let ((relfile (file-relative-name absfile))) + (autoload-insert-section-header + (marker-buffer output-start) + autoloads-done load-name relfile + (if secondary-autoloads-file-buf + ;; MD5 checksums are much better because they do not + ;; change unless the file changes (so they'll be + ;; equal on two different systems and will change + ;; less often than time-stamps, thus leading to fewer + ;; unneeded changes causing spurious conflicts), but + ;; using time-stamps is a very useful optimization, + ;; so we use time-stamps for the main autoloads file + ;; (loaddefs.el) where we have special ways to + ;; circumvent the "random change problem", and MD5 + ;; checksum in secondary autoload files where we do + ;; not need the time-stamp optimization because it is + ;; already provided by the primary autoloads file. + (md5 secondary-autoloads-file-buf + ;; We'd really want to just use + ;; `emacs-internal' instead. + nil nil 'emacs-mule-unix) + (nth 5 (file-attributes relfile)))) + (insert ";;; Generated autoloads from " relfile "\n"))) (insert generate-autoload-section-trailer)))) (message "Generating autoloads for %s...done" file)) (or visited ;; We created this buffer, so we should kill it. (kill-buffer (current-buffer)))) - ;; If the entries were added to some other buffer, then the file - ;; doesn't add entries to OUTFILE. - (or (not output-start) otherbuf)))) + (or (not output-start) + ;; If the entries were added to some other buffer, then the file + ;; doesn't add entries to OUTFILE. + otherbuf)))) (defun autoload-save-buffers () (while autoload-modified-buffers @@ -511,15 +538,14 @@ (message "Autoload section for %s is up to date." file))) (if no-autoloads file))) -(defun autoload-find-destination (file) +(defun autoload-find-destination (file load-name) "Find the destination point of the current buffer's autoloads. FILE is the file name of the current buffer. Returns a buffer whose point is placed at the requested location. Returns nil if the file's autoloads are uptodate, otherwise removes any prior now out-of-date autoload entries." (catch 'up-to-date - (let* ((load-name (autoload-file-load-name file)) - (buf (current-buffer)) + (let* ((buf (current-buffer)) (existing-buffer (if buffer-file-name buf)) (found nil)) (with-current-buffer @@ -532,7 +558,7 @@ (unless (zerop (coding-system-eol-type buffer-file-coding-system)) (set-buffer-file-coding-system 'unix)) (or (> (buffer-size) 0) - (error "Autoloads file %s does not exist" buffer-file-name)) + (error "Autoloads file %s lacks boilerplate" buffer-file-name)) (or (file-writable-p buffer-file-name) (error "Autoloads file %s is not writable" buffer-file-name)) (widen) @@ -652,6 +678,7 @@ (t (autoload-remove-section (match-beginning 0)) (if (autoload-generate-file-autoloads + ;; Passing `current-buffer' makes it insert at point. file (current-buffer) buffer-file-name) (push file no-autoloads)))) (push file done) @@ -660,6 +687,9 @@ (dolist (file files) (cond ((member (expand-file-name file) autoload-excludes) nil) + ;; Passing nil as second argument forces + ;; autoload-generate-file-autoloads to look for the right + ;; spot where to insert each autoloads section. ((autoload-generate-file-autoloads file nil buffer-file-name) (push file no-autoloads)))) ------------------------------------------------------------ revno: 99931 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2010-04-18 17:37:29 -0400 message: * cvs-status.el (cvs-refontify): Remove unused. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-04-18 04:13:09 +0000 +++ lisp/ChangeLog 2010-04-18 21:37:29 +0000 @@ -1,3 +1,7 @@ +2010-04-18 Stefan Monnier + + * cvs-status.el (cvs-refontify): Remove unused. + 2010-04-18 Jay Belanger * calc.el (calc-mode-map): Bind "O" to `calc-missing-key'. === modified file 'lisp/cvs-status.el' --- lisp/cvs-status.el 2010-01-13 08:35:10 +0000 +++ lisp/cvs-status.el 2010-04-18 21:37:29 +0000 @@ -356,11 +356,11 @@ tags))) (defvar font-lock-mode) -(defun cvs-refontify (beg end) - (when (and (boundp 'font-lock-mode) - font-lock-mode - (fboundp 'font-lock-fontify-region)) - (font-lock-fontify-region (1- beg) (1+ end)))) +;; (defun cvs-refontify (beg end) +;; (when (and (boundp 'font-lock-mode) +;; font-lock-mode +;; (fboundp 'font-lock-fontify-region)) +;; (font-lock-fontify-region (1- beg) (1+ end)))) (defun cvs-status-trees () "Look for a lists of tags, and replace them with trees." ------------------------------------------------------------ revno: 99930 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2010-04-18 17:35:20 -0400 message: (Mathematics): Prefer Unicode charset. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2010-03-31 02:37:57 +0000 +++ etc/ChangeLog 2010-04-18 21:35:20 +0000 @@ -1,3 +1,7 @@ +2010-04-18 Stefan Monnier + + * HELLO (Mathematics): Prefer Unicode charset. + 2010-03-30 Chong Yidong * images/icons/hicolor/scalable/apps/emacs.svg: Put preamble after === modified file 'etc/HELLO' --- etc/HELLO 2010-03-29 12:26:24 +0000 +++ etc/HELLO 2010-04-18 21:35:20 +0000 @@ -44,7 +44,7 @@ Lao ((1>RJRERG(B) (1JP:R-4U(B / (1"mcKib*!4U(B Malayalam ($,1@N@R@O@^@S@"(B) $,1@H@N@X@m@5@^@P@"(B Maltese (il-Malti) Bon,Cu(Bu / Sa,C11(Ba -Mathematics $B"O(B p $A!J(B world $(O#@(B hello p $A!u(B +Mathematics $,1x (B p $,1x((B world $,1s"(B hello p $,2!a(B Nederlands, Vlaams Hallo / Dag Norwegian (norsk) Hei / God dag Oriya ($,1:s;\;?:f(B) $,1;6;A;#;?;,;G(B ------------------------------------------------------------ revno: 99929 committer: Jan D. branch nick: trunk timestamp: Sun 2010-04-18 13:24:59 +0200 message: Set USER_POS in hint_flags to work around Cygwin problem. gtkutil.c (xg_set_geometry): Set size in geometry string also. (x_wm_set_size_hint): Set USER_POS in hint_flags (Bug#5968). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-04-17 15:53:55 +0000 +++ src/ChangeLog 2010-04-18 11:24:59 +0000 @@ -1,3 +1,8 @@ +2010-04-18 Jan Djärv + + * gtkutil.c (xg_set_geometry): Set size in geometry string also. + (x_wm_set_size_hint): Set USER_POS in hint_flags (Bug#5968). + 2010-04-17 Eli Zaretskii Fix a crash when an NSM character is inserted at BEGV. === modified file 'src/gtkutil.c' --- src/gtkutil.c 2010-04-13 15:16:42 +0000 +++ src/gtkutil.c 2010-04-18 11:24:59 +0000 @@ -542,7 +542,9 @@ if (yneg) top = -top; - sprintf (geom_str, "%c%d%c%d", + sprintf (geom_str, "=%dx%d%c%d%c%d", + FRAME_PIXEL_WIDTH (f), + FRAME_PIXEL_HEIGHT (f), (xneg ? '-' : '+'), left, (yneg ? '-' : '+'), top); @@ -951,6 +953,12 @@ else if (win_gravity == StaticGravity) size_hints.win_gravity = GDK_GRAVITY_STATIC; + if (user_position) + { + hint_flags &= ~GDK_HINT_POS; + hint_flags |= GDK_HINT_USER_POS; + } + if (hint_flags != f->output_data.x->hint_flags || memcmp (&size_hints, &f->output_data.x->size_hints, ------------------------------------------------------------ revno: 99928 committer: Jay Belanger branch nick: trunk timestamp: Sat 2010-04-17 23:13:09 -0500 message: calc-bin.el (calc-radix): Have the O option turn on twos-complement mode. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-04-15 10:11:52 +0000 +++ doc/misc/ChangeLog 2010-04-18 04:13:09 +0000 @@ -1,3 +1,9 @@ +2010-04-18 Jay Belanger + + * calc.texi (Radix modes): Mention that the option prefix will + turn on twos-complement mode. + (Inverse and Hyperbolic Flags): Mention the Option flag. + 2010-04-15 Carsten Dominik * org.texi (LaTeX and PDF export): Add a footnote about xetex. === modified file 'doc/misc/calc.texi' --- doc/misc/calc.texi 2010-03-31 03:47:52 +0000 +++ doc/misc/calc.texi 2010-04-18 04:13:09 +0000 @@ -12289,15 +12289,21 @@ toggle the Inverse and/or Hyperbolic flags and then execute the corresponding base command (@code{calc-sin} in this case). -The Inverse and Hyperbolic flags apply only to the next Calculator -command, after which they are automatically cleared. (They are also -cleared if the next keystroke is not a Calc command.) Digits you -type after @kbd{I} or @kbd{H} (or @kbd{K}) are treated as prefix -arguments for the next command, not as numeric entries. The same -is true of @kbd{C-u}, but not of the minus sign (@kbd{K -} means to -subtract and keep arguments). - -The third Calc prefix flag, @kbd{K} (keep-arguments), is discussed +@kindex O +@pindex calc-option +The @kbd{O} key (@code{calc-option}) sets another flag, the +@dfn{Option Flag}, which also can alter the subsequent Calc command in +various ways. + +The Inverse, Hyperbolic and Option flags apply only to the next +Calculator command, after which they are automatically cleared. (They +are also cleared if the next keystroke is not a Calc command.) Digits +you type after @kbd{I}, @kbd{H} or @kbd{O} (or @kbd{K}) are treated as +prefix arguments for the next command, not as numeric entries. The +same is true of @kbd{C-u}, but not of the minus sign (@kbd{K -} means +to subtract and keep arguments). + +Another Calc prefix flag, @kbd{K} (keep-arguments), is discussed elsewhere. @xref{Keep Arguments}. @node Calculation Modes, Simplification Modes, Inverse and Hyperbolic, Mode Settings @@ -13175,12 +13181,13 @@ entirety.) @cindex Two's complements -With the binary, octal and hexadecimal display modes, Calc can -display @expr{w}-bit integers using two's complement notation. This -option is selected with the key sequences @kbd{C-u d 2}, @kbd{C-u d 8} -and @kbd{C-u d 6}, respectively, and a negative word size might be -appropriate (@pxref{Binary Functions}). In two's complement -notation, the integers in the (nearly) symmetric interval from +Calc can display @expr{w}-bit integers using two's complement +notation, although this is most useful with the binary, octal and +hexadecimal display modes. This option is selected by using the +@kbd{O} option prefix before setting the display radix, and a negative word +size might be appropriate (@pxref{Binary Functions}). In two's +complement notation, the integers in the (nearly) symmetric interval +from @texline @math{-2^{w-1}} @infoline @expr{-2^(w-1)} to @@ -35461,6 +35468,7 @@ @r{ @: M @: @: @:calc-more-recursion-depth@:} @r{ @: I M @: @: @:calc-less-recursion-depth@:} @r{ a@: N @: @: 5 @:evalvn@:(a)} +@r{ @: O @:command @: 32 @:@:Option} @r{ @: P @: @: @:@:pi} @r{ @: I P @: @: @:@:gamma} @r{ @: H P @: @: @:@:e} === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-04-17 02:47:25 +0000 +++ lisp/ChangeLog 2010-04-18 04:13:09 +0000 @@ -1,3 +1,10 @@ +2010-04-18 Jay Belanger + + * calc.el (calc-mode-map): Bind "O" to `calc-missing-key'. + + * calc-bin.el (calc-radix): Have the "O" option turn on + twos-complement mode. + 2010-04-17 Jay Belanger * calc-ext.el (calc-init-extensions): Add keybinding for 'calc-option'. === modified file 'lisp/calc/README' --- lisp/calc/README 2010-01-13 08:35:10 +0000 +++ lisp/calc/README 2010-04-18 04:13:09 +0000 @@ -72,6 +72,12 @@ Summary of changes to "Calc" ------- -- ------- -- ---- +Emacs 24.1 + +* Added "O" option prefix. + +* Used "O" prefix to "d r" (`calc-radix') to turn on twos-complement mode. + Emacs 23.2 * Added twos-complement display. === modified file 'lisp/calc/calc-bin.el' --- lisp/calc/calc-bin.el 2010-01-13 08:35:10 +0000 +++ lisp/calc/calc-bin.el 2010-04-18 04:13:09 +0000 @@ -175,7 +175,7 @@ (progn (calc-change-mode (list 'calc-number-radix 'calc-twos-complement-mode) - (list n (and (or (= n 2) (= n 8) (= n 16)) arg)) t) + (list n (or arg (calc-is-option))) t) ;; also change global value so minibuffer sees it (setq-default calc-number-radix calc-number-radix)) (setq n calc-number-radix))