From a1547e7b3939144615befdb1357e30fe5dd593ea Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 15 Oct 2007 08:57:14 +0000 Subject: [PATCH 001/127] Don't require url when compiling, as url-type is no longer a macro. --- lisp/ChangeLog | 5 +++++ lisp/term/mac-win.el | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 33ed2702a04..4c19ecffffa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-15 YAMAMOTO Mitsuharu + + * term/mac-win.el: Don't require url when compiling, as url-type is + no longer a macro. + 2007-10-14 Glenn Morris * progmodes/etags.el (select-tags-table): Disable undo in the diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index 314989906dd..483e73464dc 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el @@ -76,7 +76,6 @@ (require 'menu-bar) (require 'fontset) (require 'dnd) -(eval-when-compile (require 'url)) (defvar mac-charset-info-alist) (defvar mac-service-selection) From 20beebfe741fc02770d80f064fe2fd3b40ce8a78 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 15 Oct 2007 09:33:12 +0000 Subject: [PATCH 002/127] Require advice when compiling. --- lisp/ChangeLog | 10 +++++++--- lisp/help-fns.el | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3a68b694a34..84c908e20a2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-10-15 Juanma Barranquero + + * help-fns.el: Require advice when compiling. + 2007-10-14 Drew Adams * emacs-lisp/ring.el (ring-convert-sequence-to-ring) @@ -99,8 +103,8 @@ 2007-10-13 Dan Nicolaescu - * frame.el (select-frame-set-input-focus): Fix typo - "max" -> "mac". Do not use a single clause cond. + * frame.el (select-frame-set-input-focus): Fix typo "max" -> "mac". + Do not use a single clause cond. * cus-start.el (all): Use test that does not match the X11 version for mac. @@ -148,7 +152,7 @@ (idlwave-complete-in-buffer): * textmodes/org.el (org-export-as-html, org-export-as-ascii) (org-fast-tag-selection): - * textmodes/reftex-sel.el (reftex-select-item): Use mapc rather + * textmodes/reftex-sel.el (reftex-select-item): Use mapc rather than mapcar. 2007-10-13 Dan Nicolaescu diff --git a/lisp/help-fns.el b/lisp/help-fns.el index bf8d5f9a209..8a3a3903b3a 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -34,6 +34,7 @@ ;;; Code: (require 'help-mode) +(eval-when-compile (require 'advice)) ;; Functions @@ -239,7 +240,7 @@ face (according to `face-differs-from-default-p')." ".elc")) load-path)) (str (if (and elc-file (file-readable-p elc-file)) - (with-temp-buffer + (with-temp-buffer (insert-file-contents-literally elc-file nil 0 256) (buffer-string)))) (src-file (and str From 0c2ab389647cb634f96ec28a7f3104b4ca8334d7 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 15 Oct 2007 14:21:23 +0000 Subject: [PATCH 003/127] Revert previous change; it creates a dependency loop between advice.el and help-fns.el. --- lisp/ChangeLog | 5 +++++ lisp/help-fns.el | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 84c908e20a2..9a495218555 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-15 Juanma Barranquero + + * help-fns.el: Revert previous change; it creates a + dependency loop between advice.el and help-fns.el. + 2007-10-15 Juanma Barranquero * help-fns.el: Require advice when compiling. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 8a3a3903b3a..befd83c76ef 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -34,7 +34,6 @@ ;;; Code: (require 'help-mode) -(eval-when-compile (require 'advice)) ;; Functions From 78205dab16ac571debda4d869322aca8ccab021b Mon Sep 17 00:00:00 2001 From: Sam Steingold Date: Mon, 15 Oct 2007 14:38:42 +0000 Subject: [PATCH 004/127] (sendmail-error-reporting-interactive) (sendmail-error-reporting-non-interactive): New variables for sendmail error reporting options to simplify support for imperfect sendmail emulators. (sendmail-send-it): Use them instead of list literals. --- lisp/ChangeLog | 8 ++++++++ lisp/mail/sendmail.el | 21 +++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9a495218555..a9d6c2b29a6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2007-10-15 Sam Steingold + + * mail/sendmail.el (sendmail-error-reporting-interactive) + (sendmail-error-reporting-non-interactive): New variables for + sendmail error reporting options to simplify support for imperfect + sendmail emulators. + (sendmail-send-it): Use them instead of list literals. + 2007-10-15 Juanma Barranquero * help-fns.el: Revert previous change; it creates a diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 2a986a33f72..baf99cfd54a 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -991,6 +991,19 @@ See also the function `select-message-coding-system'.") nil) (t (error "Invalid value for `mail-from-style'"))))) +;; Normally you will not need to modify these options unless you are +;; using some non-genuine substitute for sendmail which does not +;; implement each and every option that the original supports. +;; E.g., ssmtp does not support "-odb", so, if your site uses it, +;; you will need to modify `sendmail-error-reporting-non-interactive' +;; in your site-init.el. +(defvar sendmail-error-reporting-interactive + ;; These mean "report errors to terminal" and "deliver interactively" + '("-oep" "-odi")) +(defvar sendmail-error-reporting-non-interactive + ;; These mean "report errors by mail" and "deliver in background". + '("-oem" "-odb")) + (defun sendmail-send-it () "Send the current mail buffer using the Sendmail package. This is a suitable value for `send-mail-function'. It sends using the @@ -1135,12 +1148,8 @@ external program defined by `sendmail-program'." (and mail-alias-file (list (concat "-oA" mail-alias-file))) (if mail-interactive - ;; These mean "report errors to terminal" - ;; and "deliver interactively" - '("-oep" "-odi") - ;; These mean "report errors by mail" - ;; and "deliver in background". - '("-oem" "-odb")) + sendmail-error-reporting-interactive + sendmail-error-reporting-non-interactive) ;; Get the addresses from the message ;; unless this is a resend. ;; We must not do that for a resend From 095aa9cdf01b4994db40f344e12f392f5635912d Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 15 Oct 2007 17:24:36 +0000 Subject: [PATCH 005/127] (filesets-alist-get): Use `let' rather than `let*'. (filesets-ormap, filesets-sort-case-sensitive-flag, filesets-remake-shortcut, filesets-ingroup-collect-files): Fix typos in docstrings. (filesets-conditional-sort, filesets-find-or-display-file, filesets-data-get-name, filesets-data-get-data, filesets-data-set, filesets-cmd-query-replace-getargs, filesets-ingroup-collect): Doc fixes. --- lisp/ChangeLog | 11 +++++++++++ lisp/filesets.el | 41 +++++++++++++++++++---------------------- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a9d6c2b29a6..e4b5fc84b94 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2007-10-15 Juanma Barranquero + + * filesets.el (filesets-alist-get): Use `let' rather than `let*'. + (filesets-ormap, filesets-sort-case-sensitive-flag) + (filesets-remake-shortcut, filesets-ingroup-collect-files): + Fix typos in docstrings. + (filesets-conditional-sort, filesets-find-or-display-file) + (filesets-data-get-name, filesets-data-get-data) + (filesets-data-set, filesets-cmd-query-replace-getargs) + (filesets-ingroup-collect): Doc fixes. + 2007-10-15 Sam Steingold * mail/sendmail.el (sendmail-error-reporting-interactive) diff --git a/lisp/filesets.el b/lisp/filesets.el index e5dde847853..d7a7dc9efa0 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -158,7 +158,7 @@ COND-FN takes one argument: the current element." (setq rv (append rv (list elt))))))) (defun filesets-ormap (fsom-pred lst) - "Return the tail of FSOM-LST for the head of which FSOM-PRED is non-nil." + "Return the tail of LST for the head of which FSOM-PRED is non-nil." (let ((fsom-lst lst) (fsom-rv nil)) (while (and (not (null fsom-lst)) @@ -535,7 +535,7 @@ computer environments." :group 'filesets) (defcustom filesets-sort-case-sensitive-flag t - "Non-nil means sorting of the filesete menu is case sensitive." + "Non-nil means sorting of the filesets menu is case sensitive." :set (function filesets-set-default) :type 'boolean :group 'filesets) @@ -1091,10 +1091,7 @@ If NEGATIVE is non-nil, remove all directory names." "Return a sorted copy of LST, LST being a list of strings. If `filesets-sort-menu-flag' is nil, return LST itself. -ACCESS-FN ... function to get the string value of LST's elements. - -If SIMPLY-DO-IT is non-nil, the list is sorted regardless of -`filesets-sort-menu-flag'." +ACCESS-FN ... function to get the string value of LST's elements." (if filesets-sort-menu-flag (let* ((fni (or access-fn (function identity))) @@ -1363,7 +1360,7 @@ not be opened." (find-file file))) (defun filesets-find-or-display-file (&optional file viewer) - "Visit FILE using an external viewer or open it in an Emacs buffer." + "Visit FILE using an external VIEWER or open it in an Emacs buffer." (interactive) (let* ((file (or file (read-file-name "Find file: " nil nil viewer))) @@ -1414,24 +1411,24 @@ not be opened." something))) (defun filesets-data-get-name (entry) - "Access to `filesets-data'. Get the entry's name." + "Access to `filesets-data'. Get the ENTRY's name." (car entry)) (defun filesets-data-get-data (entry) - "Access to `filesets-data'. Get the entry's data section." + "Access to `filesets-data'. Get the ENTRY's data section." (cdr entry)) (defun filesets-alist-get (alist key &optional default carp) "Get KEY's value in the association list ALIST. Return DEFAULT if not found. Return (car VALUE) if CARP is non-nil." - (let* ((elt (assoc key alist))) + (let ((elt (assoc key alist))) (cond - (elt - (if carp - (cadr elt) - (cdr elt))) - (default default) - (t nil)))) + (elt + (if carp + (cadr elt) + (cdr elt))) + (default default) + (t nil)))) (defun filesets-data-get (entry key &optional default carp) "Extract the value for KEY in the data part of fileset ENTRY. @@ -1439,7 +1436,7 @@ Return DEFAULT if not found. Return (car VALUE) if CARP is non-nil." (filesets-alist-get (filesets-data-get-data entry) key default carp)) (defun filesets-data-set (entry key value) - "Set the value for KEY in the data part of fileset ENTRY." + "Set the VALUE for KEY in the data part of fileset ENTRY." (let* ((alist (filesets-data-get-data entry)) (elt (assoc key alist))) (if elt @@ -1666,9 +1663,9 @@ Replace or <> with filename." filesets-commands))) -;;; sampe commands +;;; sample commands (defun filesets-cmd-query-replace-getargs () - "Get arguments for `filesets-cmd-query-replace'." + "Get arguments for `query-replace' and `query-replace-regexp'." (let* ((from-string (read-string "Filesets query replace: " "" 'query-replace-history)) @@ -1875,7 +1872,7 @@ User will be queried, if no fileset name is provided." (browse-url filesets-homepage)) (defun filesets-remake-shortcut (count submenu) - "Remake a submenus shortcut when wrapping long menus." + "Remake a submenu's shortcut when wrapping long menus." (let* ((name (concat (filesets-get-shortcut count) (substring (elt submenu 0) 2)))) (if (listp submenu) @@ -2032,7 +2029,7 @@ LOOKUP-NAME is used as lookup name for retrieving fileset specific settings." (lax-plist-put filesets-ingroup-cache emaster this)))) (defun filesets-ingroup-collect-files (fs &optional remdupl-flag master depth) - "Helper function for `filesets-ingroup-collect'. Collect file names." + "Helper function for `filesets-ingroup-collect'. Collect file names." (let* ((master (or master (filesets-entry-get-master fs))) (remdupl-flag (or remdupl-flag @@ -2146,7 +2143,7 @@ FS is a fileset's name. FLIST is a list returned by `([,nm (filesets-file-open nil ',master ',fsn)]))))))))) (defun filesets-ingroup-collect (fs remdupl-flag master) - "Collect names of included files & build submenu." + "Collect names of included files and build submenu." (filesets-ingroup-cache-put master nil) (filesets-message 2 "Filesets: parsing %S" master) (filesets-ingroup-collect-build-menu From ed5117041521183b6ac0403bddbb232c8e1e9907 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 15 Oct 2007 17:39:35 +0000 Subject: [PATCH 006/127] (filesets-alist-get): Use `let' rather than `let*'. (filesets-ormap, filesets-sort-case-sensitive-flag, filesets-remake-shortcut, filesets-ingroup-collect-files): Fix typos in docstrings. (filesets-data-get-name, filesets-data-get-data, filesets-data-set, filesets-cmd-query-replace-getargs, filesets-ingroup-collect, filesets-find-or-display-file): Doc fixes. --- lisp/ChangeLog | 10 ++++++++++ lisp/filesets.el | 37 ++++++++++++++++++------------------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4c19ecffffa..79733686e16 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2007-10-15 Juanma Barranquero + + * filesets.el (filesets-alist-get): Use `let' rather than `let*'. + (filesets-ormap, filesets-sort-case-sensitive-flag) + (filesets-remake-shortcut, filesets-ingroup-collect-files): + Fix typos in docstrings. + (filesets-data-get-name, filesets-data-get-data) + (filesets-data-set, filesets-cmd-query-replace-getargs) + (filesets-ingroup-collect, filesets-find-or-display-file): Doc fixes. + 2007-10-15 YAMAMOTO Mitsuharu * term/mac-win.el: Don't require url when compiling, as url-type is diff --git a/lisp/filesets.el b/lisp/filesets.el index 5554e26bc06..d4ec52fb650 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -162,7 +162,7 @@ COND-FN takes one argument: the current element." (setq rv (append rv (list elt))))))) (defun filesets-ormap (fsom-pred lst) - "Return the tail of FSOM-LST for the head of which FSOM-PRED is non-nil." + "Return the tail of LST for the head of which FSOM-PRED is non-nil." (let ((fsom-lst lst) (fsom-rv nil)) (while (and (not (null fsom-lst)) @@ -539,7 +539,7 @@ computer environments." :group 'filesets) (defcustom filesets-sort-case-sensitive-flag t - "*Non-nil means sorting of the filesete menu is case sensitive." + "*Non-nil means sorting of the filesets menu is case sensitive." :set (function filesets-set-default) :type 'boolean :group 'filesets) @@ -1096,7 +1096,6 @@ non-nil, remove all directory names." (defun filesets-conditional-sort (lst &optional access-fn simply-do-it) "Return a sorted copy of LST, LST being a list of strings. If `filesets-sort-menu-flag' is nil, return LST itself. - ACCESS-FN ... function to get the string value of LST's elements. If SIMPLY-DO-IT is non-nil, the list is sorted regardless of @@ -1368,7 +1367,7 @@ not be opened." (find-file file))) (defun filesets-find-or-display-file (&optional file viewer) - "Visit FILE using an external viewer or open it in an Emacs buffer." + "Visit FILE using an external VIEWER or open it in an Emacs buffer." (interactive) (let* ((file (or file (read-file-name "Find file: " nil nil viewer))) @@ -1419,24 +1418,24 @@ not be opened." something))) (defun filesets-data-get-name (entry) - "Access to `filesets-data'. Get the entry's name" + "Access to `filesets-data'. Get the ENTRY's name." (car entry)) (defun filesets-data-get-data (entry) - "Access to `filesets-data'. Get the entry's data section" + "Access to `filesets-data'. Get the ENTRY's data section." (cdr entry)) (defun filesets-alist-get (alist key &optional default carp) "Get KEY's value in the association list ALIST. Return DEFAULT if not found. Return (car VALUE) if CARP is non-nil." - (let* ((elt (assoc key alist))) + (let ((elt (assoc key alist))) (cond - (elt - (if carp - (cadr elt) - (cdr elt))) - (default default) - (t nil)))) + (elt + (if carp + (cadr elt) + (cdr elt))) + (default default) + (t nil)))) (defun filesets-data-get (entry key &optional default carp) "Extract the value for KEY in the data part of fileset ENTRY. @@ -1444,7 +1443,7 @@ Return DEFAULT if not found. Return (car VALUE) if CARP is non-nil." (filesets-alist-get (filesets-data-get-data entry) key default carp)) (defun filesets-data-set (entry key value) - "Set the value for KEY in the data part of fileset ENTRY." + "Set the VALUE for KEY in the data part of fileset ENTRY." (let* ((alist (filesets-data-get-data entry)) (elt (assoc key alist))) (if elt @@ -1671,9 +1670,9 @@ Replace or <> with filename." filesets-commands))) -;;; sampe commands +;;; sample commands (defun filesets-cmd-query-replace-getargs () - "Get arguments for `filesets-cmd-query-replace'." + "Get arguments for `query-replace' and `query-replace-regexp'." (let* ((from-string (read-string "Filesets query replace: " "" 'query-replace-history)) @@ -1880,7 +1879,7 @@ User will be queried, if no fileset name is provided." (browse-url filesets-homepage)) (defun filesets-remake-shortcut (count submenu) - "Remake a submenus shortcut when wrapping long menus." + "Remake a submenu's shortcut when wrapping long menus." (let* ((name (concat (filesets-get-shortcut count) (substring (elt submenu 0) 2)))) (if (listp submenu) @@ -2037,7 +2036,7 @@ LOOKUP-NAME is used as lookup name for retrieving fileset specific settings." (lax-plist-put filesets-ingroup-cache emaster this)))) (defun filesets-ingroup-collect-files (fs &optional remdupl-flag master depth) - "Helper function for `filesets-ingroup-collect'. Collect file names." + "Helper function for `filesets-ingroup-collect'. Collect file names." (let* ((master (or master (filesets-entry-get-master fs))) (remdupl-flag (or remdupl-flag @@ -2151,7 +2150,7 @@ FS is a fileset's name. FLIST is a list returned by `([,nm (filesets-file-open nil ',master ',fsn)]))))))))) (defun filesets-ingroup-collect (fs remdupl-flag master &optional depth) - "Collect names of included files & build submenu." + "Collect names of included files and build submenu." (filesets-ingroup-cache-put master nil) (filesets-message 2 "Filesets: parsing %S" master) (filesets-ingroup-collect-build-menu From 6e5d0e9e73b77c46af982a7d5b4043b183f9c69f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 15 Oct 2007 19:26:25 +0000 Subject: [PATCH 007/127] (vc-workfile-version): Compatibility alias. (vc-default-working-revision): Compatibility for backends. --- lisp/ChangeLog | 10 +++++++--- lisp/vc-hooks.el | 7 +++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e4b5fc84b94..96d6a627dcd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-15 Stefan Monnier + + * vc-hooks.el (vc-workfile-version): Compatibility alias. + (vc-default-working-revision): Compatibility for backends. + 2007-10-15 Juanma Barranquero * filesets.el (filesets-alist-get): Use `let' rather than `let*'. @@ -198,9 +203,8 @@ and some leftover logic regarding dedicated frames. If showing concise startup screen, fit window to buffer. (command-line-1): If we will be using the splash screen, use - find-file instead of find-file-other-window to find additional - files. Comment out unused code for coping with the old sit-for - behavior. + find-file instead of find-file-other-window to find additional files. + Comment out unused code for coping with the old sit-for behavior. 2007-10-12 Stefan Monnier diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 92c6c734483..e28a01d35e6 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -556,6 +556,13 @@ If FILE is not registered, this function always returns nil." (if (vc-backend file) (vc-file-setprop file 'vc-working-revision (vc-call working-revision file))))) +;; Backward compatibility. +(define-obsolete-function-alias + 'vc-workfile-version 'vc-working-revision "23.1") +(defun vc-default-working-revision (backend file) + (message + "`working-revision' not found: using the old `workfile-version' instead") + (vc-call-backend backend 'workfile-version file)) (defun vc-default-registered (backend file) "Check if FILE is registered in BACKEND using vc-BACKEND-master-templates." From d92c7a4637763b33180665fb6963e8d27efa8fcf Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 16 Oct 2007 02:06:12 +0000 Subject: [PATCH 008/127] Re-fill copyright header. (blink-matching-open): Don't report false errors with the `$' syntax class. --- lisp/ChangeLog | 11 +++-------- lisp/simple.el | 21 +++++++++++++++------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 79733686e16..155f410f9d2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,12 +1,7 @@ -2007-10-15 Juanma Barranquero +2007-10-16 Glenn Morris - * filesets.el (filesets-alist-get): Use `let' rather than `let*'. - (filesets-ormap, filesets-sort-case-sensitive-flag) - (filesets-remake-shortcut, filesets-ingroup-collect-files): - Fix typos in docstrings. - (filesets-data-get-name, filesets-data-get-data) - (filesets-data-set, filesets-cmd-query-replace-getargs) - (filesets-ingroup-collect, filesets-find-or-display-file): Doc fixes. + * simple.el (blink-matching-open): Don't report false errors with + the `$' syntax class. 2007-10-15 YAMAMOTO Mitsuharu diff --git a/lisp/simple.el b/lisp/simple.el index 1d87c84c33f..e1cf249f01c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1,7 +1,8 @@ ;;; simple.el --- basic editing commands for Emacs ;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +;; Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: internal @@ -4485,7 +4486,8 @@ it skips the contents of comments that end before point." matching-paren open-paren-line-string old-start - new-start) + new-start + isdollar) (save-excursion (save-restriction ;; Don't search for matching paren within minibuffer prompt. @@ -4503,7 +4505,7 @@ it skips the contents of comments that end before point." (error nil))) (and blinkpos ;; Not syntax '$'. - (not (eq (syntax-class (syntax-after blinkpos)) 8)) + (not (setq isdollar (eq (syntax-class (syntax-after blinkpos)) 8))) (setq matching-paren (let ((syntax (syntax-after blinkpos))) (and (consp syntax) @@ -4511,12 +4513,19 @@ it skips the contents of comments that end before point." (cdr syntax))))) (cond ((not blinkpos) - (unless (and blink-matching-paren-distance (> new-start old-start)) + ;; Don't complain when `$' with no blinkpos, because it + ;; could just be the first one in the buffer. + (unless (or (eq (syntax-class (syntax-after (1- oldpos))) 8) + (and blink-matching-paren-distance + (> new-start old-start)) ;; When `blink-matching-paren-distance' is non-nil and we ;; didn't find a matching paren within that many characters ;; don't display a message. - (message "Unmatched parenthesis"))) - ((not (or (eq matching-paren (char-before oldpos)) + (message "Unmatched parenthesis")))) + ;; isdollar is for: + ;; http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00871.html + ((not (or isdollar + (eq matching-paren (char-before oldpos)) ;; The cdr might hold a new paren-class info rather than ;; a matching-char info, in which case the two CDRs ;; should match. From 450c1882ff144972faec9a6388beb762f1823f40 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 16 Oct 2007 02:17:51 +0000 Subject: [PATCH 009/127] Revert accidental deletion. --- lisp/ChangeLog | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 155f410f9d2..c8182d76fe5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,16 @@ * simple.el (blink-matching-open): Don't report false errors with the `$' syntax class. +2007-10-15 Juanma Barranquero + + * filesets.el (filesets-alist-get): Use `let' rather than `let*'. + (filesets-ormap, filesets-sort-case-sensitive-flag) + (filesets-remake-shortcut, filesets-ingroup-collect-files): + Fix typos in docstrings. + (filesets-data-get-name, filesets-data-get-data) + (filesets-data-set, filesets-cmd-query-replace-getargs) + (filesets-ingroup-collect, filesets-find-or-display-file): Doc fixes. + 2007-10-15 YAMAMOTO Mitsuharu * term/mac-win.el: Don't require url when compiling, as url-type is From de13cecf7a1d7525e54b5a93a59dcc40a1582ee4 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 16 Oct 2007 02:24:50 +0000 Subject: [PATCH 010/127] (Diary): Clarify text about diary file example. --- man/ChangeLog | 4 ++++ man/calendar.texi | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 6b8affa4888..d329e0dfd72 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2007-10-16 Richard Stallman + + * calendar.texi (Diary): Clarify text about diary file example. + 2007-10-13 Glenn Morris * misc.texi (Interactive Shell): Correct INSIDE_EMACS reference. diff --git a/man/calendar.texi b/man/calendar.texi index 5182474622d..12d5b68a371 100644 --- a/man/calendar.texi +++ b/man/calendar.texi @@ -989,9 +989,8 @@ events for today, for the immediate future, or for any specified date. The name of the diary file is specified by the variable -@code{diary-file}; @file{~/diary} is the default. A sample diary file -is (note that the file format is essentially the same as that used by -the external shell utility @samp{calendar}): +@code{diary-file}; @file{~/diary} is the default. Here's an example +showing what that file looks like: @example 12/22/1988 Twentieth wedding anniversary!! @@ -1008,8 +1007,10 @@ April 15, 1989 Income tax due. @end example @noindent -This example uses extra spaces to align the event descriptions of most -of the entries. Such formatting is purely a matter of taste. +This format is essentially the same as the one used by the system's +@program{calendar} utility. This example uses extra spaces to align +the event descriptions of most of the entries. Such formatting is +purely a matter of taste. Although you probably will start by creating a diary manually, Emacs provides a number of commands to let you view, add, and change diary From 974992a66b4d7e85549b76411b607836f27f6045 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 16 Oct 2007 02:34:58 +0000 Subject: [PATCH 011/127] (ad-get-advice-info): Change to a function. (ad-get-advice-info-macro): New macro, like old ad-get-advice-info. (ad-is-advised, ad-get-advice-info-field) (ad-set-advice-info-field): Use ad-get-advice-info-macro. --- lisp/ChangeLog | 7 +++++++ lisp/emacs-lisp/advice.el | 15 +++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c8182d76fe5..49ce02d5bbe 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2007-10-16 Richard Stallman + + * emacs-lisp/advice.el (ad-get-advice-info): Change to a function. + (ad-get-advice-info-macro): New macro, like old ad-get-advice-info. + (ad-is-advised, ad-get-advice-info-field) + (ad-set-advice-info-field): Use ad-get-advice-info-macro. + 2007-10-16 Glenn Morris * simple.el (blink-matching-open): Don't report false errors with diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index ed97c8786d4..a969308be2a 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -2013,7 +2013,10 @@ On each iteration VAR will be bound to the name of an advised function (if (not (get 'ad-do-advised-functions 'lisp-indent-hook)) (put 'ad-do-advised-functions 'lisp-indent-hook 1)) -(defmacro ad-get-advice-info (function) +(defun ad-get-advice-info (function) + (get function 'ad-advice-info)) + +(defmacro ad-get-advice-info-macro (function) `(get ,function 'ad-advice-info)) (defmacro ad-set-advice-info (function advice-info) @@ -2025,7 +2028,7 @@ On each iteration VAR will be bound to the name of an advised function (defmacro ad-is-advised (function) "Return non-nil if FUNCTION has any advice info associated with it. This does not mean that the advice is also active." - (list 'ad-get-advice-info function)) + (list 'ad-get-advice-info-macro function)) (defun ad-initialize-advice-info (function) "Initialize the advice info for FUNCTION. @@ -2035,16 +2038,16 @@ Assumes that FUNCTION has not yet been advised." (defmacro ad-get-advice-info-field (function field) "Retrieve the value of the advice info FIELD of FUNCTION." - `(cdr (assq ,field (ad-get-advice-info ,function)))) + `(cdr (assq ,field (ad-get-advice-info-macro ,function)))) (defun ad-set-advice-info-field (function field value) "Destructively modify VALUE of the advice info FIELD of FUNCTION." (and (ad-is-advised function) - (cond ((assq field (ad-get-advice-info function)) + (cond ((assq field (ad-get-advice-info-macro function)) ;; A field with that name is already present: - (rplacd (assq field (ad-get-advice-info function)) value)) + (rplacd (assq field (ad-get-advice-info-macro function)) value)) (t;; otherwise, create a new field with that name: - (nconc (ad-get-advice-info function) + (nconc (ad-get-advice-info-macro function) (list (cons field value))))))) ;; Don't make this a macro so we can use it as a predicate: From 745dc723d967d3a880b2a560e4b87b58c94e89cc Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 16 Oct 2007 02:37:33 +0000 Subject: [PATCH 012/127] (ad-get-advice-info): Change to a function. (ad-get-advice-info-macro): New macro, like old ad-get-advice-info. (ad-is-advised, ad-get-advice-info-field) (ad-set-advice-info-field): Use ad-get-advice-info-macro. --- lisp/ChangeLog | 7 +++++++ lisp/emacs-lisp/advice.el | 15 +++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 96d6a627dcd..274d26d7d57 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2007-10-16 Richard Stallman + + * emacs-lisp/advice.el (ad-get-advice-info): Change to a function. + (ad-get-advice-info-macro): New macro, like old ad-get-advice-info. + (ad-is-advised, ad-get-advice-info-field) + (ad-set-advice-info-field): Use ad-get-advice-info-macro. + 2007-10-15 Stefan Monnier * vc-hooks.el (vc-workfile-version): Compatibility alias. diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index cabd0dd391e..4a5c9149a43 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -2013,7 +2013,10 @@ On each iteration VAR will be bound to the name of an advised function (if (not (get 'ad-do-advised-functions 'lisp-indent-hook)) (put 'ad-do-advised-functions 'lisp-indent-hook 1)) -(defmacro ad-get-advice-info (function) +(defun ad-get-advice-info (function) + (get function 'ad-advice-info)) + +(defmacro ad-get-advice-info-macro (function) `(get ,function 'ad-advice-info)) (defmacro ad-set-advice-info (function advice-info) @@ -2025,7 +2028,7 @@ On each iteration VAR will be bound to the name of an advised function (defmacro ad-is-advised (function) "Return non-nil if FUNCTION has any advice info associated with it. This does not mean that the advice is also active." - (list 'ad-get-advice-info function)) + (list 'ad-get-advice-info-macro function)) (defun ad-initialize-advice-info (function) "Initialize the advice info for FUNCTION. @@ -2035,16 +2038,16 @@ Assumes that FUNCTION has not yet been advised." (defmacro ad-get-advice-info-field (function field) "Retrieve the value of the advice info FIELD of FUNCTION." - `(cdr (assq ,field (ad-get-advice-info ,function)))) + `(cdr (assq ,field (ad-get-advice-info-macro ,function)))) (defun ad-set-advice-info-field (function field value) "Destructively modify VALUE of the advice info FIELD of FUNCTION." (and (ad-is-advised function) - (cond ((assq field (ad-get-advice-info function)) + (cond ((assq field (ad-get-advice-info-macro function)) ;; A field with that name is already present: - (rplacd (assq field (ad-get-advice-info function)) value)) + (rplacd (assq field (ad-get-advice-info-macro function)) value)) (t;; otherwise, create a new field with that name: - (nconc (ad-get-advice-info function) + (nconc (ad-get-advice-info-macro function) (list (cons field value))))))) ;; Don't make this a macro so we can use it as a predicate: From bf825c621d0239098ae36834af0cd5b0b513d6a9 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 16 Oct 2007 02:41:08 +0000 Subject: [PATCH 013/127] Re-fill copyright header. (blink-matching-open): Don't report false errors with the `$' syntax class. --- lisp/ChangeLog | 5 +++++ lisp/simple.el | 19 +++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 274d26d7d57..17135a37a33 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-16 Glenn Morris + + * simple.el (blink-matching-open): Don't report false errors with + the `$' syntax class. + 2007-10-16 Richard Stallman * emacs-lisp/advice.el (ad-get-advice-info): Change to a function. diff --git a/lisp/simple.el b/lisp/simple.el index 1cfaf6bca22..b5ca79de027 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1,7 +1,8 @@ ;;; simple.el --- basic editing commands for Emacs ;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +;; Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: internal @@ -4657,6 +4658,8 @@ it skips the contents of comments that end before point." (point)))))) (let* ((oldpos (point)) (message-log-max nil) ; Don't log messages about paren matching. + (atdollar (eq (syntax-class (syntax-after (1- oldpos))) 8)) + (isdollar) (blinkpos (save-excursion (save-restriction @@ -4674,20 +4677,28 @@ it skips the contents of comments that end before point." (matching-paren (and blinkpos ;; Not syntax '$'. - (not (eq (syntax-class (syntax-after blinkpos)) 8)) + (not (setq isdollar + (eq (syntax-class (syntax-after blinkpos)) 8))) (let ((syntax (syntax-after blinkpos))) (and (consp syntax) (eq (syntax-class syntax) 4) (cdr syntax)))))) (cond - ((not (or (eq matching-paren (char-before oldpos)) + ;; isdollar is for: + ;; http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00871.html + ((not (or (and isdollar blinkpos) + (and atdollar (not blinkpos)) ; see below + (eq matching-paren (char-before oldpos)) ;; The cdr might hold a new paren-class info rather than ;; a matching-char info, in which case the two CDRs ;; should match. (eq matching-paren (cdr (syntax-after (1- oldpos)))))) (message "Mismatched parentheses")) ((not blinkpos) - (if (not blink-matching-paren-distance) + (or blink-matching-paren-distance + ;; Don't complain when `$' with no blinkpos, because it + ;; could just be the first one typed in the buffer. + atdollar (message "Unmatched parenthesis"))) ((pos-visible-in-window-p blinkpos) ;; Matching open within window, temporarily move to blinkpos but only From 11fb4bdbbdab3e17e020d9ed4a6c754cdfb89167 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 16 Oct 2007 03:28:43 +0000 Subject: [PATCH 014/127] (Fsnarf_documentation): Simplify. --- src/ChangeLog | 4 ++++ src/doc.c | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 4ba46df0f23..bed9166f9f0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2007-10-16 Stefan Monnier + + * doc.c (Fsnarf_documentation): Simplify. + 2007-10-14 Juanma Barranquero * w32term.c (w32_font_is_double_byte, my_create_scrollbar): Make static. diff --git a/src/doc.c b/src/doc.c index 25f6625d404..4cd43f0ae90 100644 --- a/src/doc.c +++ b/src/doc.c @@ -691,15 +691,17 @@ the same file name is found in the `doc-directory'. */) if (fromfile[len-1] == 'c') fromfile[len-1] = 'o'; - if (EQ (Fmember (build_string (fromfile), Vbuild_files), Qnil)) - skip_file = 1; - else - skip_file = 0; + skip_file = NILP (Fmember (build_string (fromfile), + Vbuild_files)); } sym = oblookup (Vobarray, p + 2, multibyte_chars_in_text (p + 2, end - p - 2), end - p - 2); + /* Check skip_file so that when a function is defined several + times in different files (typically, once in xterm, once in + w32term, ...), we only pay attention to the one that + matters. */ if (! skip_file && SYMBOLP (sym)) { /* Attach a docstring to a variable? */ From da6658e85d66433b154a0b48cb4f8377e12ceff0 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Tue, 16 Oct 2007 09:00:09 +0000 Subject: [PATCH 015/127] (handle_display_prop): Ignore display specs after replacing one when string text is being replaced. (handle_single_display_spec): Pretend as if characters with display property haven't been consumed only when buffer text is being replaced. --- admin/FOR-RELEASE | 8 -------- src/ChangeLog | 7 +++++++ src/xdisp.c | 26 +++++++++++++++++++++----- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 96129ec22d4..1f8d0fec762 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -57,14 +57,6 @@ http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-09/msg00055.html ** ams@gnu.org, 9 July: eshell and external commands http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00385.html -** jbw@macs.hw.ac.uk, Sep 19: redisplay goes horribly wrong when a -before-string contains multiple display properties -http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg02442.html - -** jbw@macs.hw.ac.uk, Sep 19: part of display property on before-string - property is not displayed -http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00138.html - ** lekktu@gmail.com, Oct 11: frame-local variables weirdness I proposed a patch, which fixed this and seemed right, but the patch caused other problems. They are being investigated now. diff --git a/src/ChangeLog b/src/ChangeLog index 2317e4302a9..5a4c51c84d8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2007-10-16 YAMAMOTO Mitsuharu + + * xdisp.c (handle_display_prop): Ignore display specs after + replacing one when string text is being replaced. + (handle_single_display_spec): Pretend as if characters with display + property haven't been consumed only when buffer text is being replaced. + 2007-10-14 Juanma Barranquero * eval.c (do_autoload): Don't save autoloads. diff --git a/src/xdisp.c b/src/xdisp.c index 22a0b9dbe05..92c0af8c5ed 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3839,7 +3839,13 @@ handle_display_prop (it) { if (handle_single_display_spec (it, XCAR (prop), object, position, display_replaced_p)) - display_replaced_p = 1; + { + display_replaced_p = 1; + /* If some text in a string is replaced, `position' no + longer points to the position of `object'. */ + if (STRINGP (object)) + break; + } } } else if (VECTORP (prop)) @@ -3848,7 +3854,13 @@ handle_display_prop (it) for (i = 0; i < ASIZE (prop); ++i) if (handle_single_display_spec (it, AREF (prop, i), object, position, display_replaced_p)) - display_replaced_p = 1; + { + display_replaced_p = 1; + /* If some text in a string is replaced, `position' no + longer points to the position of `object'. */ + if (STRINGP (object)) + break; + } } else { @@ -4237,13 +4249,16 @@ handle_single_display_spec (it, spec, object, position, /* Say that we haven't consumed the characters with `display' property yet. The call to pop_it in set_iterator_to_next will clean this up. */ - *position = start_pos; + if (BUFFERP (object)) + it->current.pos = start_pos; } else if (CONSP (value) && EQ (XCAR (value), Qspace)) { it->method = GET_FROM_STRETCH; it->object = value; - *position = it->position = start_pos; + it->position = start_pos; + if (BUFFERP (object)) + it->current.pos = start_pos; } #ifdef HAVE_WINDOW_SYSTEM else @@ -4257,7 +4272,8 @@ handle_single_display_spec (it, spec, object, position, /* Say that we haven't consumed the characters with `display' property yet. The call to pop_it in set_iterator_to_next will clean this up. */ - *position = start_pos; + if (BUFFERP (object)) + it->current.pos = start_pos; } #endif /* HAVE_WINDOW_SYSTEM */ From e749f5762b6c8a7e531918a3c0e771609d1ba016 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Tue, 16 Oct 2007 10:40:02 +0000 Subject: [PATCH 016/127] (bs--make-header-match-string, bs-show-in-buffer, bs--nth-wrapper): Simplify. (bs-select, bs--insert-one-entry): Simplify. Use `when'. (bs-buffer-list): Simplify. Use `when'. Use `string-match-p'. (bs-sort-buffer-interns-are-last): Use `string-match-p'. (bs-attributes-list, bs-max-window-height, bs-must-always-show-regexp, bs-maximal-buffer-name-column, bs-minimal-buffer-name-column, bs-configurations, bs-default-configuration, bs-alternative-configuration, bs-cycle-configuration-name, bs-string-show-always, bs-string-show-never, bs-string-current, bs-string-current-marked, bs-string-marked, bs-string-show-normally, bs-sort-functions, bs-default-sort-name): Remove * in docstrings. (bs--redisplay, bs--goto-current-buffer, bs--current-buffer, bs-delete, bs-apply-sort-faces, bs-next-config-aux): Use `when'. (bs--window-config-coming-from): Revert 2006-11-09 change. (bs--restore-window-config): Keep the selected frame. (bs--track-window-changes, bs--remove-hooks): New functions. (bs-mode): Use `define-derived-mode'. Set hook to track window changes. (bs--create-header): Remove. (bs--create-header-line): New function, based on `bs--create-header'. (bs--show-header): Use `bs--create-header-line'. (bs--show-with-configuration): Revert 2006-11-09 change. Don't reuse window unless it is visible on the selected frame. Restore window configuration (possibly in a different frame) before creating any window. --- lisp/ChangeLog | 28 +++++ lisp/bs.el | 283 ++++++++++++++++++++++++------------------------- 2 files changed, 167 insertions(+), 144 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 17135a37a33..69919bdec0f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,31 @@ +2007-10-16 Juanma Barranquero + + * bs.el (bs--make-header-match-string, bs-show-in-buffer) + (bs--nth-wrapper): Simplify. + (bs-select, bs--insert-one-entry): Simplify. Use `when'. + (bs-buffer-list): Simplify. Use `when'. Use `string-match-p'. + (bs-sort-buffer-interns-are-last): Use `string-match-p'. + (bs-attributes-list, bs-max-window-height, bs-must-always-show-regexp) + (bs-maximal-buffer-name-column, bs-minimal-buffer-name-column) + (bs-configurations, bs-default-configuration) + (bs-alternative-configuration, bs-cycle-configuration-name) + (bs-string-show-always, bs-string-show-never, bs-string-current) + (bs-string-current-marked, bs-string-marked, bs-string-show-normally) + (bs-sort-functions, bs-default-sort-name): Remove * in docstrings. + (bs--redisplay, bs--goto-current-buffer, bs--current-buffer, bs-delete) + (bs-apply-sort-faces, bs-next-config-aux): Use `when'. + (bs--window-config-coming-from): Revert 2006-11-09 change. + (bs--restore-window-config): Keep the selected frame. + (bs--track-window-changes, bs--remove-hooks): New functions. + (bs-mode): Use `define-derived-mode'. Set hook to track window changes. + (bs--create-header): Remove. + (bs--create-header-line): New function, based on `bs--create-header'. + (bs--show-header): Use `bs--create-header-line'. + (bs--show-with-configuration): Revert 2006-11-09 change. + Don't reuse window unless it is visible on the selected frame. + Restore window configuration (possibly in a different frame) + before creating any window. + 2007-10-16 Glenn Morris * simple.el (blink-matching-open): Don't report false errors with diff --git a/lisp/bs.el b/lisp/bs.el index 6390bd2dd81..bb2dbae83c0 100644 --- a/lisp/bs.el +++ b/lisp/bs.el @@ -158,7 +158,7 @@ ("" 2 2 left " ") ("File" 12 12 left bs--get-file-name) ("" 2 2 left " ")) - "*List specifying the layout of a Buffer Selection Menu buffer. + "List specifying the layout of a Buffer Selection Menu buffer. Each entry specifies a column and is a list of the form of: \(HEADER MINIMUM-LENGTH MAXIMUM-LENGTH ALIGNMENT FUN-OR-STRING) @@ -180,12 +180,7 @@ return a string representing the column's value." (defun bs--make-header-match-string () "Return a regexp matching the first line of a Buffer Selection Menu buffer." - (let ((res "^\\(") - (ele bs-attributes-list)) - (while ele - (setq res (concat res (car (car ele)) " *")) - (setq ele (cdr ele))) - (concat res "$\\)"))) + (concat "^\\(" (mapconcat #'car bs-attributes-list " *") " *$\\)")) ;; Font-Lock-Settings (defvar bs-mode-font-lock-keywords @@ -206,7 +201,7 @@ return a string representing the column's value." "Default font lock expressions for Buffer Selection Menu.") (defcustom bs-max-window-height 20 - "*Maximal window height of Buffer Selection Menu." + "Maximal window height of Buffer Selection Menu." :group 'bs-appearance :type 'integer) @@ -224,7 +219,7 @@ it is reset to nil. Use `bs-must-always-show-regexp' to specify buffers that must always be shown regardless of the configuration.") (defcustom bs-must-always-show-regexp nil - "*Regular expression for specifying buffers to show always. + "Regular expression for specifying buffers to show always. A buffer whose name matches this regular expression will be shown regardless of current configuration of Buffer Selection Menu." :group 'bs @@ -246,7 +241,7 @@ The function gets two arguments - the buffers to compare. It must return non-nil if the first buffer should sort before the second.") (defcustom bs-maximal-buffer-name-column 45 - "*Maximum column width for buffer names. + "Maximum column width for buffer names. The column for buffer names has dynamic width. The width depends on maximal and minimal length of names of buffers to show. The maximal width is bounded by `bs-maximal-buffer-name-column'. @@ -255,7 +250,7 @@ See also `bs-minimal-buffer-name-column'." :type 'integer) (defcustom bs-minimal-buffer-name-column 15 - "*Minimum column width for buffer names. + "Minimum column width for buffer names. The column for buffer names has dynamic width. The width depends on maximal and minimal length of names of buffers to show. The minimal width is bounded by `bs-minimal-buffer-name-column'. @@ -272,7 +267,7 @@ See also `bs-maximal-buffer-name-column'." ("files-and-scratch" "^\\*scratch\\*$" nil nil bs-visits-non-file bs-sort-buffer-interns-are-last) ("all-intern-last" nil nil nil nil bs-sort-buffer-interns-are-last)) - "*List of all configurations you can use in the Buffer Selection Menu. + "List of all configurations you can use in the Buffer Selection Menu. A configuration describes which buffers appear in Buffer Selection Menu and also the order of buffers. A configuration is a list with six elements. The first element is a string and describes the configuration. @@ -284,7 +279,7 @@ By setting these variables you define a configuration." :type '(repeat sexp)) (defcustom bs-default-configuration "files" - "*Name of default configuration used by the Buffer Selection Menu. + "Name of default configuration used by the Buffer Selection Menu. \\ Will be changed using key \\[bs-select-next-configuration]. Must be a string used in `bs-configurations' for naming a configuration." @@ -292,7 +287,7 @@ Must be a string used in `bs-configurations' for naming a configuration." :type 'string) (defcustom bs-alternative-configuration "all" - "*Name of configuration used when calling `bs-show' with \ + "Name of configuration used when calling `bs-show' with \ \\[universal-argument] as prefix key. Must be a string used in `bs-configurations' for naming a configuration." :group 'bs @@ -303,7 +298,7 @@ Must be a string used in `bs-configurations' for naming a configuration." Must be a string used in `bs-configurations' for naming a configuration.") (defcustom bs-cycle-configuration-name nil - "*Name of configuration used when cycling through the buffer list. + "Name of configuration used when cycling through the buffer list. A value of nil means to use current configuration `bs-default-configuration'. Must be a string used in `bs-configurations' for naming a configuration." :group 'bs @@ -311,32 +306,32 @@ Must be a string used in `bs-configurations' for naming a configuration." string)) (defcustom bs-string-show-always "+" - "*String added in column 1 indicating a buffer will always be shown." + "String added in column 1 indicating a buffer will always be shown." :group 'bs-appearance :type 'string) (defcustom bs-string-show-never "-" - "*String added in column 1 indicating a buffer will never be shown." + "String added in column 1 indicating a buffer will never be shown." :group 'bs-appearance :type 'string) (defcustom bs-string-current "." - "*String added in column 1 indicating the current buffer." + "String added in column 1 indicating the current buffer." :group 'bs-appearance :type 'string) (defcustom bs-string-current-marked "#" - "*String added in column 1 indicating the current buffer when it is marked." + "String added in column 1 indicating the current buffer when it is marked." :group 'bs-appearance :type 'string) (defcustom bs-string-marked ">" - "*String added in column 1 indicating a marked buffer." + "String added in column 1 indicating a marked buffer." :group 'bs-appearance :type 'string) (defcustom bs-string-show-normally " " - "*String added in column 1 indicating an unmarked buffer." + "String added in column 1 indicating an unmarked buffer." :group 'bs-appearance :type 'string) @@ -390,7 +385,7 @@ A value of `always' means to show buffer regardless of the configuration.") ("by mode" bs--sort-by-mode "Mode" region) ("by filename" bs--sort-by-filename "File" region) ("by nothing" nil nil nil)) - "*List of all possible sorting aspects for Buffer Selection Menu. + "List of all possible sorting aspects for Buffer Selection Menu. You can add a new entry with a call to `bs-define-sort-function'. Each element is a list of four elements (NAME FUNCTION REGEXP-FOR-SORTING FACE). NAME specifies the sort order defined by function FUNCTION. @@ -425,7 +420,7 @@ The new sort aspect will be inserted into list `bs-sort-functions'." This is an element of `bs-sort-functions'.") (defcustom bs-default-sort-name "by nothing" - "*Name of default sort behavior. + "Name of default sort behavior. Must be \"by nothing\" or a string used in `bs-sort-functions' for naming a sort behavior. Default is \"by nothing\" which means no sorting." :group 'bs @@ -445,7 +440,6 @@ defined by current configuration `bs-current-configuration'.") (defvar bs--window-config-coming-from nil "Window configuration before starting Buffer Selection Menu.") -(make-variable-frame-local 'bs--window-config-coming-from) (defvar bs--intern-show-never "^ \\|\\*buffer-selection\\*" "Regular expression specifying which buffers never to show. @@ -529,45 +523,43 @@ a special function. SORT-DESCRIPTION is an element of `bs-sort-functions'." (setq sort-description (or sort-description bs--current-sort-function) list (or list (buffer-list))) (let ((result nil)) - (while list - (let* ((buffername (buffer-name (car list))) - (int-show-never (string-match bs--intern-show-never buffername)) + (dolist (buf list) + (let* ((buffername (buffer-name buf)) + (int-show-never (string-match-p bs--intern-show-never buffername)) (ext-show-never (and bs-dont-show-regexp - (string-match bs-dont-show-regexp - buffername))) + (string-match-p bs-dont-show-regexp + buffername))) (extern-must-show (or (and bs-must-always-show-regexp - (string-match + (string-match-p bs-must-always-show-regexp buffername)) (and bs-must-show-regexp - (string-match bs-must-show-regexp - buffername)))) + (string-match-p bs-must-show-regexp + buffername)))) (extern-show-never-from-fun (and bs-dont-show-function (funcall bs-dont-show-function - (car list)))) + buf))) (extern-must-show-from-fun (and bs-must-show-function (funcall bs-must-show-function - (car list)))) - (show-flag (buffer-local-value 'bs-buffer-show-mark (car list)))) - (if (or (eq show-flag 'always) - (and (or bs--show-all (not (eq show-flag 'never))) - (not int-show-never) - (or bs--show-all - extern-must-show - extern-must-show-from-fun - (and (not ext-show-never) - (not extern-show-never-from-fun))))) - (setq result (cons (car list) - result))) - (setq list (cdr list)))) + buf))) + (show-flag (buffer-local-value 'bs-buffer-show-mark buf))) + (when (or (eq show-flag 'always) + (and (or bs--show-all (not (eq show-flag 'never))) + (not int-show-never) + (or bs--show-all + extern-must-show + extern-must-show-from-fun + (and (not ext-show-never) + (not extern-show-never-from-fun))))) + (setq result (cons buf result))))) (setq result (reverse result)) ;; The current buffer which was the start point of bs should be an element ;; of result list, so that we can leave with space and be back in the ;; buffer we started bs-show. - (if (and bs--buffer-coming-from - (buffer-live-p bs--buffer-coming-from) - (not (memq bs--buffer-coming-from result))) - (setq result (cons bs--buffer-coming-from result))) + (when (and bs--buffer-coming-from + (buffer-live-p bs--buffer-coming-from) + (not (memq bs--buffer-coming-from result))) + (setq result (cons bs--buffer-coming-from result))) ;; sorting (if (and sort-description (nth 1 sort-description)) @@ -587,8 +579,8 @@ If KEEP-LINE-P is non-nil the point will stay on current line. SORT-DESCRIPTION is an element of `bs-sort-functions'." (let ((line (1+ (count-lines 1 (point))))) (bs-show-in-buffer (bs-buffer-list nil sort-description)) - (if keep-line-p - (goto-line line)) + (when keep-line-p + (goto-line line)) (beginning-of-line))) (defun bs--goto-current-buffer () @@ -602,10 +594,10 @@ actually the line which begins with character in `bs-string-current' or point) (save-excursion (goto-char (point-min)) - (if (search-forward-regexp regexp nil t) - (setq point (- (point) 1)))) - (if point - (goto-char point)))) + (when (search-forward-regexp regexp nil t) + (setq point (1- (point))))) + (when point + (goto-char point)))) (defun bs--current-config-message () "Return a string describing the current `bs-mode' configuration." @@ -614,7 +606,23 @@ actually the line which begins with character in `bs-string-current' or (format "Show buffer by configuration %S" bs-current-configuration))) -(defun bs-mode () +(defun bs--track-window-changes (frame) + "Track window changes to refresh the buffer list. +Used from `window-size-change-functions'." + (let ((win (get-buffer-window "*buffer-selection*" frame))) + (when win + (with-selected-window win + (bs-refresh) + (bs--set-window-height))))) + +(defun bs--remove-hooks () + "Remove `bs--track-window-changes' and auxiliary hooks." + (remove-hook 'window-size-change-functions 'bs--track-window-changes) + ;; Remove itself + (remove-hook 'kill-buffer-hook 'bs--remove-hooks t) + (remove-hook 'change-major-mode-hook 'bs--remove-hooks t)) + +(define-derived-mode bs-mode nil "Buffer-Selection-Menu" "Major mode for editing a subset of Emacs' buffers. \\ Aside from two header lines each line describes one buffer. @@ -647,27 +655,27 @@ available Buffer Selection Menu configuration. to show always. \\[bs-visit-tags-table] -- call `visit-tags-table' on current line's buffer. \\[bs-help] -- display this help text." - (interactive) - (kill-all-local-variables) - (use-local-map bs-mode-map) (make-local-variable 'font-lock-defaults) (make-local-variable 'font-lock-verbose) (make-local-variable 'font-lock-global-modes) (buffer-disable-undo) - (setq major-mode 'bs-mode - mode-name "Buffer-Selection-Menu" - buffer-read-only t + (setq buffer-read-only t truncate-lines t show-trailing-whitespace nil font-lock-global-modes '(not bs-mode) font-lock-defaults '(bs-mode-font-lock-keywords t) font-lock-verbose nil) - (run-mode-hooks 'bs-mode-hook)) + (add-hook 'window-size-change-functions 'bs--track-window-changes) + (add-hook 'kill-buffer-hook 'bs--remove-hooks nil t) + (add-hook 'change-major-mode-hook 'bs--remove-hooks nil t)) (defun bs--restore-window-config () "Restore window configuration on the current frame." (when bs--window-config-coming-from - (set-window-configuration bs--window-config-coming-from) + (let ((frame (selected-frame))) + (unwind-protect + (set-window-configuration bs--window-config-coming-from) + (select-frame frame))) (setq bs--window-config-coming-from nil))) (defun bs-kill () @@ -705,8 +713,8 @@ Raise an error if not on a buffer line." (beginning-of-line) (let ((line (+ (- bs-header-lines-length) (count-lines 1 (point))))) - (if (< line 0) - (error "You are on a header row")) + (when (< line 0) + (error "You are on a header row")) (nth line bs-current-list))) (defun bs--update-current-line () @@ -736,19 +744,18 @@ Leave Buffer Selection Menu." (bury-buffer (current-buffer)) (bs--restore-window-config) (switch-to-buffer buffer) - (if bs--marked-buffers - ;; Some marked buffers for selection - (let* ((all (delq buffer bs--marked-buffers)) - (height (/ (1- (frame-height)) (1+ (length all))))) - (delete-other-windows) - (switch-to-buffer buffer) - (while all - (split-window nil height) - (other-window 1) - (switch-to-buffer (car all)) - (setq all (cdr all))) - ;; goto window we have started bs. - (other-window 1))))) + (when bs--marked-buffers + ;; Some marked buffers for selection + (let* ((all (delq buffer bs--marked-buffers)) + (height (/ (1- (frame-height)) (1+ (length all))))) + (delete-other-windows) + (switch-to-buffer buffer) + (dolist (buf all) + (split-window nil height) + (other-window 1) + (switch-to-buffer buf)) + ;; goto window we have started bs. + (other-window 1))))) (defun bs-select-other-window () "Select current line's buffer by `switch-to-buffer-other-window'. @@ -912,11 +919,10 @@ WHAT is a value of nil, `never', or `always'." (delete-region (point) (save-excursion (end-of-line) (if (eobp) (point) (1+ (point))))) - (if (eobp) - (progn - (backward-delete-char 1) - (beginning-of-line) - (recenter -1))) + (when (eobp) + (backward-delete-char 1) + (beginning-of-line) + (recenter -1)) (bs--set-window-height))) (defun bs-delete-backward () @@ -945,14 +951,14 @@ Default is `bs--current-sort-function'." bs--current-sort-function))) (save-excursion (goto-char (point-min)) - (if (and (nth 2 sort-description) - (search-forward-regexp (nth 2 sort-description) nil t)) - (let ((inhibit-read-only t)) - (put-text-property (match-beginning 0) - (match-end 0) - 'face - (or (nth 3 sort-description) - 'region))))))) + (when (and (nth 2 sort-description) + (search-forward-regexp (nth 2 sort-description) nil t)) + (let ((inhibit-read-only t)) + (put-text-property (match-beginning 0) + (match-end 0) + 'face + (or (nth 3 sort-description) + 'region))))))) (defun bs-toggle-show-all () "Toggle show all buffers / show buffers with current configuration." @@ -983,10 +989,8 @@ Uses function `vc-toggle-read-only'." (defun bs--nth-wrapper (count fun &rest args) "Call COUNT times function FUN with arguments ARGS." - (setq count (or count 1)) - (while (> count 0) - (apply fun args) - (setq count (1- count)))) + (dotimes (i (or count 1)) + (apply fun args))) (defun bs-up (arg) "Move cursor vertically up ARG lines in Buffer Selection Menu." @@ -1026,7 +1030,7 @@ A value of nil means BUFFER belongs to a file." (defun bs-sort-buffer-interns-are-last (b1 b2) "Function for sorting internal buffers at the end of all buffers." - (string-match "^\\*" (buffer-name b2))) + (string-match-p "^\\*" (buffer-name b2))) ;; ---------------------------------------------------------------------- ;; Configurations: @@ -1108,8 +1112,8 @@ Will return the first if START-NAME is at end." (length (length list)) pos) (while (and assocs (not pos)) - (if (string= (car (car assocs)) start-name) - (setq pos (- length (length assocs)))) + (when (string= (car (car assocs)) start-name) + (setq pos (- length (length assocs)))) (setq assocs (cdr assocs))) (setq pos (1+ pos)) (if (eq pos length) @@ -1151,10 +1155,9 @@ and move point to current buffer." (erase-buffer) (setq bs--name-entry-length name-entry-length) (bs--show-header) - (while list - (bs--insert-one-entry (car list)) - (insert "\n") - (setq list (cdr list))) + (dolist (buffer list) + (bs--insert-one-entry buffer) + (insert "\n")) (delete-backward-char 1) (bs--set-window-height) (bs--goto-current-buffer) @@ -1348,27 +1351,21 @@ It goes over all columns described in `bs-attributes-list' and evaluates corresponding string. Inserts string in current buffer; normally *buffer-selection*." (let ((string "") - (columns bs-attributes-list) (to-much 0) (apply-args (append (list bs--buffer-coming-from bs-current-list)))) (save-excursion - (while columns - (set-buffer buffer) - (let ((min (bs--get-value (nth 1 (car columns)))) - ;;(max (bs--get-value (nth 2 (car columns)))) refered no more - (align (nth 3 (car columns))) - (fun (nth 4 (car columns))) - (val nil) - new-string) - (setq val (bs--get-value fun apply-args)) - (setq new-string (bs--format-aux val align (- min to-much))) + (set-buffer buffer) + (dolist (column bs-attributes-list) + (let* ((min (bs--get-value (nth 1 column))) + (new-string (bs--format-aux (bs--get-value (nth 4 column) ; fun + apply-args) + (nth 3 column) ; align + (- min to-much))) + (len (length new-string))) (setq string (concat string new-string)) - (if (> (length new-string) min) - (setq to-much (- (length new-string) min))) - ) ; let - (setq columns (cdr columns)))) - (insert string) - string)) + (when (> len min) + (setq to-much (- len min)))))) + (insert string))) (defun bs--format-aux (string align len) "Pad STRING to length LEN with alignment ALIGN. @@ -1382,28 +1379,26 @@ ALIGN is one of the symbols `left', `middle', or `right'." (defun bs--show-header () "Insert header for Buffer Selection Menu in current buffer." - (dolist (string (bs--create-header)) - (insert string "\n"))) + (insert (bs--create-header-line #'identity) + "\n" + (bs--create-header-line (lambda (title) + (make-string (length title) ?-))) + "\n")) (defun bs--get-name-length () "Return value of `bs--name-entry-length'." bs--name-entry-length) -(defun bs--create-header () - "Return all header lines used in Buffer Selection Menu as a list of strings." - (list (mapconcat (lambda (column) - (bs--format-aux (bs--get-value (car column)) - (nth 3 column) ; align - (bs--get-value (nth 1 column)))) - bs-attributes-list - "") - (mapconcat (lambda (column) - (let ((length (length (bs--get-value (car column))))) - (bs--format-aux (make-string length ?-) - (nth 3 column) ; align - (bs--get-value (nth 1 column))))) - bs-attributes-list - ""))) +(defun bs--create-header-line (col) + "Generate a line for the header. +COL is called for each column in `bs-attributes-list' as a +function of one argument, the string heading for the column." + (mapconcat (lambda (column) + (bs--format-aux (funcall col (bs--get-value (car column))) + (nth 3 column) ; align + (bs--get-value (nth 1 column)))) + bs-attributes-list + "")) (defun bs--show-with-configuration (name &optional arg) "Display buffer list of configuration with name NAME. @@ -1424,14 +1419,14 @@ for buffer selection." (setq bs--buffer-coming-from (current-buffer))) (let ((liste (bs-buffer-list)) (active-window (get-window-with-predicate - (lambda (w) - (string= (buffer-name (window-buffer w)) - "*buffer-selection*"))))) + (lambda (w) + (string= (buffer-name (window-buffer w)) + "*buffer-selection*")) + nil (selected-frame)))) (if active-window (select-window active-window) - (modify-frame-parameters nil - (list (cons 'bs--window-config-coming-from - (current-window-configuration)))) + (bs--restore-window-config) + (setq bs--window-config-coming-from (current-window-configuration)) (when (> (window-height (selected-window)) 7) (split-window-vertically) (other-window 1))) From e7a4eaadf2f5ce31a310b8e4be10e2a7346c5e14 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Tue, 16 Oct 2007 10:52:09 +0000 Subject: [PATCH 017/127] (bs--window-config-coming-from): Revert 2006-11-09 change. (bs--restore-window-config): Keep the selected frame. (bs--track-window-changes, bs--remove-hooks): New functions. (bs-mode): Use `define-derived-mode'. Set hook to track window changes. (bs--show-with-configuration): Revert 2006-11-09 change. Don't reuse window unless it is visible on the selected frame. Restore window configuration (possibly in a different frame) before creating any window. --- lisp/bs.el | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/lisp/bs.el b/lisp/bs.el index 4d13c97c2fd..548d1b1cfef 100644 --- a/lisp/bs.el +++ b/lisp/bs.el @@ -445,7 +445,6 @@ defined by current configuration `bs-current-configuration'.") (defvar bs--window-config-coming-from nil "Window configuration before starting Buffer Selection Menu.") -(make-variable-frame-local 'bs--window-config-coming-from) (defvar bs--intern-show-never "^ \\|\\*buffer-selection\\*" "Regular expression specifying which buffers never to show. @@ -614,7 +613,23 @@ actually the line which begins with character in `bs-string-current' or (format "Show buffer by configuration %S" bs-current-configuration))) -(defun bs-mode () +(defun bs--track-window-changes (frame) + "Track window changes to refresh the buffer list. +Used from `window-size-change-functions'." + (let ((win (get-buffer-window "*buffer-selection*" frame))) + (when win + (with-selected-window win + (bs-refresh) + (bs--set-window-height))))) + +(defun bs--remove-hooks () + "Remove `bs--track-window-changes' and auxiliary hooks." + (remove-hook 'window-size-change-functions 'bs--track-window-changes) + ;; Remove itself + (remove-hook 'kill-buffer-hook 'bs--remove-hooks t) + (remove-hook 'change-major-mode-hook 'bs--remove-hooks t)) + +(define-derived-mode bs-mode () "Major mode for editing a subset of Emacs' buffers. \\ Aside from two header lines each line describes one buffer. @@ -647,27 +662,24 @@ available Buffer Selection Menu configuration. to show always. \\[bs-visit-tags-table] -- call `visit-tags-table' on current line's buffer. \\[bs-help] -- display this help text." - (interactive) - (kill-all-local-variables) - (use-local-map bs-mode-map) (make-local-variable 'font-lock-defaults) (make-local-variable 'font-lock-verbose) (make-local-variable 'font-lock-global-modes) (buffer-disable-undo) - (setq major-mode 'bs-mode - mode-name "Buffer-Selection-Menu" - buffer-read-only t + (setq buffer-read-only t truncate-lines t show-trailing-whitespace nil font-lock-global-modes '(not bs-mode) font-lock-defaults '(bs-mode-font-lock-keywords t) - font-lock-verbose nil) - (run-mode-hooks 'bs-mode-hook)) + font-lock-verbose nil)) (defun bs--restore-window-config () "Restore window configuration on the current frame." (when bs--window-config-coming-from - (set-window-configuration bs--window-config-coming-from) + (let ((frame (selected-frame))) + (unwind-protect + (set-window-configuration bs--window-config-coming-from) + (select-frame frame))) (setq bs--window-config-coming-from nil))) (defun bs-kill () @@ -1429,12 +1441,12 @@ for buffer selection." (active-window (get-window-with-predicate (lambda (w) (string= (buffer-name (window-buffer w)) - "*buffer-selection*"))))) + "*buffer-selection*")) + nil (selected-frame)))) (if active-window (select-window active-window) - (modify-frame-parameters nil - (list (cons 'bs--window-config-coming-from - (current-window-configuration)))) + (bs--restore-window-config) + (setq bs--window-config-coming-from (current-window-configuration)) (when (> (window-height (selected-window)) 7) (split-window-vertically) (other-window 1))) From 8db43126511d3ab721efe3c383de08ff661b2c35 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Tue, 16 Oct 2007 10:57:28 +0000 Subject: [PATCH 018/127] (bs-mode): Set hooks (accidentally left out in the previous commit). --- lisp/bs.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/bs.el b/lisp/bs.el index 548d1b1cfef..8667190fe9b 100644 --- a/lisp/bs.el +++ b/lisp/bs.el @@ -671,7 +671,10 @@ to show always. show-trailing-whitespace nil font-lock-global-modes '(not bs-mode) font-lock-defaults '(bs-mode-font-lock-keywords t) - font-lock-verbose nil)) + font-lock-verbose nil) + (add-hook 'window-size-change-functions 'bs--track-window-changes) + (add-hook 'kill-buffer-hook 'bs--remove-hooks nil t) + (add-hook 'change-major-mode-hook 'bs--remove-hooks nil t)) (defun bs--restore-window-config () "Restore window configuration on the current frame." From c2c0d96fcaa3dc16a2ddc7b7f0b2e1fcdfffb285 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Tue, 16 Oct 2007 11:10:48 +0000 Subject: [PATCH 019/127] *** empty log message *** --- lisp/ChangeLog | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 49ce02d5bbe..60bd1af0adc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2007-10-16 Juanma Barranquero + + * bs.el (bs--window-config-coming-from): Revert 2006-11-09 change. + (bs--restore-window-config): Keep the selected frame. + (bs--track-window-changes, bs--remove-hooks): New functions. + (bs-mode): Use `define-derived-mode'. Set hook to track window changes. + (bs--show-with-configuration): Revert 2006-11-09 change. + Don't reuse window unless it is visible on the selected frame. + Restore window configuration (possibly in a different frame) + before creating any window. + 2007-10-16 Richard Stallman * emacs-lisp/advice.el (ad-get-advice-info): Change to a function. From 4144e15e96e7d67ff0ebbed15ecc14154ba68da2 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 16 Oct 2007 15:18:39 +0000 Subject: [PATCH 020/127] (reindent-then-newline-and-indent): Don't assume that indent-according-to-mode preserves point. --- lisp/ChangeLog | 5 +++++ lisp/simple.el | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 69919bdec0f..2e5bb8bd790 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-16 Stefan Monnier + + * simple.el (reindent-then-newline-and-indent): Don't assume that + indent-according-to-mode preserves point. + 2007-10-16 Juanma Barranquero * bs.el (bs--make-header-match-string, bs-show-in-buffer) diff --git a/lisp/simple.el b/lisp/simple.el index b5ca79de027..3d5f6bfab10 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -633,7 +633,9 @@ column specified by the function `current-left-margin'." (newline) (save-excursion (goto-char pos) - (indent-according-to-mode) + ;; Usually indent-according-to-mode should "preserve" point, but it is + ;; not guaranteed; e.g. indent-to-left-margin doesn't. + (save-excursion (indent-according-to-mode)) (delete-horizontal-space t)) (indent-according-to-mode))) From 67ee9f6e9121a43a5bad61145b55d785d88bfabf Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 16 Oct 2007 15:42:58 +0000 Subject: [PATCH 021/127] * lisp.h (enum Lisp_Misc_Type): Del Lisp_Misc_Some_Buffer_Local_Value. (XMISCANY): New macro. (XMISCTYPE): Use it. (struct Lisp_Misc_Any): New type. (union Lisp_Misc): Use it. (struct Lisp_Buffer_Local_Value): Add `local_if_set' bit. * data.c (Fboundp, store_symval_forwarding, swap_in_global_binding) (find_symbol_value, set_internal, default_value, Fset_default) (Fmake_variable_buffer_local, Fmake_local_variable) (Fkill_local_variable, Fmake_variable_frame_local, Flocal_variable_p) (Flocal_variable_if_set_p, Fvariable_binding_locus): The SOME_BUFFER_LOCAL_VALUEP distinction is replaced by local_if_set. * alloc.c (allocate_buffer): Set the size and tag. (allocate_misc, mark_maybe_object, mark_object, survives_gc_p): Use XMISCANY. (die): Follow the GNU convention for error messages. * print.c (print_object): SOME_BUFFER_LOCAL_VALUEP -> local_if_set. * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Don't set the tag any more. (set_buffer_internal_1): * frame.c (store_frame_param): * eval.c (specbind): * xdisp.c (select_frame_for_redisplay): Drop SOME_BUFFER_LOCAL_VALUEP. --- src/ChangeLog | 24 +++++++++++++ src/alloc.c | 15 ++++---- src/buffer.c | 27 +++++--------- src/data.c | 99 +++++++++++++++++++++++---------------------------- src/eval.c | 11 +++--- src/frame.c | 3 +- src/lisp.h | 30 ++++++++++------ src/print.c | 6 ++-- src/xdisp.c | 6 ++-- 9 files changed, 114 insertions(+), 107 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index bed9166f9f0..3c275302f9f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,29 @@ 2007-10-16 Stefan Monnier + * lisp.h (enum Lisp_Misc_Type): Del Lisp_Misc_Some_Buffer_Local_Value. + (XMISCANY): New macro. + (XMISCTYPE): Use it. + (struct Lisp_Misc_Any): New type. + (union Lisp_Misc): Use it. + (struct Lisp_Buffer_Local_Value): Add `local_if_set' bit. + * data.c (Fboundp, store_symval_forwarding, swap_in_global_binding) + (find_symbol_value, set_internal, default_value, Fset_default) + (Fmake_variable_buffer_local, Fmake_local_variable) + (Fkill_local_variable, Fmake_variable_frame_local, Flocal_variable_p) + (Flocal_variable_if_set_p, Fvariable_binding_locus): + The SOME_BUFFER_LOCAL_VALUEP distinction is replaced by local_if_set. + * alloc.c (allocate_buffer): Set the size and tag. + (allocate_misc, mark_maybe_object, mark_object, survives_gc_p): + Use XMISCANY. + (die): Follow the GNU convention for error messages. + * print.c (print_object): SOME_BUFFER_LOCAL_VALUEP -> local_if_set. + * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Don't set the + tag any more. + (set_buffer_internal_1): + * frame.c (store_frame_param): + * eval.c (specbind): + * xdisp.c (select_frame_for_redisplay): Drop SOME_BUFFER_LOCAL_VALUEP. + * doc.c (Fsnarf_documentation): Simplify. 2007-10-14 Juanma Barranquero diff --git a/src/alloc.c b/src/alloc.c index 8e00733a60b..48857ecff14 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -1153,6 +1153,8 @@ allocate_buffer () struct buffer *b = (struct buffer *) lisp_malloc (sizeof (struct buffer), MEM_TYPE_BUFFER); + b->size = sizeof (struct buffer) / sizeof (EMACS_INT); + XSETPVECTYPE (b, PVEC_BUFFER); return b; } @@ -3352,7 +3354,7 @@ allocate_misc () --total_free_markers; consing_since_gc += sizeof (union Lisp_Misc); misc_objects_consed++; - XMARKER (val)->gcmarkbit = 0; + XMISCANY (val)->gcmarkbit = 0; return val; } @@ -4209,7 +4211,7 @@ mark_maybe_object (obj) break; case Lisp_Misc: - mark_p = (live_misc_p (m, po) && !XMARKER (obj)->gcmarkbit); + mark_p = (live_misc_p (m, po) && !XMISCANY (obj)->gcmarkbit); break; case Lisp_Int: @@ -5654,14 +5656,13 @@ mark_object (arg) case Lisp_Misc: CHECK_ALLOCATED_AND_LIVE (live_misc_p); - if (XMARKER (obj)->gcmarkbit) + if (XMISCANY (obj)->gcmarkbit) break; - XMARKER (obj)->gcmarkbit = 1; + XMISCANY (obj)->gcmarkbit = 1; switch (XMISCTYPE (obj)) { case Lisp_Misc_Buffer_Local_Value: - case Lisp_Misc_Some_Buffer_Local_Value: { register struct Lisp_Buffer_Local_Value *ptr = XBUFFER_LOCAL_VALUE (obj); @@ -5847,7 +5848,7 @@ survives_gc_p (obj) break; case Lisp_Misc: - survives_p = XMARKER (obj)->gcmarkbit; + survives_p = XMISCANY (obj)->gcmarkbit; break; case Lisp_String: @@ -6297,7 +6298,7 @@ die (msg, file, line) const char *file; int line; { - fprintf (stderr, "\r\nEmacs fatal error: %s:%d: %s\r\n", + fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n", file, line, msg); abort (); } diff --git a/src/buffer.c b/src/buffer.c index 740f9fe53d6..c53d427499a 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -361,8 +361,6 @@ The value is never nil. */) b = (struct buffer *) allocate_buffer (); - b->size = sizeof (struct buffer) / sizeof (EMACS_INT); - /* An ordinary buffer uses its own struct buffer_text. */ b->text = &b->own_text; b->base_buffer = 0; @@ -416,10 +414,7 @@ The value is never nil. */) STRING_SET_INTERVALS (name, NULL_INTERVAL); b->name = name; - if (SREF (name, 0) != ' ') - b->undo_list = Qnil; - else - b->undo_list = Qt; + b->undo_list = (SREF (name, 0) != ' ') ? Qnil : Qt; reset_buffer (b); reset_buffer_local_variables (b, 1); @@ -429,7 +424,6 @@ The value is never nil. */) b->name = name; /* Put this in the alist of all live buffers. */ - XSETPVECTYPE (b, PVEC_BUFFER); XSETBUFFER (buf, b); Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil)); @@ -567,13 +561,10 @@ CLONE nil means the indirect buffer's state is reset to default values. */) error ("Empty string for buffer name is not allowed"); b = (struct buffer *) allocate_buffer (); - b->size = sizeof (struct buffer) / sizeof (EMACS_INT); - XSETPVECTYPE (b, PVEC_BUFFER); - if (XBUFFER (base_buffer)->base_buffer) - b->base_buffer = XBUFFER (base_buffer)->base_buffer; - else - b->base_buffer = XBUFFER (base_buffer); + b->base_buffer = (XBUFFER (base_buffer)->base_buffer + ? XBUFFER (base_buffer)->base_buffer + : XBUFFER (base_buffer)); /* Use the base buffer's text object. */ b->text = b->base_buffer->text; @@ -1918,8 +1909,7 @@ set_buffer_internal_1 (b) for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail)) { valcontents = SYMBOL_VALUE (XCAR (XCAR (tail))); - if ((BUFFER_LOCAL_VALUEP (valcontents) - || SOME_BUFFER_LOCAL_VALUEP (valcontents)) + if ((BUFFER_LOCAL_VALUEP (valcontents)) && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) /* Just reference the variable @@ -1933,8 +1923,7 @@ set_buffer_internal_1 (b) for (tail = old_buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) { valcontents = SYMBOL_VALUE (XCAR (XCAR (tail))); - if ((BUFFER_LOCAL_VALUEP (valcontents) - || SOME_BUFFER_LOCAL_VALUEP (valcontents)) + if ((BUFFER_LOCAL_VALUEP (valcontents)) && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) /* Just reference the variable @@ -2493,7 +2482,7 @@ the normal hook `change-major-mode-hook'. */) /* Any which are supposed to be permanent, make local again, with the same values they had. */ - for (alist = oalist; !NILP (alist); alist = XCDR (alist)) + for (alist = oalist; CONSP (alist); alist = XCDR (alist)) { sym = XCAR (XCAR (alist)); tem = Fget (sym, Qpermanent_local); @@ -2523,7 +2512,7 @@ swap_out_buffer_local_variables (b) XSETBUFFER (buffer, b); oalist = b->local_var_alist; - for (alist = oalist; !NILP (alist); alist = XCDR (alist)) + for (alist = oalist; CONSP (alist); alist = XCDR (alist)) { sym = XCAR (XCAR (alist)); diff --git a/src/data.c b/src/data.c index c8c40aa6df0..2a99a728a76 100644 --- a/src/data.c +++ b/src/data.c @@ -584,8 +584,7 @@ DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0, valcontents = SYMBOL_VALUE (symbol); - if (BUFFER_LOCAL_VALUEP (valcontents) - || SOME_BUFFER_LOCAL_VALUEP (valcontents)) + if (BUFFER_LOCAL_VALUEP (valcontents)) valcontents = swap_in_symval_forwarding (symbol, valcontents); return (EQ (valcontents, Qunbound) ? Qnil : Qt); @@ -998,8 +997,7 @@ store_symval_forwarding (symbol, valcontents, newval, buf) default: def: valcontents = SYMBOL_VALUE (symbol); - if (BUFFER_LOCAL_VALUEP (valcontents) - || SOME_BUFFER_LOCAL_VALUEP (valcontents)) + if (BUFFER_LOCAL_VALUEP (valcontents)) XBUFFER_LOCAL_VALUE (valcontents)->realvalue = newval; else SET_SYMBOL_VALUE (symbol, newval); @@ -1016,8 +1014,7 @@ swap_in_global_binding (symbol) Lisp_Object valcontents, cdr; valcontents = SYMBOL_VALUE (symbol); - if (!BUFFER_LOCAL_VALUEP (valcontents) - && !SOME_BUFFER_LOCAL_VALUEP (valcontents)) + if (!BUFFER_LOCAL_VALUEP (valcontents)) abort (); cdr = XBUFFER_LOCAL_VALUE (valcontents)->cdr; @@ -1106,8 +1103,7 @@ find_symbol_value (symbol) CHECK_SYMBOL (symbol); valcontents = SYMBOL_VALUE (symbol); - if (BUFFER_LOCAL_VALUEP (valcontents) - || SOME_BUFFER_LOCAL_VALUEP (valcontents)) + if (BUFFER_LOCAL_VALUEP (valcontents)) valcontents = swap_in_symval_forwarding (symbol, valcontents); if (MISCP (valcontents)) @@ -1225,8 +1221,7 @@ set_internal (symbol, newval, buf, bindflag) && !let_shadows_buffer_binding_p (symbol)) SET_PER_BUFFER_VALUE_P (buf, idx, 1); } - else if (BUFFER_LOCAL_VALUEP (valcontents) - || SOME_BUFFER_LOCAL_VALUEP (valcontents)) + else if (BUFFER_LOCAL_VALUEP (valcontents)) { /* valcontents is a struct Lisp_Buffer_Local_Value. */ if (XSYMBOL (symbol)->indirect_variable) @@ -1271,7 +1266,7 @@ set_internal (symbol, newval, buf, bindflag) indicating that we're seeing the default value. Likewise if the variable has been let-bound in the current buffer. */ - if (bindflag || SOME_BUFFER_LOCAL_VALUEP (valcontents) + if (bindflag || !XBUFFER_LOCAL_VALUE (valcontents)->local_if_set || let_shadows_buffer_binding_p (symbol)) { XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 0; @@ -1299,8 +1294,7 @@ set_internal (symbol, newval, buf, bindflag) } /* Record which binding is now loaded. */ - XSETCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr, - tem1); + XSETCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr, tem1); /* Set `buffer' and `frame' slots for the binding now loaded. */ XSETBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer, buf); @@ -1319,8 +1313,7 @@ set_internal (symbol, newval, buf, bindflag) /* If we just set a variable whose current binding is frame-local, store the new value in the frame parameter too. */ - if (BUFFER_LOCAL_VALUEP (valcontents) - || SOME_BUFFER_LOCAL_VALUEP (valcontents)) + if (BUFFER_LOCAL_VALUEP (valcontents)) { /* What binding is loaded right now? */ current_alist_element @@ -1362,8 +1355,7 @@ default_value (symbol) } /* Handle user-created local variables. */ - if (BUFFER_LOCAL_VALUEP (valcontents) - || SOME_BUFFER_LOCAL_VALUEP (valcontents)) + if (BUFFER_LOCAL_VALUEP (valcontents)) { /* If var is set up for a buffer that lacks a local value for it, the current value is nominally the default value. @@ -1447,8 +1439,7 @@ for this variable. */) return value; } - if (!BUFFER_LOCAL_VALUEP (valcontents) - && !SOME_BUFFER_LOCAL_VALUEP (valcontents)) + if (!BUFFER_LOCAL_VALUEP (valcontents)) return Fset (symbol, value); /* Store new value into the DEFAULT-VALUE slot. */ @@ -1533,27 +1524,28 @@ The function `default-value' gets the default value and `set-default' sets it. if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); - if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) + if (BUFFER_OBJFWDP (valcontents)) return variable; - if (SOME_BUFFER_LOCAL_VALUEP (valcontents)) + else if (BUFFER_LOCAL_VALUEP (valcontents)) + newval = valcontents; + else { - XMISCTYPE (SYMBOL_VALUE (variable)) = Lisp_Misc_Buffer_Local_Value; - return variable; + if (EQ (valcontents, Qunbound)) + SET_SYMBOL_VALUE (variable, Qnil); + tem = Fcons (Qnil, Fsymbol_value (variable)); + XSETCAR (tem, tem); + newval = allocate_misc (); + XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value; + XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable); + XBUFFER_LOCAL_VALUE (newval)->buffer = Fcurrent_buffer (); + XBUFFER_LOCAL_VALUE (newval)->frame = Qnil; + XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0; + XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0; + XBUFFER_LOCAL_VALUE (newval)->check_frame = 0; + XBUFFER_LOCAL_VALUE (newval)->cdr = tem; + SET_SYMBOL_VALUE (variable, newval); } - if (EQ (valcontents, Qunbound)) - SET_SYMBOL_VALUE (variable, Qnil); - tem = Fcons (Qnil, Fsymbol_value (variable)); - XSETCAR (tem, tem); - newval = allocate_misc (); - XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value; - XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable); - XBUFFER_LOCAL_VALUE (newval)->buffer = Fcurrent_buffer (); - XBUFFER_LOCAL_VALUE (newval)->frame = Qnil; - XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0; - XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0; - XBUFFER_LOCAL_VALUE (newval)->check_frame = 0; - XBUFFER_LOCAL_VALUE (newval)->cdr = tem; - SET_SYMBOL_VALUE (variable, newval); + XBUFFER_LOCAL_VALUE (newval)->local_if_set = 1; return variable; } @@ -1589,7 +1581,9 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); - if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) + if ((BUFFER_LOCAL_VALUEP (valcontents) + && XBUFFER_LOCAL_VALUE (valcontents)->local_if_set) + || BUFFER_OBJFWDP (valcontents)) { tem = Fboundp (variable); @@ -1599,16 +1593,17 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) return variable; } /* Make sure symbol is set up to hold per-buffer values. */ - if (!SOME_BUFFER_LOCAL_VALUEP (valcontents)) + if (!BUFFER_LOCAL_VALUEP (valcontents)) { Lisp_Object newval; tem = Fcons (Qnil, do_symval_forwarding (valcontents)); XSETCAR (tem, tem); newval = allocate_misc (); - XMISCTYPE (newval) = Lisp_Misc_Some_Buffer_Local_Value; + XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value; XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable); XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil; XBUFFER_LOCAL_VALUE (newval)->frame = Qnil; + XBUFFER_LOCAL_VALUE (newval)->local_if_set = 0; XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0; XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0; XBUFFER_LOCAL_VALUE (newval)->check_frame = 0; @@ -1681,8 +1676,7 @@ From now on the default value will apply in this buffer. Return VARIABLE. */) return variable; } - if (!BUFFER_LOCAL_VALUEP (valcontents) - && !SOME_BUFFER_LOCAL_VALUEP (valcontents)) + if (!BUFFER_LOCAL_VALUEP (valcontents)) return variable; /* Get rid of this buffer's alist element, if any. */ @@ -1743,8 +1737,7 @@ Buffer-local bindings take precedence over frame-local bindings. */) || BUFFER_OBJFWDP (valcontents)) error ("Symbol %s may not be frame-local", SDATA (SYMBOL_NAME (variable))); - if (BUFFER_LOCAL_VALUEP (valcontents) - || SOME_BUFFER_LOCAL_VALUEP (valcontents)) + if (BUFFER_LOCAL_VALUEP (valcontents)) { XBUFFER_LOCAL_VALUE (valcontents)->check_frame = 1; return variable; @@ -1755,10 +1748,11 @@ Buffer-local bindings take precedence over frame-local bindings. */) tem = Fcons (Qnil, Fsymbol_value (variable)); XSETCAR (tem, tem); newval = allocate_misc (); - XMISCTYPE (newval) = Lisp_Misc_Some_Buffer_Local_Value; + XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value; XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable); XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil; XBUFFER_LOCAL_VALUE (newval)->frame = Qnil; + XBUFFER_LOCAL_VALUE (newval)->local_if_set = 0; XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0; XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0; XBUFFER_LOCAL_VALUE (newval)->check_frame = 1; @@ -1789,8 +1783,7 @@ BUFFER defaults to the current buffer. */) variable = indirect_variable (variable); valcontents = SYMBOL_VALUE (variable); - if (BUFFER_LOCAL_VALUEP (valcontents) - || SOME_BUFFER_LOCAL_VALUEP (valcontents)) + if (BUFFER_LOCAL_VALUEP (valcontents)) { Lisp_Object tail, elt; @@ -1838,15 +1831,14 @@ BUFFER defaults to the current buffer. */) valcontents = SYMBOL_VALUE (variable); - /* This means that make-variable-buffer-local was done. */ - if (BUFFER_LOCAL_VALUEP (valcontents)) - return Qt; - /* All these slots become local if they are set. */ if (BUFFER_OBJFWDP (valcontents)) + /* All these slots become local if they are set. */ return Qt; - if (SOME_BUFFER_LOCAL_VALUEP (valcontents)) + else if (BUFFER_LOCAL_VALUEP (valcontents)) { Lisp_Object tail, elt; + if (XBUFFER_LOCAL_VALUE (valcontents)->local_if_set) + return Qt; for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) { elt = XCAR (tail); @@ -1877,14 +1869,13 @@ If the current binding is global (the default), the value is nil. */) valcontents = XSYMBOL (variable)->value; if (BUFFER_LOCAL_VALUEP (valcontents) - || SOME_BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) { /* For a local variable, record both the symbol and which buffer's or frame's value we are saving. */ if (!NILP (Flocal_variable_p (variable, Qnil))) return Fcurrent_buffer (); - else if (!BUFFER_OBJFWDP (valcontents) + else if (BUFFER_LOCAL_VALUEP (valcontents) && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame) return XBUFFER_LOCAL_VALUE (valcontents)->frame; } diff --git a/src/eval.c b/src/eval.c index b69eea44c75..d71d646a25b 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1043,10 +1043,10 @@ usage: (let VARLIST BODY...) */) GCPRO2 (args, *temps); gcpro2.nvars = 0; - for (argnum = 0; !NILP (varlist); varlist = Fcdr (varlist)) + for (argnum = 0; CONSP (varlist); varlist = XCDR (varlist)) { QUIT; - elt = Fcar (varlist); + elt = XCAR (varlist); if (SYMBOLP (elt)) temps [argnum++] = Qnil; else if (! NILP (Fcdr (Fcdr (elt)))) @@ -1058,9 +1058,9 @@ usage: (let VARLIST BODY...) */) UNGCPRO; varlist = Fcar (args); - for (argnum = 0; !NILP (varlist); varlist = Fcdr (varlist)) + for (argnum = 0; CONSP (varlist); varlist = XCDR (varlist)) { - elt = Fcar (varlist); + elt = XCAR (varlist); tem = temps[argnum++]; if (SYMBOLP (elt)) specbind (elt, tem); @@ -3285,7 +3285,6 @@ specbind (symbol, value) valcontents = XSYMBOL (symbol)->value; if (BUFFER_LOCAL_VALUEP (valcontents) - || SOME_BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) { Lisp_Object where, current_buffer; @@ -3296,7 +3295,7 @@ specbind (symbol, value) buffer's or frame's value we are saving. */ if (!NILP (Flocal_variable_p (symbol, Qnil))) where = current_buffer; - else if (!BUFFER_OBJFWDP (valcontents) + else if (BUFFER_LOCAL_VALUEP (valcontents) && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame) where = XBUFFER_LOCAL_VALUE (valcontents)->frame; else diff --git a/src/frame.c b/src/frame.c index ff860d83509..090de96cebd 100644 --- a/src/frame.c +++ b/src/frame.c @@ -2289,8 +2289,7 @@ store_frame_param (f, prop, val) { Lisp_Object valcontents; valcontents = SYMBOL_VALUE (prop); - if ((BUFFER_LOCAL_VALUEP (valcontents) - || SOME_BUFFER_LOCAL_VALUEP (valcontents)) + if ((BUFFER_LOCAL_VALUEP (valcontents)) && XBUFFER_LOCAL_VALUE (valcontents)->check_frame && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame && XFRAME (XBUFFER_LOCAL_VALUE (valcontents)->frame) == f) diff --git a/src/lisp.h b/src/lisp.h index 70329a07764..74957e9fe18 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -214,7 +214,6 @@ enum Lisp_Misc_Type Lisp_Misc_Objfwd, Lisp_Misc_Buffer_Objfwd, Lisp_Misc_Buffer_Local_Value, - Lisp_Misc_Some_Buffer_Local_Value, Lisp_Misc_Overlay, Lisp_Misc_Kboard_Objfwd, Lisp_Misc_Save_Value, @@ -522,7 +521,8 @@ extern size_t pure_size; /* Misc types. */ #define XMISC(a) ((union Lisp_Misc *) XPNTR(a)) -#define XMISCTYPE(a) (XMARKER (a)->type) +#define XMISCANY(a) (&(XMISC(a)->u_any)) +#define XMISCTYPE(a) (XMISCANY (a)->type) #define XMARKER(a) (&(XMISC(a)->u_marker)) #define XINTFWD(a) (&(XMISC(a)->u_intfwd)) #define XBOOLFWD(a) (&(XMISC(a)->u_boolfwd)) @@ -1124,6 +1124,13 @@ struct Lisp_Hash_Table /* These structures are used for various misc types. */ +struct Lisp_Misc_Any /* Supertype of all Misc types. */ +{ + int type : 16; /* = Lisp_Misc_Marker */ + unsigned gcmarkbit : 1; + int spacer : 15; +}; + struct Lisp_Marker { int type : 16; /* = Lisp_Misc_Marker */ @@ -1224,19 +1231,19 @@ struct Lisp_Buffer_Objfwd binding into `realvalue' (or through it). Also update LOADED-BINDING to point to the newly loaded binding. - Lisp_Misc_Buffer_Local_Value and Lisp_Misc_Some_Buffer_Local_Value - both use this kind of structure. With the former, merely setting - the variable creates a local binding for the current buffer. With - the latter, setting the variable does not do that; only - make-local-variable does that. */ + `local_if_set' indicates that merely setting the variable creates a local + binding for the current buffer. Otherwise the latter, setting the + variable does not do that; only make-local-variable does that. */ struct Lisp_Buffer_Local_Value { - int type : 16; /* = Lisp_Misc_Buffer_Local_Value - or Lisp_Misc_Some_Buffer_Local_Value */ + int type : 16; /* = Lisp_Misc_Buffer_Local_Value */ unsigned gcmarkbit : 1; - int spacer : 12; + int spacer : 11; + /* 1 means that merely setting the variable creates a local + binding for the current buffer */ + unsigned int local_if_set : 1; /* 1 means this variable is allowed to have frame-local bindings, so check for them when looking for the proper binding. */ unsigned int check_frame : 1; @@ -1326,7 +1333,8 @@ struct Lisp_Free union Lisp_Misc { - struct Lisp_Free u_free; + struct Lisp_Misc_Any u_any; /* Supertype of all Misc types. */ + struct Lisp_Free u_free; /* Includes padding to force alignment. */ struct Lisp_Marker u_marker; struct Lisp_Intfwd u_intfwd; struct Lisp_Boolfwd u_boolfwd; diff --git a/src/print.c b/src/print.c index ccb2d6e8c45..56880eb4bf1 100644 --- a/src/print.c +++ b/src/print.c @@ -2145,10 +2145,8 @@ print_object (obj, printcharfun, escapeflag) case Lisp_Misc_Buffer_Local_Value: strout ("#local_if_set) + strout ("[local-if-set] ", -1, -1, printcharfun, 0); strout ("[realvalue] ", -1, -1, printcharfun, 0); print_object (XBUFFER_LOCAL_VALUE (obj)->realvalue, printcharfun, escapeflag); diff --git a/src/xdisp.c b/src/xdisp.c index b907ea516d6..5bf4208ff64 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10804,8 +10804,7 @@ select_frame_for_redisplay (frame) SYMBOLP (sym)) && (sym = indirect_variable (sym), val = SYMBOL_VALUE (sym), - (BUFFER_LOCAL_VALUEP (val) - || SOME_BUFFER_LOCAL_VALUEP (val))) + (BUFFER_LOCAL_VALUEP (val))) && XBUFFER_LOCAL_VALUE (val)->check_frame) /* Use find_symbol_value rather than Fsymbol_value to avoid an error if it is void. */ @@ -10817,8 +10816,7 @@ select_frame_for_redisplay (frame) SYMBOLP (sym)) && (sym = indirect_variable (sym), val = SYMBOL_VALUE (sym), - (BUFFER_LOCAL_VALUEP (val) - || SOME_BUFFER_LOCAL_VALUEP (val))) + (BUFFER_LOCAL_VALUEP (val))) && XBUFFER_LOCAL_VALUE (val)->check_frame) find_symbol_value (sym); } From d3f41ff55563551d241407ef640c9984156f87b8 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 16 Oct 2007 15:49:43 +0000 Subject: [PATCH 022/127] (Fpurecopy): Set the pvec tag on pseudo vectors. --- src/ChangeLog | 2 ++ src/alloc.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3c275302f9f..6f96f7da7ac 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2007-10-16 Stefan Monnier + * alloc.c (Fpurecopy): Set the pvec tag on pseudo vectors. + * lisp.h (enum Lisp_Misc_Type): Del Lisp_Misc_Some_Buffer_Local_Value. (XMISCANY): New macro. (XMISCTYPE): Use it. diff --git a/src/alloc.c b/src/alloc.c index 48857ecff14..c42c27f0333 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -4966,7 +4966,10 @@ Does not copy symbols. Copies strings without text properties. */) for (i = 0; i < size; i++) vec->contents[i] = Fpurecopy (XVECTOR (obj)->contents[i]); if (COMPILEDP (obj)) - XSETCOMPILED (obj, vec); + { + XSETPVECTYPE (vec, PVEC_COMPILED); + XSETCOMPILED (obj, vec); + } else XSETVECTOR (obj, vec); return obj; From 9beb8baa1f1b59f8e76df62e95647c39acbac5e7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 16 Oct 2007 16:28:39 +0000 Subject: [PATCH 023/127] * xfns.c (Fx_create_frame, Fx_display_list): * window.c (window_fixed_size_p, enlarge_window, shrink_window_lowest_first): * macterm.c (init_font_name_table): * macfns.c (Fx_create_frame, Fx_display_list): * lread.c (close_load_descs): * keyboard.c (read_char_x_menu_prompt): * fns.c (Fmember, Fmemql, Fdelete, Fset_char_table_parent): * coding.c (code_convert_region_unwind): Test the type of an object rather than just !NILP before extracting data from it. --- src/ChangeLog | 11 +++++++++++ src/coding.c | 2 +- src/fns.c | 9 +++++---- src/keyboard.c | 2 +- src/lread.c | 2 +- src/macfns.c | 4 ++-- src/macterm.c | 4 ++-- src/window.c | 14 +++++++------- src/xfns.c | 4 ++-- 9 files changed, 32 insertions(+), 20 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 6f96f7da7ac..cd6dd995bcf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,16 @@ 2007-10-16 Stefan Monnier + * xfns.c (Fx_create_frame, Fx_display_list): + * window.c (window_fixed_size_p, enlarge_window) + (shrink_window_lowest_first): + * macterm.c (init_font_name_table): + * macfns.c (Fx_create_frame, Fx_display_list): + * lread.c (close_load_descs): + * keyboard.c (read_char_x_menu_prompt): + * fns.c (Fmember, Fmemql, Fdelete, Fset_char_table_parent): + * coding.c (code_convert_region_unwind): Test the type of an object + rather than just !NILP before extracting data from it. + * alloc.c (Fpurecopy): Set the pvec tag on pseudo vectors. * lisp.h (enum Lisp_Misc_Type): Del Lisp_Misc_Some_Buffer_Local_Value. diff --git a/src/coding.c b/src/coding.c index b6299097d55..b0721cc22be 100644 --- a/src/coding.c +++ b/src/coding.c @@ -5371,7 +5371,7 @@ code_convert_region_unwind (arg) inhibit_pre_post_conversion = 0; Vlast_coding_system_used = XCAR (arg); - for (arg = XCDR (arg); ! NILP (arg); arg = XCDR (arg)) + for (arg = XCDR (arg); CONSP (arg); arg = XCDR (arg)) Fkill_buffer (XCAR (arg)); UNGCPRO; diff --git a/src/fns.c b/src/fns.c index f881ed53f88..7ec0056332a 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1451,7 +1451,7 @@ The value is actually the tail of LIST whose car is ELT. */) Lisp_Object list; { register Lisp_Object tail; - for (tail = list; !NILP (tail); tail = XCDR (tail)) + for (tail = list; CONSP (tail); tail = XCDR (tail)) { register Lisp_Object tem; CHECK_LIST_CONS (tail, list); @@ -1502,7 +1502,7 @@ The value is actually the tail of LIST whose car is ELT. */) if (!FLOATP (elt)) return Fmemq (elt, list); - for (tail = list; !NILP (tail); tail = XCDR (tail)) + for (tail = list; CONSP (tail); tail = XCDR (tail)) { register Lisp_Object tem; CHECK_LIST_CONS (tail, list); @@ -1806,7 +1806,7 @@ to be sure of changing the value of `foo'. */) { Lisp_Object tail, prev; - for (tail = seq, prev = Qnil; !NILP (tail); tail = XCDR (tail)) + for (tail = seq, prev = Qnil; CONSP (tail); tail = XCDR (tail)) { CHECK_LIST_CONS (tail, seq); @@ -2440,7 +2440,8 @@ Return PARENT. PARENT must be either nil or another char-table. */) { CHECK_CHAR_TABLE (parent); - for (temp = parent; !NILP (temp); temp = XCHAR_TABLE (temp)->parent) + for (temp = parent; CHAR_TABLE_P (temp); + temp = XCHAR_TABLE (temp)->parent) if (EQ (temp, char_table)) error ("Attempt to make a chartable be its own parent"); } diff --git a/src/keyboard.c b/src/keyboard.c index bd8263f9b04..fccf5c88eaa 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -8538,7 +8538,7 @@ read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu) to indicate that they came from a mouse menu, so that when present in last_nonmenu_event they won't confuse things. */ - for (tem = XCDR (value); !NILP (tem); tem = XCDR (tem)) + for (tem = XCDR (value); CONSP (tem); tem = XCDR (tem)) { record_menu_key (XCAR (tem)); if (SYMBOLP (XCAR (tem)) diff --git a/src/lread.c b/src/lread.c index 5418d82a968..77eb800b41a 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1100,7 +1100,7 @@ close_load_descs () { #ifndef WINDOWSNT Lisp_Object tail; - for (tail = load_descriptor_list; !NILP (tail); tail = XCDR (tail)) + for (tail = load_descriptor_list; CONSP (tail); tail = XCDR (tail)) emacs_close (XFASTINT (XCAR (tail))); #endif } diff --git a/src/macfns.c b/src/macfns.c index 6a12c071cee..d0b859054a6 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -2826,7 +2826,7 @@ This function is an internal primitive--use `make-frame' instead. */) /* All remaining specified parameters, which have not been "used" by x_get_arg and friends, now go in the misc. alist of the frame. */ - for (tem = parameters; !NILP (tem); tem = XCDR (tem)) + for (tem = parameters; CONSP (tem); tem = XCDR (tem)) if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) f->param_alist = Fcons (XCAR (tem), f->param_alist); @@ -3402,7 +3402,7 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0, Lisp_Object tail, result; result = Qnil; - for (tail = x_display_name_list; ! NILP (tail); tail = XCDR (tail)) + for (tail = x_display_name_list; CONSP (tail); tail = XCDR (tail)) result = Fcons (XCAR (XCAR (tail)), result); return result; diff --git a/src/macterm.c b/src/macterm.c index e4b9cca819c..ef1fa7c7453 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -8281,7 +8281,7 @@ init_font_name_table () Lisp_Object rest = XCDR (XCDR (text_encoding_info)); if (size > 0 || style == normal) - for (; !NILP (rest); rest = XCDR (rest)) + for (; CONSP (rest); rest = XCDR (rest)) add_mac_font_name (name, size, style, SDATA (XCAR (rest))); } } @@ -8356,7 +8356,7 @@ init_font_name_table () { Lisp_Object rest = XCDR (XCDR (text_encoding_info)); - for (; !NILP (rest); rest = XCDR (rest)) + for (; CONSP (rest); rest = XCDR (rest)) add_mac_font_name (name, assc_entry->fontSize, assc_entry->fontStyle, SDATA (XCAR (rest))); diff --git a/src/window.c b/src/window.c index efdf309121b..1819b2dc024 100644 --- a/src/window.c +++ b/src/window.c @@ -2670,12 +2670,12 @@ window_fixed_size_p (w, width_p, check_siblings_p) { Lisp_Object child; - for (child = w->prev; !NILP (child); child = XWINDOW (child)->prev) + for (child = w->prev; WINDOWP (child); child = XWINDOW (child)->prev) if (!window_fixed_size_p (XWINDOW (child), width_p, 0)) break; if (NILP (child)) - for (child = w->next; !NILP (child); child = XWINDOW (child)->next) + for (child = w->next; WINDOWP (child); child = XWINDOW (child)->next) if (!window_fixed_size_p (XWINDOW (child), width_p, 0)) break; @@ -4291,10 +4291,10 @@ enlarge_window (window, delta, horiz_flag) /* Find the total we can get from other siblings without deleting them. */ maximum = 0; - for (next = p->next; ! NILP (next); next = XWINDOW (next)->next) + for (next = p->next; WINDOWP (next); next = XWINDOW (next)->next) maximum += (*sizefun) (next) - window_min_size (XWINDOW (next), horiz_flag, 0, 0); - for (prev = p->prev; ! NILP (prev); prev = XWINDOW (prev)->prev) + for (prev = p->prev; WINDOWP (prev); prev = XWINDOW (prev)->prev) maximum += (*sizefun) (prev) - window_min_size (XWINDOW (prev), horiz_flag, 0, 0); @@ -4442,10 +4442,10 @@ enlarge_window (window, delta, horiz_flag) Lisp_Object s; int n = 1; - for (s = w->next; !NILP (s); s = XWINDOW (s)->next) + for (s = w->next; WINDOWP (s); s = XWINDOW (s)->next) if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0)) ++n; - for (s = w->prev; !NILP (s); s = XWINDOW (s)->prev) + for (s = w->prev; WINDOWP (s); s = XWINDOW (s)->prev) if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0)) ++n; @@ -4701,7 +4701,7 @@ shrink_window_lowest_first (w, height) /* Find the last child. We are taking space from lowest windows first, so we iterate over children from the last child backwards. */ - for (child = w->vchild; !NILP (child); child = XWINDOW (child)->next) + for (child = w->vchild; WINDOWP (child); child = XWINDOW (child)->next) last_child = child; /* Assign new heights. We leave only MIN_SAFE_WINDOW_HEIGHT. */ diff --git a/src/xfns.c b/src/xfns.c index fe4d1c8335f..43ed2f75514 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3468,7 +3468,7 @@ This function is an internal primitive--use `make-frame' instead. */) /* All remaining specified parameters, which have not been "used" by x_get_arg and friends, now go in the misc. alist of the frame. */ - for (tem = parms; !NILP (tem); tem = XCDR (tem)) + for (tem = parms; CONSP (tem); tem = XCDR (tem)) if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) f->param_alist = Fcons (XCAR (tem), f->param_alist); @@ -4156,7 +4156,7 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0, Lisp_Object tail, result; result = Qnil; - for (tail = x_display_name_list; ! NILP (tail); tail = XCDR (tail)) + for (tail = x_display_name_list; CONSP (tail); tail = XCDR (tail)) result = Fcons (XCAR (XCAR (tail)), result); return result; From 930f57b46e639926c205e0b807ccb5bf4619b0b7 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 17 Oct 2007 01:29:32 +0000 Subject: [PATCH 024/127] (Qcompletion_ignore_case): New external Lisp_Object. (Fread_coding_system): Ignore case of user input. --- src/coding.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/coding.c b/src/coding.c index 907521edd5c..1dc4cf8eeb9 100644 --- a/src/coding.c +++ b/src/coding.c @@ -372,6 +372,8 @@ Lisp_Object Qcall_process, Qcall_process_region; Lisp_Object Qstart_process, Qopen_network_stream; Lisp_Object Qtarget_idx; +extern Lisp_Object Qcompletion_ignore_case; + /* If a symbol has this property, evaluate the value to define the symbol as a coding system. */ Lisp_Object Qcoding_system_define_form; @@ -6558,16 +6560,22 @@ DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system, DEFUN ("read-coding-system", Fread_coding_system, Sread_coding_system, 1, 2, 0, doc: /* Read a coding system from the minibuffer, prompting with string PROMPT. -If the user enters null input, return second argument DEFAULT-CODING-SYSTEM. */) +If the user enters null input, return second argument DEFAULT-CODING-SYSTEM. +Ignores case when completing coding systems (all Emacs coding systems +are lower-case). */) (prompt, default_coding_system) Lisp_Object prompt, default_coding_system; { Lisp_Object val; + int count = SPECPDL_INDEX (); + if (SYMBOLP (default_coding_system)) default_coding_system = SYMBOL_NAME (default_coding_system); + specbind (Qcompletion_ignore_case, Qt); val = Fcompleting_read (prompt, Vcoding_system_alist, Qnil, Qt, Qnil, Qcoding_system_history, default_coding_system, Qnil); + unbind_to (count, Qnil); return (SCHARS (val) == 0 ? Qnil : Fintern (val, Qnil)); } From c7183fb83f1841cc3ddf4877dd1f027755153479 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 17 Oct 2007 01:29:58 +0000 Subject: [PATCH 025/127] (Qcompletion_ignore_case): New external Lisp_Object. (Fread_coding_system): Ignore case of user input. --- src/coding.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/coding.c b/src/coding.c index b0721cc22be..da6049cafbd 100644 --- a/src/coding.c +++ b/src/coding.c @@ -374,6 +374,8 @@ Lisp_Object Qcall_process, Qcall_process_region; Lisp_Object Qstart_process, Qopen_network_stream; Lisp_Object Qtarget_idx; +extern Lisp_Object Qcompletion_ignore_case; + /* If a symbol has this property, evaluate the value to define the symbol as a coding system. */ Lisp_Object Qcoding_system_define_form; @@ -6554,16 +6556,22 @@ DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system, DEFUN ("read-coding-system", Fread_coding_system, Sread_coding_system, 1, 2, 0, doc: /* Read a coding system from the minibuffer, prompting with string PROMPT. -If the user enters null input, return second argument DEFAULT-CODING-SYSTEM. */) +If the user enters null input, return second argument DEFAULT-CODING-SYSTEM. +Ignores case when completing coding systems (all Emacs coding systems +are lower-case). */) (prompt, default_coding_system) Lisp_Object prompt, default_coding_system; { Lisp_Object val; + int count = SPECPDL_INDEX (); + if (SYMBOLP (default_coding_system)) default_coding_system = SYMBOL_NAME (default_coding_system); + specbind (Qcompletion_ignore_case, Qt); val = Fcompleting_read (prompt, Vcoding_system_alist, Qnil, Qt, Qnil, Qcoding_system_history, default_coding_system, Qnil); + unbind_to (count, Qnil); return (SCHARS (val) == 0 ? Qnil : Fintern (val, Qnil)); } From b46d7a8abb481bd07370466dc77624c6142fd7c0 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 17 Oct 2007 01:30:17 +0000 Subject: [PATCH 026/127] (Qcompletion_ignore_case): New Lisp_Object. (syms_of_minibuf): Add Qcompletion_ignore_case. --- src/minibuf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/minibuf.c b/src/minibuf.c index 0a1d737a793..bd07e2cdd36 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -117,6 +117,7 @@ Lisp_Object Vread_buffer_function; /* Nonzero means completion ignores case. */ int completion_ignore_case; +Lisp_Object Qcompletion_ignore_case; /* List of regexps that should restrict possible completions. */ @@ -2802,6 +2803,9 @@ syms_of_minibuf () minibuf_save_list = Qnil; staticpro (&minibuf_save_list); + Qcompletion_ignore_case = intern ("completion-ignore-case"); + staticpro (&Qcompletion_ignore_case); + Qread_file_name_internal = intern ("read-file-name-internal"); staticpro (&Qread_file_name_internal); From 9fa5c213cf7ad2429b4703c81ebdabee2aede406 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 17 Oct 2007 01:30:38 +0000 Subject: [PATCH 027/127] (Qcompletion_ignore_case): New Lisp_Object. (syms_of_minibuf): Add Qcompletion_ignore_case. --- src/minibuf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/minibuf.c b/src/minibuf.c index 489c714fcb4..e7c2aec7b3f 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -118,6 +118,7 @@ Lisp_Object Vread_buffer_function; /* Nonzero means completion ignores case. */ int completion_ignore_case; +Lisp_Object Qcompletion_ignore_case; /* List of regexps that should restrict possible completions. */ @@ -2831,6 +2832,9 @@ syms_of_minibuf () minibuf_save_list = Qnil; staticpro (&minibuf_save_list); + Qcompletion_ignore_case = intern ("completion-ignore-case"); + staticpro (&Qcompletion_ignore_case); + Qread_file_name_internal = intern ("read-file-name-internal"); staticpro (&Qread_file_name_internal); From 0af8c48ee0f56ee43bd788b26f96713724810771 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 17 Oct 2007 01:30:59 +0000 Subject: [PATCH 028/127] (Qcompletion_ignore_case): Change to external. (syms_of_dired) [VMS]: Remove Qcompletion_ignore_case. --- src/dired.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/dired.c b/src/dired.c index 1fb5387268a..09c72f69fdf 100644 --- a/src/dired.c +++ b/src/dired.c @@ -115,10 +115,10 @@ extern void filemodestring P_ ((struct stat *, char *)); #endif extern int completion_ignore_case; +extern Lisp_Object Qcompletion_ignore_case; extern Lisp_Object Vcompletion_regexp_list; Lisp_Object Vcompletion_ignored_extensions; -Lisp_Object Qcompletion_ignore_case; Lisp_Object Qdirectory_files; Lisp_Object Qdirectory_files_and_attributes; Lisp_Object Qfile_name_completion; @@ -1077,11 +1077,6 @@ syms_of_dired () defsubr (&Sfile_attributes); defsubr (&Sfile_attributes_lessp); -#ifdef VMS - Qcompletion_ignore_case = intern ("completion-ignore-case"); - staticpro (&Qcompletion_ignore_case); -#endif /* VMS */ - DEFVAR_LISP ("completion-ignored-extensions", &Vcompletion_ignored_extensions, doc: /* Completion ignores file names ending in any string in this list. It does not ignore them if all possible completions end in one of From ecd3f8b27acb54cca9c3f395ec91c3822f02b82b Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 17 Oct 2007 01:31:14 +0000 Subject: [PATCH 029/127] (Qcompletion_ignore_case): Change to external. (syms_of_dired) [VMS]: Remove Qcompletion_ignore_case. --- src/dired.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/dired.c b/src/dired.c index 1fb5387268a..09c72f69fdf 100644 --- a/src/dired.c +++ b/src/dired.c @@ -115,10 +115,10 @@ extern void filemodestring P_ ((struct stat *, char *)); #endif extern int completion_ignore_case; +extern Lisp_Object Qcompletion_ignore_case; extern Lisp_Object Vcompletion_regexp_list; Lisp_Object Vcompletion_ignored_extensions; -Lisp_Object Qcompletion_ignore_case; Lisp_Object Qdirectory_files; Lisp_Object Qdirectory_files_and_attributes; Lisp_Object Qfile_name_completion; @@ -1077,11 +1077,6 @@ syms_of_dired () defsubr (&Sfile_attributes); defsubr (&Sfile_attributes_lessp); -#ifdef VMS - Qcompletion_ignore_case = intern ("completion-ignore-case"); - staticpro (&Qcompletion_ignore_case); -#endif /* VMS */ - DEFVAR_LISP ("completion-ignored-extensions", &Vcompletion_ignored_extensions, doc: /* Completion ignores file names ending in any string in this list. It does not ignore them if all possible completions end in one of From 94b9aaa27dfacc84953fa4e52d664edebc6dbbba Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 17 Oct 2007 01:32:19 +0000 Subject: [PATCH 030/127] (Qcompletion_ignore_case): New external Lisp_Object. (Fread_file_name): Use it rather than intern'ing. --- src/ChangeLog | 12 ++++++++++++ src/fileio.c | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 6884af95810..48ef2f869ad 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2007-10-17 Glenn Morris + + * minibuf.c (Qcompletion_ignore_case): New Lisp_Object. + (syms_of_minibuf): Add Qcompletion_ignore_case. + * dired.c (Qcompletion_ignore_case): Change to external. + (syms_of_dired) [VMS]: Remove Qcompletion_ignore_case. + * fileio.c (Qcompletion_ignore_case): New external Lisp_Object. + (Fread_file_name): Use it rather than intern'ing. + + * coding.c (Qcompletion_ignore_case): New external Lisp_Object. + (Fread_coding_system): Ignore case of user input. + 2007-10-16 YAMAMOTO Mitsuharu * xdisp.c (handle_display_prop): Ignore display specs after diff --git a/src/fileio.c b/src/fileio.c index 29d12a0b0c3..b0b9240c5ab 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -6163,6 +6163,7 @@ then any auto-save counts as "recent". */) /* Reading and completing file names */ extern Lisp_Object Ffile_name_completion (), Ffile_name_all_completions (); +extern Lisp_Object Qcompletion_ignore_case; /* In the string VAL, change each $ to $$ and return the result. */ @@ -6468,7 +6469,7 @@ and `read-file-name-function'. */) } count = SPECPDL_INDEX (); - specbind (intern ("completion-ignore-case"), + specbind (Qcompletion_ignore_case, read_file_name_completion_ignore_case ? Qt : Qnil); specbind (intern ("minibuffer-completing-file-name"), Qt); specbind (intern ("read-file-name-predicate"), From 24eb74a313c5d6fade2cc96a33b2bf685dd95130 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 17 Oct 2007 01:32:41 +0000 Subject: [PATCH 031/127] (Qcompletion_ignore_case): New external Lisp_Object. (Fread_file_name): Use it rather than intern'ing. --- src/ChangeLog | 12 ++++++++++++ src/fileio.c | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5a4c51c84d8..08fbd81d6fb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2007-10-17 Glenn Morris + + * minibuf.c (Qcompletion_ignore_case): New Lisp_Object. + (syms_of_minibuf): Add Qcompletion_ignore_case. + * dired.c (Qcompletion_ignore_case): Change to external. + (syms_of_dired) [VMS]: Remove Qcompletion_ignore_case. + * fileio.c (Qcompletion_ignore_case): New external Lisp_Object. + (Fread_file_name): Use it rather than intern'ing. + + * coding.c (Qcompletion_ignore_case): New external Lisp_Object. + (Fread_coding_system): Ignore case of user input. + 2007-10-16 YAMAMOTO Mitsuharu * xdisp.c (handle_display_prop): Ignore display specs after diff --git a/src/fileio.c b/src/fileio.c index ac5a4f56794..0f13c6535a0 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -6078,6 +6078,7 @@ then any auto-save counts as "recent". */) /* Reading and completing file names */ extern Lisp_Object Ffile_name_completion (), Ffile_name_all_completions (); +extern Lisp_Object Qcompletion_ignore_case; /* In the string VAL, change each $ to $$ and return the result. */ @@ -6383,7 +6384,7 @@ and `read-file-name-function'. */) } count = SPECPDL_INDEX (); - specbind (intern ("completion-ignore-case"), + specbind (Qcompletion_ignore_case, read_file_name_completion_ignore_case ? Qt : Qnil); specbind (intern ("minibuffer-completing-file-name"), Qt); specbind (intern ("read-file-name-predicate"), From 73d3c088b7fadcffe10513fad950eb15694b6838 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 17 Oct 2007 01:36:10 +0000 Subject: [PATCH 032/127] Add url. --- admin/FOR-RELEASE | 1 + lisp/ChangeLog | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 1f8d0fec762..dcc1ff08a82 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -58,6 +58,7 @@ http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-09/msg00055.html http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00385.html ** lekktu@gmail.com, Oct 11: frame-local variables weirdness +http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00519.html I proposed a patch, which fixed this and seemed right, but the patch caused other problems. They are being investigated now. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 60bd1af0adc..a61ea8afb5f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-17 Glenn Morris + + * progmodes/cc-menus.el (cc-imenu-c++-generic-expression): Tweak + regexp to avoid stack overflow. + 2007-10-16 Juanma Barranquero * bs.el (bs--window-config-coming-from): Revert 2006-11-09 change. From 41a962dd92097089fa8d3e31d39a7b8c4af472af Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 17 Oct 2007 01:36:24 +0000 Subject: [PATCH 033/127] (cc-imenu-c++-generic-expression): Tweak regexp to avoid overflow. --- lisp/progmodes/cc-menus.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/cc-menus.el b/lisp/progmodes/cc-menus.el index 95359689b9f..eced014d4e6 100644 --- a/lisp/progmodes/cc-menus.el +++ b/lisp/progmodes/cc-menus.el @@ -106,7 +106,9 @@ A sample value might look like: `\\(_P\\|_PROTO\\)'.") (nil ,(concat "^\\<" ; line MUST start with word char - "[^()]*" ; no parentheses before + ;; \n added to prevent overflow in regexp matcher. + ;; http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-02/msg00021.html + "[^()\n]*" ; no parentheses before "[^" c-alnum "_:<>~]" ; match any non-identifier char "\\([" c-alpha "_][" c-alnum "_:<>~]*\\)" ; match function name "\\([ \t\n]\\|\\\\\n\\)*(" ; see above, BUT the arg list From f3523b17a8cf4d4d5babc8a8e75cf7004fbb8d48 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 17 Oct 2007 01:37:23 +0000 Subject: [PATCH 034/127] (cc-imenu-c++-generic-expression): Tweak regexp to avoid overflow. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/cc-menus.el | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2e5bb8bd790..2ea970016ba 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-17 Glenn Morris + + * progmodes/cc-menus.el (cc-imenu-c++-generic-expression): Tweak + regexp to avoid stack overflow. + 2007-10-16 Stefan Monnier * simple.el (reindent-then-newline-and-indent): Don't assume that diff --git a/lisp/progmodes/cc-menus.el b/lisp/progmodes/cc-menus.el index 95359689b9f..eced014d4e6 100644 --- a/lisp/progmodes/cc-menus.el +++ b/lisp/progmodes/cc-menus.el @@ -106,7 +106,9 @@ A sample value might look like: `\\(_P\\|_PROTO\\)'.") (nil ,(concat "^\\<" ; line MUST start with word char - "[^()]*" ; no parentheses before + ;; \n added to prevent overflow in regexp matcher. + ;; http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-02/msg00021.html + "[^()\n]*" ; no parentheses before "[^" c-alnum "_:<>~]" ; match any non-identifier char "\\([" c-alpha "_][" c-alnum "_:<>~]*\\)" ; match function name "\\([ \t\n]\\|\\\\\n\\)*(" ; see above, BUT the arg list From c49847b9444a5003d2cc4cea31426e53feb2fadf Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 17 Oct 2007 01:39:18 +0000 Subject: [PATCH 035/127] Remove file, since it's just a duplicate of one in etc/ --- ChangeLog | 4 ++++ FTP | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) delete mode 100644 FTP diff --git a/ChangeLog b/ChangeLog index f771639cb3d..0e957a6aa45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-10-17 Glenn Morris + + * FTP: Remove file, since it's just a duplicate of one in etc/. + 2007-10-05 Eli Zaretskii * config.bat: Fix configuring `doc' due to changes in the diff --git a/FTP b/FTP deleted file mode 100644 index 0337d464c30..00000000000 --- a/FTP +++ /dev/null @@ -1,6 +0,0 @@ -For information about how to obtain GNU Emacs and other GNU software -by FTP, please see . - -Information about Emacs is also available at -. - From e167a87628a2b922d03e8e1d3d51fdf435265003 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 17 Oct 2007 02:07:01 +0000 Subject: [PATCH 036/127] * eshell/esh-cmd.el (eshell-complex-commands): Add "ls". --- lisp/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a61ea8afb5f..96a68401627 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2006-10-22 John Wiegley + + * eshell/esh-cmd.el (eshell-complex-commands): Add "ls". + 2007-10-17 Glenn Morris * progmodes/cc-menus.el (cc-imenu-c++-generic-expression): Tweak From de9f59f6e1e43af5705ab7c592312c53b0ddb32e Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 17 Oct 2007 02:07:12 +0000 Subject: [PATCH 037/127] (eshell-complex-commands): Add "ls". --- lisp/eshell/esh-cmd.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index d3194f3625a..f999bdcdf6d 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -204,7 +204,7 @@ which may be modified directly. Any return value is ignored." :type 'hook :group 'eshell-cmd) -(defcustom eshell-complex-commands nil +(defcustom eshell-complex-commands '("ls") "*A list of commands names or functions, that determine complexity. That is, if a command is defined by a function named eshell/NAME, and NAME is part of this list, it is invoked as a complex command. From 8a3a4fd35f28f1e14fe871fdc59f8c88993e91ff Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Wed, 17 Oct 2007 02:07:35 +0000 Subject: [PATCH 038/127] (server-process-filter): Only set display if X11 is supported. --- lisp/ChangeLog | 5 +++++ lisp/server.el | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2ea970016ba..6a9fabe4153 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-17 Dan Nicolaescu + + * server.el (server-process-filter): Only set display if X11 is + supported. + 2007-10-17 Glenn Morris * progmodes/cc-menus.el (cc-imenu-c++-generic-expression): Tweak diff --git a/lisp/server.el b/lisp/server.el index 22b947ea9f8..7d7b001b33f 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -831,8 +831,12 @@ The following commands are accepted by the client: ;; Open X frames on the given display instead of the default. ((and (equal "-display" arg) (string-match "\\([^ ]*\\) " request)) - (setq display (match-string 1 request) - request (substring request (match-end 0)))) + ;; Only set `display' if X is supported. + ;; Emacsclient cannot know if emacs supports X and + ;; it will send -display anyway. + (when (memq 'x frame-creation-function-alist) + (setq display (match-string 1 request))) + (setq request (substring request (match-end 0)))) ;; -window-system: Open a new X frame. ((equal "-window-system" arg) From 902fa837f1f8a9461c1d3efda832d5e96e2c1dee Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 17 Oct 2007 02:08:23 +0000 Subject: [PATCH 039/127] * eshell/esh-cmd.el (eshell-complex-commands): Add "ls". --- lisp/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6a9fabe4153..7cc3e1e8c4a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-10-17 John Wiegley + + * eshell/esh-cmd.el (eshell-complex-commands): Add "ls". + 2007-10-17 Dan Nicolaescu * server.el (server-process-filter): Only set display if X11 is From 820b9143335905206f96f7108f66438038e67fd7 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 17 Oct 2007 02:08:32 +0000 Subject: [PATCH 040/127] (eshell-complex-commands): Add "ls". --- lisp/eshell/esh-cmd.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index d3194f3625a..f999bdcdf6d 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -204,7 +204,7 @@ which may be modified directly. Any return value is ignored." :type 'hook :group 'eshell-cmd) -(defcustom eshell-complex-commands nil +(defcustom eshell-complex-commands '("ls") "*A list of commands names or functions, that determine complexity. That is, if a command is defined by a function named eshell/NAME, and NAME is part of this list, it is invoked as a complex command. From 5ac6bcb7b1ce46ffb1fda65f3fc195fcbcba1e5b Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 17 Oct 2007 02:08:48 +0000 Subject: [PATCH 041/127] Correct typo. --- lisp/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 96a68401627..cc26222dc81 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,4 +1,4 @@ -2006-10-22 John Wiegley +2007-10-17 John Wiegley * eshell/esh-cmd.el (eshell-complex-commands): Add "ls". From 2131e876197aa3168071a93b1dca45a5f1c9f7b7 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 17 Oct 2007 02:09:47 +0000 Subject: [PATCH 042/127] ** ams@gnu.org, 9 July: eshell and external commands Fixed. --- admin/FOR-RELEASE | 3 --- 1 file changed, 3 deletions(-) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index dcc1ff08a82..149c852d2f4 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -54,9 +54,6 @@ http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-09/msg00055.html * BUGS -** ams@gnu.org, 9 July: eshell and external commands -http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00385.html - ** lekktu@gmail.com, Oct 11: frame-local variables weirdness http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00519.html I proposed a patch, which fixed this and seemed right, but the patch From d314756ea8059b422eebf9f1f435fe19f589fc5c Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 17 Oct 2007 02:10:38 +0000 Subject: [PATCH 043/127] (free_misc): Use XMISCTYPE. (live_misc_p, gc_sweep): Use Lisp_Misc_Any. --- src/ChangeLog | 5 +++++ src/alloc.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 48ef2f869ad..81cdd0b9d00 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2007-10-17 Stefan Monnier + + * alloc.c (free_misc): Use XMISCTYPE. + (live_misc_p, gc_sweep): Use Lisp_Misc_Any. + 2007-10-17 Glenn Morris * minibuf.c (Qcompletion_ignore_case): New Lisp_Object. diff --git a/src/alloc.c b/src/alloc.c index c42c27f0333..a768180bfe3 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -3364,7 +3364,7 @@ void free_misc (misc) Lisp_Object misc; { - XMISC (misc)->u_marker.type = Lisp_Misc_Free; + XMISCTYPE (misc) = Lisp_Misc_Free; XMISC (misc)->u_free.chain = marker_free_list; marker_free_list = XMISC (misc); @@ -4080,7 +4080,7 @@ live_misc_p (m, p) && offset < (MARKER_BLOCK_SIZE * sizeof b->markers[0]) && (b != marker_block || offset / sizeof b->markers[0] < marker_block_index) - && ((union Lisp_Misc *) p)->u_marker.type != Lisp_Misc_Free); + && ((union Lisp_Misc *) p)->u_any.type != Lisp_Misc_Free); } else return 0; @@ -6148,9 +6148,9 @@ gc_sweep () for (i = 0; i < lim; i++) { - if (!mblk->markers[i].u_marker.gcmarkbit) + if (!mblk->markers[i].u_any.gcmarkbit) { - if (mblk->markers[i].u_marker.type == Lisp_Misc_Marker) + if (mblk->markers[i].u_any.type == Lisp_Misc_Marker) unchain_marker (&mblk->markers[i].u_marker); /* Set the type of the freed object to Lisp_Misc_Free. We could leave the type alone, since nobody checks it, @@ -6163,7 +6163,7 @@ gc_sweep () else { num_used++; - mblk->markers[i].u_marker.gcmarkbit = 0; + mblk->markers[i].u_any.gcmarkbit = 0; } } lim = MARKER_BLOCK_SIZE; From 19fa82b957d6e2f7698aafe7c2827a796357bd6d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 17 Oct 2007 02:13:01 +0000 Subject: [PATCH 044/127] (XMISCANY, XMARKER, XINTFWD, XBOOLFWD, XOBJFWD, XOVERLAY, XBUFFER_OBJFWD) (XBUFFER_LOCAL_VALUE, XKBOARD_OBJFWD, XSAVE_VALUE): Add type checks. (SOME_BUFFER_LOCAL_VALUEP, GC_SOME_BUFFER_LOCAL_VALUEP): Remove. --- src/ChangeLog | 5 +++++ src/lisp.h | 26 ++++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 81cdd0b9d00..a48dc5c6438 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2007-10-17 Stefan Monnier + * lisp.h (XMISCANY, XMARKER, XINTFWD, XBOOLFWD, XOBJFWD, XOVERLAY) + (XBUFFER_OBJFWD, XBUFFER_LOCAL_VALUE, XKBOARD_OBJFWD, XSAVE_VALUE): + Add type checks. + (SOME_BUFFER_LOCAL_VALUEP, GC_SOME_BUFFER_LOCAL_VALUEP): Remove. + * alloc.c (free_misc): Use XMISCTYPE. (live_misc_p, gc_sweep): Use Lisp_Misc_Any. diff --git a/src/lisp.h b/src/lisp.h index 74957e9fe18..47e40c63328 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -521,17 +521,20 @@ extern size_t pure_size; /* Misc types. */ #define XMISC(a) ((union Lisp_Misc *) XPNTR(a)) -#define XMISCANY(a) (&(XMISC(a)->u_any)) +#define XMISCANY(a) (eassert (MISCP (a)), &(XMISC(a)->u_any)) #define XMISCTYPE(a) (XMISCANY (a)->type) -#define XMARKER(a) (&(XMISC(a)->u_marker)) -#define XINTFWD(a) (&(XMISC(a)->u_intfwd)) -#define XBOOLFWD(a) (&(XMISC(a)->u_boolfwd)) -#define XOBJFWD(a) (&(XMISC(a)->u_objfwd)) -#define XBUFFER_OBJFWD(a) (&(XMISC(a)->u_buffer_objfwd)) -#define XBUFFER_LOCAL_VALUE(a) (&(XMISC(a)->u_buffer_local_value)) -#define XOVERLAY(a) (&(XMISC(a)->u_overlay)) -#define XKBOARD_OBJFWD(a) (&(XMISC(a)->u_kboard_objfwd)) -#define XSAVE_VALUE(a) (&(XMISC(a)->u_save_value)) +#define XMARKER(a) (eassert (MARKERP (a)), &(XMISC(a)->u_marker)) +#define XINTFWD(a) (eassert (INTFWDP (a)), &(XMISC(a)->u_intfwd)) +#define XBOOLFWD(a) (eassert (BOOLFWDP (a)), &(XMISC(a)->u_boolfwd)) +#define XOBJFWD(a) (eassert (OBJFWDP (a)), &(XMISC(a)->u_objfwd)) +#define XOVERLAY(a) (eassert (OVERLAYP (a)), &(XMISC(a)->u_overlay)) +#define XSAVE_VALUE(a) (eassert (SAVE_VALUEP (a)), &(XMISC(a)->u_save_value)) +#define XBUFFER_OBJFWD(a) \ + (eassert (BUFFER_OBJFWDP (a)), &(XMISC(a)->u_buffer_objfwd)) +#define XBUFFER_LOCAL_VALUE(a) \ + (eassert (BUFFER_LOCAL_VALUEP (a)), &(XMISC(a)->u_buffer_local_value)) +#define XKBOARD_OBJFWD(a) \ + (eassert (KBOARD_OBJFWDP (a)), &(XMISC(a)->u_kboard_objfwd)) /* Pseudovector types. */ @@ -1494,10 +1497,9 @@ typedef unsigned char UCHAR; #define GC_BUFFER_OBJFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Objfwd) #define BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value) #define GC_BUFFER_LOCAL_VALUEP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value) -#define SOME_BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Some_Buffer_Local_Value) -#define GC_SOME_BUFFER_LOCAL_VALUEP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Some_Buffer_Local_Value) #define KBOARD_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd) #define GC_KBOARD_OBJFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd) +#define SAVE_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value) /* True if object X is a pseudovector whose code is CODE. */ From a457f2b8c411e796f7d73871bd68110369808c3b Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 17 Oct 2007 02:47:28 +0000 Subject: [PATCH 045/127] * longlines.el (longlines-wrap-follows-window-size): Integer value specifies wrapping margin. (longlines-mode, longlines-window-change-function): Set window-specific wrapping margin based on the above. --- lisp/ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cc26222dc81..7d1bf357f06 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2007-10-17 Chong Yidong + + * longlines.el (longlines-wrap-follows-window-size): Integer value + specifies wrapping margin. + (longlines-mode, longlines-window-change-function): Set + window-specific wrapping margin based on the above. + 2007-10-17 John Wiegley * eshell/esh-cmd.el (eshell-complex-commands): Add "ls". From 71fdf0898e86112a57064b13852bd5d48677a9a2 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 17 Oct 2007 02:47:39 +0000 Subject: [PATCH 046/127] (longlines-wrap-follows-window-size): Integer value specifies wrapping margin. (longlines-mode, longlines-window-change-function): Set window-specific wrapping margin based on the above. --- lisp/longlines.el | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/lisp/longlines.el b/lisp/longlines.el index 07977910a22..c820150c27a 100644 --- a/lisp/longlines.el +++ b/lisp/longlines.el @@ -55,7 +55,11 @@ when the file is saved to disk." "Non-nil means wrapping and filling happen at the edge of the window. Otherwise, `fill-column' is used, regardless of the window size. This does not work well when the buffer is displayed in multiple windows -with differing widths." +with differing widths. + +If the value is an integer, that specifies the distance from the +right edge of the window at which wrapping occurs. For any other +non-nil value, wrapping occurs 2 characters from the right edge." :group 'longlines :type 'boolean) @@ -117,8 +121,14 @@ are indicated with a symbol." 'longlines-search-function) (add-to-list 'buffer-substring-filters 'longlines-encode-string) (when longlines-wrap-follows-window-size - (set (make-local-variable 'fill-column) - (- (window-width) window-min-width)) + (let ((dw (if (and (integerp longlines-wrap-follows-window-size) + (>= longlines-wrap-follows-window-size 0) + (< longlines-wrap-follows-window-size + (window-width))) + longlines-wrap-follows-window-size + 2))) + (set (make-local-variable 'fill-column) + (- (window-width) dw))) (add-hook 'window-configuration-change-hook 'longlines-window-change-function nil t)) (let ((buffer-undo-list t) @@ -415,9 +425,14 @@ This is called by `post-command-hook' after each command." (defun longlines-window-change-function () "Re-wrap the buffer if the window width has changed. This is called by `window-configuration-change-hook'." - (when (/= fill-column (- (window-width) window-min-width)) - (setq fill-column (- (window-width) window-min-width)) - (longlines-wrap-region (point-min) (point-max)))) + (let ((dw (if (and (integerp longlines-wrap-follows-window-size) + (>= longlines-wrap-follows-window-size 0) + (< longlines-wrap-follows-window-size (window-width))) + longlines-wrap-follows-window-size + 2))) + (when (/= fill-column (- (window-width) dw)) + (setq fill-column (- (window-width) dw)) + (longlines-wrap-region (point-min) (point-max))))) ;; Isearch From cdbd4b4b1c62df28ee9003c49176919a5ef0cb24 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 17 Oct 2007 02:50:12 +0000 Subject: [PATCH 047/127] * longlines.el (longlines-wrap-follows-window-size): Integer value specifies wrapping margin. (longlines-mode, longlines-window-change-function): Set window-specific wrapping margin based on the above. --- lisp/ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7cc3e1e8c4a..e8e4280b713 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2007-10-17 Chong Yidong + + * longlines.el (longlines-wrap-follows-window-size): Integer value + specifies wrapping margin. + (longlines-mode, longlines-window-change-function): Set + window-specific wrapping margin based on the above. + 2007-10-17 John Wiegley * eshell/esh-cmd.el (eshell-complex-commands): Add "ls". From c455889deb499b2f5fc5af9b766c39b17f3405f2 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 17 Oct 2007 02:50:23 +0000 Subject: [PATCH 048/127] (longlines-wrap-follows-window-size): Integer value specifies wrapping margin. (longlines-mode, longlines-window-change-function): Set window-specific wrapping margin based on the above. --- lisp/longlines.el | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/lisp/longlines.el b/lisp/longlines.el index 07977910a22..c820150c27a 100644 --- a/lisp/longlines.el +++ b/lisp/longlines.el @@ -55,7 +55,11 @@ when the file is saved to disk." "Non-nil means wrapping and filling happen at the edge of the window. Otherwise, `fill-column' is used, regardless of the window size. This does not work well when the buffer is displayed in multiple windows -with differing widths." +with differing widths. + +If the value is an integer, that specifies the distance from the +right edge of the window at which wrapping occurs. For any other +non-nil value, wrapping occurs 2 characters from the right edge." :group 'longlines :type 'boolean) @@ -117,8 +121,14 @@ are indicated with a symbol." 'longlines-search-function) (add-to-list 'buffer-substring-filters 'longlines-encode-string) (when longlines-wrap-follows-window-size - (set (make-local-variable 'fill-column) - (- (window-width) window-min-width)) + (let ((dw (if (and (integerp longlines-wrap-follows-window-size) + (>= longlines-wrap-follows-window-size 0) + (< longlines-wrap-follows-window-size + (window-width))) + longlines-wrap-follows-window-size + 2))) + (set (make-local-variable 'fill-column) + (- (window-width) dw))) (add-hook 'window-configuration-change-hook 'longlines-window-change-function nil t)) (let ((buffer-undo-list t) @@ -415,9 +425,14 @@ This is called by `post-command-hook' after each command." (defun longlines-window-change-function () "Re-wrap the buffer if the window width has changed. This is called by `window-configuration-change-hook'." - (when (/= fill-column (- (window-width) window-min-width)) - (setq fill-column (- (window-width) window-min-width)) - (longlines-wrap-region (point-min) (point-max)))) + (let ((dw (if (and (integerp longlines-wrap-follows-window-size) + (>= longlines-wrap-follows-window-size 0) + (< longlines-wrap-follows-window-size (window-width))) + longlines-wrap-follows-window-size + 2))) + (when (/= fill-column (- (window-width) dw)) + (setq fill-column (- (window-width) dw)) + (longlines-wrap-region (point-min) (point-max))))) ;; Isearch From be8fdb628bd992f3ceefcbfcbe38e403f47739cb Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 17 Oct 2007 07:53:36 +0000 Subject: [PATCH 049/127] (Diary): Fix directive. --- man/ChangeLog | 4 ++++ man/calendar.texi | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/man/ChangeLog b/man/ChangeLog index d329e0dfd72..29d286668d3 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2007-10-17 Juanma Barranquero + + * calendar.texi (Diary): Fix directive. + 2007-10-16 Richard Stallman * calendar.texi (Diary): Clarify text about diary file example. diff --git a/man/calendar.texi b/man/calendar.texi index 12d5b68a371..c111eac354f 100644 --- a/man/calendar.texi +++ b/man/calendar.texi @@ -1008,7 +1008,7 @@ April 15, 1989 Income tax due. @noindent This format is essentially the same as the one used by the system's -@program{calendar} utility. This example uses extra spaces to align +@command{calendar} utility. This example uses extra spaces to align the event descriptions of most of the entries. Such formatting is purely a matter of taste. From 7a80711babd6af0161816503d3c003496bd6f19a Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 17 Oct 2007 07:54:16 +0000 Subject: [PATCH 050/127] (Diary): Fix directive. --- doc/emacs/calendar.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi index 47858f4f99e..6b285094735 100644 --- a/doc/emacs/calendar.texi +++ b/doc/emacs/calendar.texi @@ -1008,7 +1008,7 @@ April 15, 1989 Income tax due. @noindent This format is essentially the same as the one used by the system's -@program{calendar} utility. This example uses extra spaces to align +@command{calendar} utility. This example uses extra spaces to align the event descriptions of most of the entries. Such formatting is purely a matter of taste. From 2a9f4d55f872219693cbd79d6686bc00d1eaaa99 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 17 Oct 2007 08:01:23 +0000 Subject: [PATCH 051/127] *** empty log message *** --- doc/emacs/ChangeLog | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index f65b350955e..71bd3377159 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,7 @@ +2007-10-17 Juanma Barranquero + + * calendar.texi (Diary): Fix directive. + 2007-10-16 Richard Stallman * calendar.texi (Diary): Clarify text about diary file example. @@ -22,9 +26,9 @@ * vc-xtra.texi: * vc1-xtra.texi: * vc2-xtra.texi: Merge in changes for new VC with fileset-oriented - operations. Change of terminology from 'version' to `revision'. + operations. Change of terminology from `version' to `revision'. Revise text for adequate description of VCSes with monotonic IDs. - * emacs.texi: Change of terminology from 'version' to `revision'. + * emacs.texi: Change of terminology from `version' to `revision'. 2007-10-09 Eric S. Raymond @@ -57,7 +61,7 @@ 2007-10-06 Eric S. Raymond * files.texi: Update the section on version control for 2007 - conditions. None of these changes are new-VC-specific; that + conditions. None of these changes are new-VC-specific; that will come later. 2007-09-15 Glenn Morris @@ -177,7 +181,7 @@ 2007-06-24 Karl Berry - * emacs.texi: new Back-Cover Text. + * emacs.texi: New Back-Cover Text. 2007-06-07 Alan Mackenzie From d76e2046517074274f600f8e279cfd506376913a Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 17 Oct 2007 08:15:04 +0000 Subject: [PATCH 052/127] *** empty log message *** --- lisp/server.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/server.el b/lisp/server.el index 7d7b001b33f..c66ff7cfdd6 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -505,11 +505,11 @@ kill any existing server communications subprocess." (when server-use-tcp (let ((auth-key (loop - ;; The auth key is a 64-byte string of random chars in the - ;; range `!'..`~'. - for i below 64 - collect (+ 33 (random 94)) into auth - finally return (concat auth)))) + ;; The auth key is a 64-byte string of random chars in the + ;; range `!'..`~'. + for i below 64 + collect (+ 33 (random 94)) into auth + finally return (concat auth)))) (process-put server-process :auth-key auth-key) (with-temp-file server-file (set-buffer-multibyte nil) From e080d1308132cda5934ed273d9481e7b187799fe Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 17 Oct 2007 08:48:07 +0000 Subject: [PATCH 053/127] (Source Buffers): Use "key binding" consistently. --- man/building.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/building.texi b/man/building.texi index 3fedbfed674..28ea5ec3dc3 100644 --- a/man/building.texi +++ b/man/building.texi @@ -907,7 +907,7 @@ places. @c @findex gdb-mouse-set-clear-breakpoint @c @findex gdb-mouse-toggle-breakpoint -Many GDB commands can be entered using keybindings or the tool bar but +Many GDB commands can be entered using key bindings or the tool bar but sometimes it is quicker to use the fringe. These commands either manipulate breakpoints or control program execution. When there is no fringe, you can use the margin but this is only present when the From 6c2ba6b1584e0367ca2868fe385c144fb3c30f19 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 17 Oct 2007 08:48:54 +0000 Subject: [PATCH 054/127] (Init Non-ASCII): Use "key binding" consistently. --- man/custom.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/custom.texi b/man/custom.texi index d496ab84b19..8ce0ef9f487 100644 --- a/man/custom.texi +++ b/man/custom.texi @@ -2504,7 +2504,7 @@ Type @kbd{C-q}, followed by the key you want to bind, to insert @var{char}. @strong{Warning:} if you change the keyboard encoding, or change between multibyte and unibyte mode, or anything that would alter which -code @kbd{C-q} would insert for that character, this keybinding may +code @kbd{C-q} would insert for that character, this key binding may stop working. It is therefore advisable to use one and only one coding system, for your init file as well as the files you edit. For example, don't mix the @samp{latin-1} and @samp{latin-9} coding From 6a67719802fa70c908cbd4755962dcfc0dba3b9f Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 17 Oct 2007 08:51:04 +0000 Subject: [PATCH 055/127] (Glossary): Use "key binding" consistently. --- man/ChangeLog | 6 ++++++ man/glossary.texi | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/man/ChangeLog b/man/ChangeLog index 29d286668d3..f966d73dd7a 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,9 @@ +2007-10-17 Aaron S. Hawley + + * building.texi (Source Buffers): + * custom.texi (Init Non-ASCII): + * glossary.texi (Glossary): Use "key binding" consistently. + 2007-10-17 Juanma Barranquero * calendar.texi (Diary): Fix directive. diff --git a/man/glossary.texi b/man/glossary.texi index f289c2ca1cb..a9109de667b 100644 --- a/man/glossary.texi +++ b/man/glossary.texi @@ -658,7 +658,7 @@ Justification means adding extra spaces within lines of text to make them extend exactly to a specified width. @xref{Format Justification}. -@item Keybinding +@item Key Binding See `binding.' @item Keyboard Macro From d9c4c9990aae2233b67c6edf9f7ec8bff8727d68 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 17 Oct 2007 08:54:14 +0000 Subject: [PATCH 056/127] building.texi (Source Buffers): Use "key binding" consistently. --- doc/emacs/building.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 5689bf1fe34..45210118f77 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -911,7 +911,7 @@ places. @c @findex gdb-mouse-set-clear-breakpoint @c @findex gdb-mouse-toggle-breakpoint -Many GDB commands can be entered using keybindings or the tool bar but +Many GDB commands can be entered using key bindings or the tool bar but sometimes it is quicker to use the fringe. These commands either manipulate breakpoints or control program execution. When there is no fringe, you can use the margin but this is only present when the From e2949eb050444ec175fbf6a5ea0f2fc60b378e45 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 17 Oct 2007 08:54:49 +0000 Subject: [PATCH 057/127] (Init Non-ASCII): Use "key binding" consistently. --- doc/emacs/custom.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 1276c45af70..29d1c902b7c 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -2505,7 +2505,7 @@ Type @kbd{C-q}, followed by the key you want to bind, to insert @var{char}. @strong{Warning:} if you change the keyboard encoding, or change between multibyte and unibyte mode, or anything that would alter which -code @kbd{C-q} would insert for that character, this keybinding may +code @kbd{C-q} would insert for that character, this key binding may stop working. It is therefore advisable to use one and only one coding system, for your init file as well as the files you edit. For example, don't mix the @samp{latin-1} and @samp{latin-9} coding From 5a331f34c39f4ed6695fc72196227993528a36bc Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 17 Oct 2007 08:58:23 +0000 Subject: [PATCH 058/127] (Glossary): Use "key binding" consistently. --- doc/emacs/ChangeLog | 8 +++++++- doc/emacs/glossary.texi | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 71bd3377159..3490f786ecd 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,9 @@ +2007-10-17 Aaron S. Hawley + + * building.texi (Source Buffers): + * custom.texi (Init Non-ASCII): + * glossary.texi (Glossary): Use "key binding" consistently. + 2007-10-17 Juanma Barranquero * calendar.texi (Diary): Fix directive. @@ -18,7 +24,7 @@ * emacs.texi: * files.texi (Version Systems): Minor fixes to version-control material - suggseted by RMS and Robert J. Chassell. + suggested by RMS and Robert J. Chassell. 2007-10-10 Eric S. Raymond diff --git a/doc/emacs/glossary.texi b/doc/emacs/glossary.texi index f289c2ca1cb..a9109de667b 100644 --- a/doc/emacs/glossary.texi +++ b/doc/emacs/glossary.texi @@ -658,7 +658,7 @@ Justification means adding extra spaces within lines of text to make them extend exactly to a specified width. @xref{Format Justification}. -@item Keybinding +@item Key Binding See `binding.' @item Keyboard Macro From f0761de82c0318ae8de61ac3c833ef48edb678c5 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 17 Oct 2007 08:59:54 +0000 Subject: [PATCH 059/127] *** empty log message *** --- man/ChangeLog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index f966d73dd7a..9f162ab2186 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,8 +1,8 @@ 2007-10-17 Aaron S. Hawley - * building.texi (Source Buffers): - * custom.texi (Init Non-ASCII): - * glossary.texi (Glossary): Use "key binding" consistently. + * building.texi (Source Buffers): + * custom.texi (Init Non-ASCII): + * glossary.texi (Glossary): Use "key binding" consistently. 2007-10-17 Juanma Barranquero From 2504022a915fcecc71d08a5312af0c414b4c97cb Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 17 Oct 2007 14:12:59 +0000 Subject: [PATCH 060/127] (read1): Set pvectype for char_tables. --- src/ChangeLog | 2 ++ src/lread.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a48dc5c6438..2ba3ac06a86 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2007-10-17 Stefan Monnier + * lread.c (read1): Set pvectype for char_tables. + * lisp.h (XMISCANY, XMARKER, XINTFWD, XBOOLFWD, XOBJFWD, XOVERLAY) (XBUFFER_OBJFWD, XBUFFER_LOCAL_VALUE, XKBOARD_OBJFWD, XSAVE_VALUE): Add type checks. diff --git a/src/lread.c b/src/lread.c index 77eb800b41a..ee020fd43d3 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2207,7 +2207,7 @@ read1 (readcharfun, pch, first_in_list) if (XVECTOR (tmp)->size < CHAR_TABLE_STANDARD_SLOTS || XVECTOR (tmp)->size > CHAR_TABLE_STANDARD_SLOTS + 10) error ("Invalid size char-table"); - XSETCHAR_TABLE (tmp, XCHAR_TABLE (tmp)); + XSETPVECTYPE (XVECTOR (tmp), PVEC_CHAR_TABLE); XCHAR_TABLE (tmp)->top = Qt; return tmp; } @@ -2220,7 +2220,7 @@ read1 (readcharfun, pch, first_in_list) tmp = read_vector (readcharfun, 0); if (XVECTOR (tmp)->size != SUB_CHAR_TABLE_STANDARD_SLOTS) error ("Invalid size char-table"); - XSETCHAR_TABLE (tmp, XCHAR_TABLE (tmp)); + XSETPVECTYPE (XVECTOR (tmp), PVEC_CHAR_TABLE); XCHAR_TABLE (tmp)->top = Qnil; return tmp; } From 943756ea6892039d9611646cfbb4888ebebd970d Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 17 Oct 2007 15:12:53 +0000 Subject: [PATCH 061/127] Doc fix. --- admin/ChangeLog | 16 ++++++++++------ admin/make-emacs | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/admin/ChangeLog b/admin/ChangeLog index 10cec99a09b..e73eb21327c 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,7 @@ +2007-10-17 Juanma Barranquero + + * make-emacs: Doc fix. + 2007-08-28 Glenn Morris * admin.el: Provide self. @@ -167,7 +171,7 @@ 2005-10-17 Bill Wohler * FOR-RELEASE (DOCUMENTATION): Removed lisp/toolbar from list - since it's gone. Also marked mh-e as done. + since it's gone. Also marked mh-e as done. 2005-10-11 Juanma Barranquero @@ -213,11 +217,11 @@ 2005-03-30 Marcelo Toledo - * FOR-RELEASE (Documentation): Added check the Emacs Tutorial. The - first line of every tutorial must begin with a sentence saying - "Emacs Tutorial" in the respective language. This should be - followed by "See end for copying conditions", likewise in the - respective language. + * FOR-RELEASE (Documentation): Added check the Emacs Tutorial. + The first line of every tutorial must begin with a sentence saying + "Emacs Tutorial" in the respective language. This should be + followed by "See end for copying conditions", likewise in the + respective language. 2005-03-29 Luc Teirlinck diff --git a/admin/make-emacs b/admin/make-emacs index 23b4e1c6374..94bf2092a8b 100755 --- a/admin/make-emacs +++ b/admin/make-emacs @@ -68,7 +68,7 @@ Build Emacs. --help show this help --all make clean versionclean first --boot make boostrap, log to boot.log - --enable-checking ENABLE_CHECKING=1 (implies Lisp union type) + --enable-checking ENABLE_CHECKING=1 --no-warn disable warnings --check-marked GC_CHECK_MARKED_OBJECTS=1 --optim no debug defines From c136b8280e4d22e30a72a417701e46bc19f4528b Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 17 Oct 2007 15:52:53 +0000 Subject: [PATCH 062/127] * configure.in (HAVE_RES_INIT): Define if res_init() exists. (HAVE_LIBRESOLV): Also define if we are using res_init(). --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0e957a6aa45..387fcfc73f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-10-17 Chong Yidong + + * configure.in (HAVE_RES_INIT): Define if res_init() exists. + (HAVE_LIBRESOLV): Also define if we are using res_init(). + 2007-10-17 Glenn Morris * FTP: Remove file, since it's just a duplicate of one in etc/. From 555ffc3fcfa4565d2bdb1ebb0a8a8b2ef80140d2 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 17 Oct 2007 15:53:01 +0000 Subject: [PATCH 063/127] (HAVE_RES_INIT): Define if res_init() exists. (HAVE_LIBRESOLV): Also define if we are using res_init(). --- configure.in | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 0f101a0edc3..c6fca826461 100644 --- a/configure.in +++ b/configure.in @@ -2731,7 +2731,7 @@ AC_CHECK_HEADERS(maillock.h) AC_CHECK_FUNCS(gethostname getdomainname dup2 \ rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \ -random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \ +random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime setsid \ strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \ utimes setrlimit setpgid getcwd getwd shutdown getaddrinfo \ __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \ @@ -2775,17 +2775,38 @@ AC_CHECK_FUNCS(getpt) # than to expect to find it in ncurses. AC_CHECK_LIB(ncurses, tparm) +# Do we have res_init, for detecting changes in /etc/resolv.conf? + +resolv=no +AC_CHECK_FUNC(res_init, have_res_init=yes, have_res_init=no) +if test "$have_res_init" = no; then + OLIBS="$LIBS" + LIBS="$LIBS -lresolv" + AC_MSG_CHECKING(for res_init with -lresolv) + AC_TRY_LINK([#include +#include +#include ], + [res_init();], + have_res_init=yes, have_res_init=no) + AC_MSG_RESULT($have_res_init) + if test "$have_res_init" = yes ; then + resolv=yes + fi + LIBS="$OLIBS" +fi + +if test "$have_res_init" = yes; then + AC_DEFINE(HAVE_RES_INIT, 1, [Define to 1 if res_init is available.]) +fi + # Do we need the Hesiod library to provide the support routines? if test "$with_hesiod" = yes ; then # Don't set $LIBS here -- see comments above. - resolv=no AC_CHECK_FUNC(res_send, , [AC_CHECK_FUNC(__res_send, , [AC_CHECK_LIB(resolv, res_send, resolv=yes, [AC_CHECK_LIB(resolv, __res_send, resolv=yes)])])]) if test "$resolv" = yes ; then RESOLVLIB=-lresolv - AC_DEFINE(HAVE_LIBRESOLV, 1, - [Define to 1 if you have the resolv library (-lresolv).]) else RESOLVLIB= fi @@ -2795,6 +2816,12 @@ if test "$with_hesiod" = yes ; then :, $RESOLVLIB)]) fi +# Do we need libresolv (due to res_init or Hesiod)? +if test "$resolv" = yes ; then + AC_DEFINE(HAVE_LIBRESOLV, 1, + [Define to 1 if you have the resolv library (-lresolv).]) +fi + # These tell us which Kerberos-related libraries to use. if test "${with_kerberos+set}" = set; then AC_CHECK_LIB(com_err, com_err) From 44bb704d642ae0a817710183af583cd278d8d82d Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 17 Oct 2007 15:57:17 +0000 Subject: [PATCH 064/127] * process.c: Link to libs for calling res_init() if available. (Fmake_network_process): Call res_init() before getaddrinfo or gethostbyname, if possible. --- src/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 2ba3ac06a86..98bf9978907 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2007-10-17 Chong Yidong + + * process.c: Link to libs for calling res_init() if available. + (Fmake_network_process): Call res_init() before getaddrinfo or + gethostbyname, if possible. + 2007-10-17 Stefan Monnier * lread.c (read1): Set pvectype for char_tables. From 08116b48fed9f1abb1503bfbdccad19f67bc7b68 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 17 Oct 2007 15:57:30 +0000 Subject: [PATCH 065/127] Link to libs for calling res_init() if available. (Fmake_network_process): Call res_init() before getaddrinfo or gethostbyname, if possible. --- src/process.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/process.c b/src/process.c index 19275e40db5..6749ebda117 100644 --- a/src/process.c +++ b/src/process.c @@ -121,6 +121,12 @@ Boston, MA 02110-1301, USA. */ #include #endif +#ifdef HAVE_RES_INIT +#include +#include +#include +#endif + #include "lisp.h" #include "systime.h" #include "systty.h" @@ -3083,6 +3089,11 @@ usage: (make-network-process &rest ARGS) */) hints.ai_family = family; hints.ai_socktype = socktype; hints.ai_protocol = 0; + +#ifdef HAVE_RES_INIT + res_init (); +#endif + ret = getaddrinfo (SDATA (host), portstring, &hints, &res); if (ret) #ifdef HAVE_GAI_STRERROR @@ -3128,6 +3139,11 @@ usage: (make-network-process &rest ARGS) */) as it may `hang' Emacs for a very long time. */ immediate_quit = 1; QUIT; + +#ifdef HAVE_RES_INIT + res_init (); +#endif + host_info_ptr = gethostbyname (SDATA (host)); immediate_quit = 0; From bc3512d03f4d7baa2118b0f4361297249463bb5a Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 17 Oct 2007 15:58:05 +0000 Subject: [PATCH 066/127] Regenerate. --- configure | 186 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 170 insertions(+), 16 deletions(-) diff --git a/configure b/configure index 0a1a0cc97ed..d53db5f1816 100755 --- a/configure +++ b/configure @@ -15920,12 +15920,11 @@ done - for ac_func in gethostname getdomainname dup2 \ rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \ -random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \ +random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime setsid \ strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \ utimes setrlimit setpgid getcwd getwd shutdown getaddrinfo \ __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \ @@ -18532,13 +18531,11 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include /* for off_t */ - #include +#include int main () { -int (*fp) (FILE *, off_t, int) = fseeko; - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); +return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0); ; return 0; } @@ -18578,13 +18575,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGEFILE_SOURCE 1 -#include /* for off_t */ - #include +#include int main () { -int (*fp) (FILE *, off_t, int) = fseeko; - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); +return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0); ; return 0; } @@ -19613,10 +19608,165 @@ _ACEOF fi +# Do we have res_init, for detecting changes in /etc/resolv.conf? + +resolv=no +{ echo "$as_me:$LINENO: checking for res_init" >&5 +echo $ECHO_N "checking for res_init... $ECHO_C" >&6; } +if test "${ac_cv_func_res_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define res_init to an innocuous variant, in case declares res_init. + For example, HP-UX 11i declares gettimeofday. */ +#define res_init innocuous_res_init + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char res_init (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef res_init + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char res_init (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_res_init || defined __stub___res_init +choke me +#endif + +int +main () +{ +return res_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_res_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_res_init=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_res_init" >&5 +echo "${ECHO_T}$ac_cv_func_res_init" >&6; } +if test $ac_cv_func_res_init = yes; then + have_res_init=yes +else + have_res_init=no +fi + +if test "$have_res_init" = no; then + OLIBS="$LIBS" + LIBS="$LIBS -lresolv" + { echo "$as_me:$LINENO: checking for res_init with -lresolv" >&5 +echo $ECHO_N "checking for res_init with -lresolv... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +int +main () +{ +res_init(); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + have_res_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + have_res_init=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + { echo "$as_me:$LINENO: result: $have_res_init" >&5 +echo "${ECHO_T}$have_res_init" >&6; } + if test "$have_res_init" = yes ; then + resolv=yes + fi + LIBS="$OLIBS" +fi + +if test "$have_res_init" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_RES_INIT 1 +_ACEOF + +fi + # Do we need the Hesiod library to provide the support routines? if test "$with_hesiod" = yes ; then # Don't set $LIBS here -- see comments above. - resolv=no { echo "$as_me:$LINENO: checking for res_send" >&5 echo $ECHO_N "checking for res_send... $ECHO_C" >&6; } if test "${ac_cv_func_res_send+set}" = set; then @@ -19922,11 +20072,6 @@ fi if test "$resolv" = yes ; then RESOLVLIB=-lresolv - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBRESOLV 1 -_ACEOF - else RESOLVLIB= fi @@ -20089,6 +20234,15 @@ fi fi +# Do we need libresolv (due to res_init or Hesiod)? +if test "$resolv" = yes ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBRESOLV 1 +_ACEOF + +fi + # These tell us which Kerberos-related libraries to use. if test "${with_kerberos+set}" = set; then From 17f3909f6154ba5473cd5d76fc2b87fab48d79a2 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 17 Oct 2007 16:22:27 +0000 Subject: [PATCH 067/127] (vc-diff-sentinel, vc-diff-internal): Revert some changes in the behavior unrelated to filesets. --- lisp/ChangeLog | 13 ++++++++---- lisp/vc.el | 56 ++++++++++++++++++++++++-------------------------- 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e8e4280b713..3259a58a839 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,9 +1,14 @@ +2007-10-17 Stefan Monnier + + * vc.el (vc-diff-sentinel, vc-diff-internal): Revert some change in the + behavior unrelated to filesets. + 2007-10-17 Chong Yidong * longlines.el (longlines-wrap-follows-window-size): Integer value specifies wrapping margin. - (longlines-mode, longlines-window-change-function): Set - window-specific wrapping margin based on the above. + (longlines-mode, longlines-window-change-function): + Set window-specific wrapping margin based on the above. 2007-10-17 John Wiegley @@ -16,8 +21,8 @@ 2007-10-17 Glenn Morris - * progmodes/cc-menus.el (cc-imenu-c++-generic-expression): Tweak - regexp to avoid stack overflow. + * progmodes/cc-menus.el (cc-imenu-c++-generic-expression): + Tweak regexp to avoid stack overflow. 2007-10-16 Stefan Monnier diff --git a/lisp/vc.el b/lisp/vc.el index a0db56ce6d7..0cf800c2ddd 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -1873,24 +1873,17 @@ The meaning of REV1 and REV2 is the same as for `vc-revision-diff'." (make-obsolete 'vc-diff-switches-list 'vc-switches "22.1") (defun vc-diff-sentinel (verbose rev1-name rev2-name) - ;; Did changes get generated into the buffer? - (if (not (zerop (buffer-size (get-buffer "*vc-diff*")))) - (progn - (pop-to-buffer "*vc-diff*") - ;; Gnus-5.8.5 sets up an autoload for diff-mode, even if it's - ;; not available. Work around that. - (if (require 'diff-mode nil t) (diff-mode)) - (when verbose - (let (buffer-read-only) - (goto-char (point-max)) - (insert (format "\n\nDiffs between %s and %s end here." rev1-name rev2-name)) - (goto-char (point-min)) - (insert (format "Diffs between %s and %s:\n\n" rev1-name rev2-name)))) - (shrink-window-if-larger-than-buffer) - t) - (progn - (message "No changes between %s and %s" rev1-name rev2-name) - nil))) + ;; The empty sync output case has already been handled, so the only + ;; possibility of an empty output is for an async process, in which case + ;; it's important to insert the "diffs end here" message in the buffer + ;; since the user may miss a message in the echo area. + (when verbose + (let ((inhibit-read-only t)) + (if (eq (buffer-size) 0) + (insert "No differences found.\n") + (insert (format "\n\nDiffs between %s and %s end here." rev1-name rev2-name))))) + (goto-char (point-min)) + (shrink-window-if-larger-than-buffer)) (defun vc-diff-internal (backend async files rev1 rev2 &optional verbose) "Report diffs between two revisions of a fileset. @@ -1927,12 +1920,20 @@ returns t if the buffer had changes, nil otherwise." (let ((vc-disable-async-diff (not async))) (vc-call-backend backend 'diff filtered rev1 rev2 "*vc-diff*"))) (set-buffer "*vc-diff*") - ;; This odd-looking code is because in the non-async case we - ;; actually want to pass the return value from vc-diff-sentinel - ;; back to the caller. - (if async - (vc-exec-after `(vc-diff-sentinel ,verbose ,rev1-name ,rev2-name)) - (vc-diff-sentinel verbose rev1-name rev2-name)))) + (if (and (zerop (buffer-size)) + (not (get-buffer-process (current-buffer)))) + ;; Treat this case specially so as not to pop the buffer. + (progn + (message "No changes between %s and %s" rev1-name rev2-name) + nil) + (pop-to-buffer (current-buffer)) + ;; Gnus-5.8.5 sets up an autoload for diff-mode, even if it's + ;; not available. Work around that. + (if (require 'diff-mode nil t) (diff-mode)) + (vc-exec-after `(vc-diff-sentinel ,verbose ,rev1-name ,rev2-name)) + ;; In the async case, we return t even if there are no differences + ;; because we don't know that yet. + t))) ;;;###autoload (defun vc-history-diff (backend files rev1 rev2) @@ -3031,10 +3032,7 @@ to provide the `find-revision' operation instead." (vc-register))) (defalias 'vc-default-logentry-check 'ignore) - -(defun vc-default-check-headers (backend) - "Default implementation of check-headers; always returns nil." - nil) +(defalias 'vc-default-check-headers 'ignore) (defun vc-default-log-view-mode (backend) (log-view-mode)) @@ -3116,7 +3114,7 @@ to provide the `find-revision' operation instead." (and (not vc-make-backup-files) (delete-file backup-name)))))) (message "Checking out %s...done" file)))) -(defun vc-default-revision-completion-table (backend file) nil) +(defalias 'vc-default-revision-completion-table 'ignore) (defun vc-check-headers () "Check if the current file has any headers in it." From 1a4a884cc5ffc9f2c523562444b8a37e58ee8fcf Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 17 Oct 2007 16:22:48 +0000 Subject: [PATCH 068/127] (server-select-display): Nop if we do not support m-f-o-d. (server-process-filter): Revert last change. --- lisp/ChangeLog | 3 +++ lisp/server.el | 11 +++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3259a58a839..555aa3ec85d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2007-10-17 Stefan Monnier + * server.el (server-select-display): Nop if we do not support m-f-o-d. + (server-process-filter): Revert last change. + * vc.el (vc-diff-sentinel, vc-diff-internal): Revert some change in the behavior unrelated to filesets. diff --git a/lisp/server.el b/lisp/server.el index c66ff7cfdd6..70d2283b0eb 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -325,7 +325,10 @@ message." (defun server-select-display (display) ;; If the current frame is on `display' we're all set. - (unless (equal (frame-parameter (selected-frame) 'display) display) + ;; Similarly if we are unable to open a frames on other displays, there's + ;; nothing more we can do. + (unless (or (not (fboundp 'make-frame-on-display)) + (equal (frame-parameter (selected-frame) 'display) display)) ;; Otherwise, look for an existing frame there and select it. (dolist (frame (frame-list)) (when (equal (frame-parameter frame 'display) display) @@ -831,11 +834,7 @@ The following commands are accepted by the client: ;; Open X frames on the given display instead of the default. ((and (equal "-display" arg) (string-match "\\([^ ]*\\) " request)) - ;; Only set `display' if X is supported. - ;; Emacsclient cannot know if emacs supports X and - ;; it will send -display anyway. - (when (memq 'x frame-creation-function-alist) - (setq display (match-string 1 request))) + (setq display (match-string 1 request)) (setq request (substring request (match-end 0)))) ;; -window-system: Open a new X frame. From 77041513480f398d4490b291cbdc554efbdc7985 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 17 Oct 2007 16:24:33 +0000 Subject: [PATCH 069/127] (compilation-next-error-function): Fix timestamp handling, so compilation-fake-loc works again. --- lisp/ChangeLog | 3 +++ lisp/progmodes/compile.el | 15 ++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 555aa3ec85d..eaf88bbd6ee 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2007-10-17 Stefan Monnier + * progmodes/compile.el (compilation-next-error-function): Fix timestamp + handling, so compilation-fake-loc works again. + * server.el (server-select-display): Nop if we do not support m-f-o-d. (server-process-filter): Revert last change. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 9ed7ba09de9..482cfee1b9b 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1658,10 +1658,15 @@ This is the value of `next-error-function' in Compilation buffers." ;; in the same process and buffer). ;; So, recalculate all markers for that file. (unless (and (nth 3 loc) (marker-buffer (nth 3 loc)) - (equal (nth 4 loc) - (setq timestamp - (with-current-buffer (marker-buffer (nth 3 loc)) - (visited-file-modtime))))) + ;; There may be no timestamp info if the loc is a `fake-loc'. + ;; So we skip the time-check here, although we should maybe + ;; change `compilation-fake-loc' to add timestamp info. + (or (null (nth 4 loc)) + (equal (nth 4 loc) + (setq timestamp + (with-current-buffer + (marker-buffer (nth 3 loc)) + (visited-file-modtime)))))) (with-current-buffer (compilation-find-file marker (caar (nth 2 loc)) (cadr (car (nth 2 loc)))) (save-restriction @@ -1711,7 +1716,7 @@ region and the first line of the next region." (or (consp file) (setq file (list file))) (setq file (compilation-get-file-structure file)) ;; Between the current call to compilation-fake-loc and the first occurrence - ;; of an error message referring to `file', the data is only kept is the + ;; of an error message referring to `file', the data is only kept in the ;; weak hash-table compilation-locs, so we need to prevent this entry ;; in compilation-locs from being GC'd away. --Stef (push file compilation-gcpro) From 2e03898b123fcc4754aef8280a6369b14db2f6a0 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 17 Oct 2007 19:21:36 +0000 Subject: [PATCH 070/127] Fix wording of the SPC non-completion of file names entry. --- etc/NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index d1651756c53..ae7872c4534 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -324,7 +324,7 @@ need to quote the space with a C-q. The underlying changes in the keymaps that are active in the minibuffer are described below under "New keymaps for typing file names". -If you want the old behavior back, put these two key bindings to your +If you want the old behavior back, add these two key bindings to your ~/.emacs init file: (define-key minibuffer-local-filename-completion-map From 4b378e754612c321d72756786ecdbcba44f9e423 Mon Sep 17 00:00:00 2001 From: Reiner Steib Date: Wed, 17 Oct 2007 20:58:02 +0000 Subject: [PATCH 071/127] Mention xpdf. Fix spelling of Ghostscript. (doc-view-ghostscript-options): Fix typo in doc string. --- lisp/ChangeLog | 5 +++++ lisp/doc-view.el | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eaf88bbd6ee..11e82c703a3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-17 Reiner Steib + + * doc-view.el: Mention xpdf. Fix spelling of Ghostscript. + (doc-view-ghostscript-options): Fix typo in doc string. + 2007-10-17 Stefan Monnier * progmodes/compile.el (compilation-next-error-function): Fix timestamp diff --git a/lisp/doc-view.el b/lisp/doc-view.el index d7d2bb47abb..40c91ffe016 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -26,8 +26,9 @@ ;;; Requirements: -;; doc-view.el requires GNU Emacs 22.1 or newer. You also need GhostScript, -;; `dvipdfm' which comes with TeTeX and `pdftotext', which comes with poppler +;; doc-view.el requires GNU Emacs 22.1 or newer. You also need Ghostscript, +;; `dvipdfm' which comes with teTeX and `pdftotext', which comes with xpdf +;; (http://www.foolabs.com/xpdf/) or poppler ;; (http://poppler.freedesktop.org/). ;;; Commentary: @@ -123,7 +124,7 @@ '("-dNOPAUSE" "-sDEVICE=png16m" "-dTextAlphaBits=4" "-dBATCH" "-dGraphicsAlphaBits=4" "-dQUIET" "-r100") - "A list of options to give to ghostview." + "A list of options to give to ghostscript." :type '(sexp) :group 'doc-view) @@ -463,7 +464,7 @@ Those files are saved in the directory given by (if (not (string= (file-name-extension doc) "dvi")) ;; Convert to PNG images. (doc-view-pdf/ps->png doc png-file) - ;; DVI files have to be converted to PDF before GhostScript can process + ;; DVI files have to be converted to PDF before Ghostscript can process ;; it. (doc-view-dvi->pdf doc (concat (file-name-as-directory dir) From 57581fccfe5e3a879853efe9fb685d45b9c5b63b Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Wed, 17 Oct 2007 21:09:56 +0000 Subject: [PATCH 072/127] Display message when tutorial position is not saved --- lisp/ChangeLog | 5 +++++ lisp/tutorial.el | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 11e82c703a3..77740d1f910 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-17 Aaron Hawley + + * tutorial.el (tutorial--save-tutorial): Display message when tutorial + position is not saved. + 2007-10-17 Reiner Steib * doc-view.el: Mention xpdf. Fix spelling of Ghostscript. diff --git a/lisp/tutorial.el b/lisp/tutorial.el index 26fb0e503f7..4913da63f5c 100644 --- a/lisp/tutorial.el +++ b/lisp/tutorial.el @@ -665,7 +665,8 @@ position where the display of changed bindings was inserted." ;; This runs in a hook so protect it: (condition-case err (if (y-or-n-p "Save your position in the tutorial? ") - (tutorial--save-tutorial-to (tutorial--saved-file))) + (tutorial--save-tutorial-to (tutorial--saved-file)) + (message "Tutorial position not saved")) (error (message "Error saving tutorial state: %s" (error-message-string err))))) From 63b9e28d052daf33d872a4df06b1fa880c7a3549 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Wed, 17 Oct 2007 21:10:34 +0000 Subject: [PATCH 073/127] Display message when tutorial position is not saved --- lisp/ChangeLog | 5 +++++ lisp/tutorial.el | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7d1bf357f06..d875705e63e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-17 Aaron Hawley + + * tutorial.el (tutorial--save-tutorial): Display message when tutorial + position is not saved. + 2007-10-17 Chong Yidong * longlines.el (longlines-wrap-follows-window-size): Integer value diff --git a/lisp/tutorial.el b/lisp/tutorial.el index bfa7f42d8ab..a7f239d7499 100644 --- a/lisp/tutorial.el +++ b/lisp/tutorial.el @@ -656,7 +656,8 @@ position where the display of changed bindings was inserted." ;; This runs in a hook so protect it: (condition-case err (if (y-or-n-p "Save your position in the tutorial? ") - (tutorial--save-tutorial-to (tutorial--saved-file))) + (tutorial--save-tutorial-to (tutorial--saved-file)) + (message "Tutorial position not saved")) (error (message "Error saving tutorial state: %s" (error-message-string err))))) From 640602f766d7431ae40ac5ffa274db405b1c4d7d Mon Sep 17 00:00:00 2001 From: Reiner Steib Date: Wed, 17 Oct 2007 21:34:19 +0000 Subject: [PATCH 074/127] * bindings.el (completion-ignored-extensions): Remove pdf and dvi extensions since they can be viewed with doc-view. * files.el (auto-mode-alist): Make doc-view-mode the default mode for pdf, ps and dvi files. * doc-view.el: Make doc-view-mode the standard mode for viewing pdf, [e]ps and dvi files and add binding C-c C-c to toggle between text and image display. Add binding C-c C-e to switch to an editing mode. (doc-view-ghostscript-options, doc-view-ps->pdf): Add "-dSAFER" to avoid security problems when rendering files untrusted sources. --- lisp/ChangeLog | 15 ++ lisp/bindings.el | 2 +- lisp/doc-view.el | 367 +++++++++++++++++++++++++++-------------------- lisp/files.el | 2 +- 4 files changed, 230 insertions(+), 156 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 77740d1f910..d6b0dd86cac 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,18 @@ +2007-10-17 Tassilo Horn + + * bindings.el (completion-ignored-extensions): Remove pdf and dvi + extensions since they can be viewed with doc-view. + + * files.el (auto-mode-alist): Make doc-view-mode the default mode + for pdf, ps and dvi files. + + * doc-view.el: Make doc-view-mode the standard mode for viewing + pdf, [e]ps and dvi files and add binding C-c C-c to toggle between + text and image display. Add binding C-c C-e to switch to an + editing mode. + (doc-view-ghostscript-options, doc-view-ps->pdf): Add "-dSAFER" to + avoid security problems when rendering files untrusted sources. + 2007-10-17 Aaron Hawley * tutorial.el (tutorial--save-tutorial): Display message when tutorial diff --git a/lisp/bindings.el b/lisp/bindings.el index bab319fa029..5080eb8c3b0 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -536,7 +536,7 @@ is okay. See `mode-line-format'.") '(".elc" ".lof" ".glo" ".idx" ".lot" ;; TeX-related - ".dvi" ".fmt" ".tfm" ".pdf" + ".fmt" ".tfm" ;; Java compiled ".class" ;; CLISP diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 40c91ffe016..64ee1bbd8ea 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -5,7 +5,7 @@ ;; Author: Tassilo Horn ;; Maintainer: Tassilo Horn ;; Keywords: files, pdf, ps, dvi -;; Version: <2007-10-02 Tue 18:21> +;; Version: <2007-10-17 Wed 22:15> ;; This file is part of GNU Emacs. @@ -28,8 +28,7 @@ ;; doc-view.el requires GNU Emacs 22.1 or newer. You also need Ghostscript, ;; `dvipdfm' which comes with teTeX and `pdftotext', which comes with xpdf -;; (http://www.foolabs.com/xpdf/) or poppler -;; (http://poppler.freedesktop.org/). +;; (http://www.foolabs.com/xpdf/) or poppler (http://poppler.freedesktop.org/). ;;; Commentary: @@ -38,16 +37,19 @@ ;; inside an Emacs buffer. This buffer uses `doc-view-mode' which provides ;; convenient key bindings for browsing the document. ;; -;; To use it simply do +;; To use it simply open a document file with ;; -;; M-x doc-view RET +;; C-x C-f ~/path/to/document RET ;; -;; and you'll be queried for a document to open. +;; and the document will be converted and displayed, if your emacs supports png +;; images. With `C-c C-c' you can toggle between the rendered images +;; representation and the source text representation of the document. With +;; `C-c C-e' you can switch to an appropriate editing mode for the document. ;; ;; Since conversion may take some time all the PNG images are cached in a ;; subdirectory of `doc-view-cache-directory' and reused when you want to view -;; that file again. This reusing can be omitted if you provide a prefx -;; argument to `doc-view'. To delete all cached files use +;; that file again. To reconvert a document hit `g' (`doc-view-reconvert-doc') +;; when displaying the document. To delete all cached files use ;; `doc-view-clear-cache'. To open the cache with dired, so that you can tidy ;; it out use `doc-view-dired-cache'. ;; @@ -68,8 +70,6 @@ ;; bottom-right corner of the desired slice. To reset the slice use ;; `doc-view-reset-slice' (bound to `s r'). ;; -;; Dired users should have a look at `doc-view-dired'. -;; ;; You can also search within the document. The command `doc-view-search' ;; (bound to `C-s') queries for a search regexp and initializes a list of all ;; matching pages and messages how many match-pages were found. After that you @@ -81,17 +81,16 @@ ;; conversion. When that finishes and you're still viewing the document ;; (i.e. you didn't switch to another buffer) you're queried for the regexp ;; then. +;; +;; Dired users can simply hit `v' on a document file. If it's a PS, PDF or DVI +;; it will be opened using `doc-view-mode'. +;; ;;; Configuration: -;; Basically doc-view should be quite usable with its standard settings, so -;; putting -;; -;; (require 'doc-view) -;; -;; into your `user-init-file' should be enough. If the images are too small or -;; too big you should set the "-rXXX" option in `doc-view-ghostscript-options' -;; to another value. (The bigger your screen, the higher the value.) +;; If the images are too small or too big you should set the "-rXXX" option in +;; `doc-view-ghostscript-options' to another value. (The bigger your screen, +;; the higher the value.) ;; ;; This and all other options can be set with the customization interface. ;; Simply do @@ -123,7 +122,7 @@ (defcustom doc-view-ghostscript-options '("-dNOPAUSE" "-sDEVICE=png16m" "-dTextAlphaBits=4" "-dBATCH" "-dGraphicsAlphaBits=4" "-dQUIET" - "-r100") + "-dSAFER" "-r100") "A list of options to give to ghostscript." :type '(sexp) :group 'doc-view) @@ -202,7 +201,10 @@ has finished." (defvar doc-view-current-info nil "Only used internally.") -;;;; DocView Keymap +(defvar doc-view-current-display nil + "Only used internally.") + +;;;; DocView Keymaps (defvar doc-view-mode-map (let ((map (make-sparse-keymap))) @@ -236,9 +238,26 @@ has finished." (define-key map (kbd "M-v") 'scroll-down) ;; Show the tooltip (define-key map (kbd "C-t") 'doc-view-show-tooltip) + ;; Toggle between text and image display or editing + (define-key map (kbd "C-c C-c") 'doc-view-toggle-display) + (define-key map (kbd "C-c C-e") 'doc-view-edit-doc) + ;; Reconvert the current document + (define-key map (kbd "g") 'doc-view-reconvert-doc) (suppress-keymap map) map) - "Keymap used by `doc-view-mode'.") + "Keymap used by `doc-view-mode' when displaying a doc as a set of images.") + +(defvar doc-view-mode-text-map + (let ((map (make-sparse-keymap))) + ;; Toggle between text and image display or editing + (define-key map (kbd "C-c C-c") 'doc-view-toggle-display) + (define-key map (kbd "C-c C-e") 'doc-view-edit-doc) + ;; Killing/burying the buffer (and the process) + (define-key map (kbd "q") 'bury-buffer) + (define-key map (kbd "k") 'doc-view-kill-proc-and-buffer) + (define-key map (kbd "C-x k") 'doc-view-kill-proc-and-buffer) + map) + "Keymap used by `doc-view-mode' when displaying a document as text.") ;;;; Navigation Commands @@ -272,16 +291,16 @@ has finished." (setq contexts (concat contexts " - \"" m "\"\n"))) contexts))))) ;; Update the buffer - (setq inhibit-read-only t) - (erase-buffer) - (let ((beg (point))) - (doc-view-insert-image (nth (1- page) doc-view-current-files) - :pointer 'arrow) - (put-text-property beg (point) 'help-echo doc-view-current-info)) - (insert "\n" doc-view-current-info) - (goto-char (point-min)) - (forward-char) - (setq inhibit-read-only nil))) + (let ((inhibit-read-only t)) + (erase-buffer) + (let ((beg (point))) + (doc-view-insert-image (nth (1- page) doc-view-current-files) + :pointer 'arrow) + (put-text-property beg (point) 'help-echo doc-view-current-info)) + (insert "\n" doc-view-current-info) + (goto-char (point-min)) + (forward-char)) + (set-buffer-modified-p nil))) (defun doc-view-next-page (&optional arg) "Browse ARG pages forward." @@ -318,42 +337,62 @@ has finished." (error (doc-view-previous-page) (goto-char (point-max))))) +(defun doc-view-kill-proc () + "Kill the current converter process." + (interactive) + (when doc-view-current-converter-process + (kill-process doc-view-current-converter-process)) + (when doc-view-current-timer + (cancel-timer doc-view-current-timer) + (setq doc-view-current-timer nil)) + (setq mode-line-process nil)) + (defun doc-view-kill-proc-and-buffer () "Kill the current converter process and buffer." (interactive) + (doc-view-kill-proc) (when (eq major-mode 'doc-view-mode) - (when doc-view-current-converter-process - (kill-process doc-view-current-converter-process)) - (when doc-view-current-timer - (cancel-timer doc-view-current-timer) - (setq doc-view-current-timer nil)) (kill-buffer (current-buffer)))) ;;;; Conversion Functions -(defun doc-view-file-name-to-directory-name (file) - "Return the directory where the png files of FILE should be saved. +(defun doc-view-reconvert-doc (&rest args) + "Reconvert the current document. +Should be invoked when the cached images aren't up-to-date." + (interactive) + (let ((inhibit-read-only t) + (doc doc-view-current-doc)) + (doc-view-kill-proc) + ;; Clear the old cached files + (when (file-exists-p (doc-view-current-cache-dir)) + (dired-delete-file (doc-view-current-cache-dir) 'always)) + (doc-view-kill-proc-and-buffer) + (find-file doc))) -It'a a subdirectory of `doc-view-cache-directory'." +(defun doc-view-current-cache-dir () + "Return the directory where the png files of the current doc should be saved. +It's a subdirectory of `doc-view-cache-directory'." (if doc-view-current-cache-dir doc-view-current-cache-dir - (file-name-as-directory - (concat (file-name-as-directory doc-view-cache-directory) - (with-temp-buffer - (insert-file-contents-literally file) - (md5 (current-buffer))))))) + (setq doc-view-current-cache-dir + (file-name-as-directory + (concat (file-name-as-directory doc-view-cache-directory) + (let ((doc doc-view-current-doc)) + (with-temp-buffer + (insert-file-contents-literally doc) + (md5 (current-buffer))))))))) (defun doc-view-dvi->pdf-sentinel (proc event) "If DVI->PDF conversion was successful, convert the PDF to PNG now." (if (not (string-match "finished" event)) (message "DocView: dvi->pdf process changed status to %s." event) (set-buffer (process-get proc 'buffer)) - (setq doc-view-current-converter-process nil) + (setq doc-view-current-converter-process nil + mode-line-process nil) (message "DocView: finished conversion from DVI to PDF!") ;; Now go on converting this PDF to a set of PNG files. (let* ((pdf (process-get proc 'pdf-file)) - (png (concat (doc-view-file-name-to-directory-name - doc-view-current-doc) + (png (concat (doc-view-current-cache-dir) "page-%d.png"))) (doc-view-pdf/ps->png pdf png)))) @@ -361,9 +400,10 @@ It'a a subdirectory of `doc-view-cache-directory'." "Convert DVI to PDF asynchrounously." (message "DocView: converting DVI to PDF now!") (setq doc-view-current-converter-process - (start-process "doc-view-dvi->pdf" doc-view-conversion-buffer + (start-process "dvi->pdf" doc-view-conversion-buffer doc-view-dvipdfm-program - "-o" pdf dvi)) + "-o" pdf dvi) + mode-line-process (list (format ":%s" doc-view-current-converter-process))) (set-process-sentinel doc-view-current-converter-process 'doc-view-dvi->pdf-sentinel) (process-put doc-view-current-converter-process 'buffer (current-buffer)) @@ -374,7 +414,8 @@ It'a a subdirectory of `doc-view-cache-directory'." (if (not (string-match "finished" event)) (message "DocView: converter process changed status to %s." event) (set-buffer (process-get proc 'buffer)) - (setq doc-view-current-converter-process nil) + (setq doc-view-current-converter-process nil + mode-line-process nil) (when doc-view-current-timer (cancel-timer doc-view-current-timer) (setq doc-view-current-timer nil)) @@ -387,11 +428,12 @@ It'a a subdirectory of `doc-view-cache-directory'." (message "DocView: converting PDF or PS to PNG now!") (setq doc-view-current-converter-process (apply 'start-process - (append (list "doc-view-pdf/ps->png" doc-view-conversion-buffer + (append (list "pdf/ps->png" doc-view-conversion-buffer doc-view-ghostscript-program) doc-view-ghostscript-options (list (concat "-sOutputFile=" png)) - (list pdf-ps)))) + (list pdf-ps))) + mode-line-process (list (format ":%s" doc-view-current-converter-process))) (process-put doc-view-current-converter-process 'buffer (current-buffer)) (set-process-sentinel doc-view-current-converter-process @@ -399,7 +441,7 @@ It'a a subdirectory of `doc-view-cache-directory'." (when doc-view-conversion-refresh-interval (setq doc-view-current-timer (run-at-time "1 secs" doc-view-conversion-refresh-interval - 'doc-view-display + 'doc-view-display-maybe doc-view-current-doc)))) (defun doc-view-pdf->txt-sentinel (proc event) @@ -408,7 +450,8 @@ It'a a subdirectory of `doc-view-cache-directory'." (let ((current-buffer (current-buffer)) (proc-buffer (process-get proc 'buffer))) (set-buffer proc-buffer) - (setq doc-view-current-converter-process nil) + (setq doc-view-current-converter-process nil + mode-line-process nil) (message "DocView: finished conversion from PDF to TXT!") ;; If the user looks at the DocView buffer where the conversion was ;; performed, search anew. This time it will be queried for a regexp. @@ -419,9 +462,10 @@ It'a a subdirectory of `doc-view-cache-directory'." "Convert PDF to TXT asynchrounously." (message "DocView: converting PDF to TXT now!") (setq doc-view-current-converter-process - (start-process "doc-view-pdf->txt" doc-view-conversion-buffer + (start-process "pdf->txt" doc-view-conversion-buffer doc-view-pdftotext-program "-raw" - pdf txt)) + pdf txt) + mode-line-process (list (format ":%s" doc-view-current-converter-process))) (set-process-sentinel doc-view-current-converter-process 'doc-view-pdf->txt-sentinel) (process-put doc-view-current-converter-process 'buffer (current-buffer))) @@ -430,65 +474,44 @@ It'a a subdirectory of `doc-view-cache-directory'." (if (not (string-match "finished" event)) (message "DocView: converter process changed status to %s." event) (set-buffer (process-get proc 'buffer)) - (setq doc-view-current-converter-process nil) + (setq doc-view-current-converter-process nil + mode-line-process nil) (message "DocView: finished conversion from PS to PDF!") ;; Now we can transform to plain text. (doc-view-pdf->txt (process-get proc 'pdf-file) - (concat (doc-view-file-name-to-directory-name - doc-view-current-doc) + (concat (doc-view-current-cache-dir) "doc.txt")))) (defun doc-view-ps->pdf (ps pdf) "Convert PS to PDF asynchronously." (message "DocView: converting PS to PDF now!") (setq doc-view-current-converter-process - (start-process "doc-view-ps->pdf" doc-view-conversion-buffer + (start-process "ps->pdf" doc-view-conversion-buffer doc-view-ps2pdf-program - ps pdf)) + ps pdf "-dSAFER") + mode-line-process (list (format ":%s" doc-view-current-converter-process))) (set-process-sentinel doc-view-current-converter-process 'doc-view-ps->pdf-sentinel) (process-put doc-view-current-converter-process 'buffer (current-buffer)) (process-put doc-view-current-converter-process 'pdf-file pdf)) -(defun doc-view-convert-doc (doc) - "Convert DOC to a set of png files, one file per page. - -Those files are saved in the directory given by -`doc-view-file-name-to-directory-name'." +(defun doc-view-convert-current-doc () + "Convert `doc-view-current-doc' to a set of png files, one file per page. +Those files are saved in the directory given by the function +`doc-view-current-cache-dir'." (clear-image-cache) - (let* ((dir (doc-view-file-name-to-directory-name doc)) - (png-file (concat (file-name-as-directory dir) "page-%d.png"))) - (when (file-exists-p dir) - (dired-delete-file dir 'always)) - (make-directory dir t) - (if (not (string= (file-name-extension doc) "dvi")) + (let ((png-file (concat (doc-view-current-cache-dir) + "page-%d.png"))) + (make-directory doc-view-current-cache-dir t) + (if (not (string= (file-name-extension doc-view-current-doc) "dvi")) ;; Convert to PNG images. - (doc-view-pdf/ps->png doc png-file) + (doc-view-pdf/ps->png doc-view-current-doc png-file) ;; DVI files have to be converted to PDF before Ghostscript can process ;; it. - (doc-view-dvi->pdf doc - (concat (file-name-as-directory dir) + (doc-view-dvi->pdf doc-view-current-doc + (concat (file-name-as-directory doc-view-current-cache-dir) "doc.pdf"))))) -;;;; DocView Mode - -(define-derived-mode doc-view-mode nil "DocView" - "Major mode in DocView buffers. - -\\{doc-view-mode-map}" - :group 'doc-view - (setq buffer-read-only t) - (make-local-variable 'doc-view-current-files) - (make-local-variable 'doc-view-current-doc) - (make-local-variable 'doc-view-current-image) - (make-local-variable 'doc-view-current-page) - (make-local-variable 'doc-view-current-converter-process) - (make-local-variable 'doc-view-current-timer) - (make-local-variable 'doc-view-current-slice) - (make-local-variable 'doc-view-current-cache-dir) - (make-local-variable 'doc-view-current-info) - (make-local-variable 'doc-view-current-search-matches)) - ;;;; Slicing (defun doc-view-set-slice (x y width height) @@ -556,19 +579,22 @@ Predicate for sorting `doc-view-current-files'." nil (string< a b)))) +(defun doc-view-display-maybe (doc) + "Call `doc-view-display' iff we're in the image display." + (when (eq doc-view-current-display 'image) + (doc-view-display doc))) + (defun doc-view-display (doc) "Start viewing the document DOC." - (let ((dir (doc-view-file-name-to-directory-name doc))) - (set-buffer (format "*DocView: %s*" doc)) - (setq doc-view-current-files - (sort (directory-files dir t "page-[0-9]+\\.png" t) - 'doc-view-sort)) - (when (> (length doc-view-current-files) 0) - (doc-view-goto-page doc-view-current-page)))) + (set-buffer (get-file-buffer doc)) + (setq doc-view-current-files + (sort (directory-files (doc-view-current-cache-dir) t + "page-[0-9]+\\.png" t) + 'doc-view-sort)) + (when (> (length doc-view-current-files) 0) + (doc-view-goto-page doc-view-current-page))) (defun doc-view-buffer-message () - (setq inhibit-read-only t) - (erase-buffer) (insert (propertize "Welcome to DocView!" 'face 'bold) "\n" " @@ -581,12 +607,58 @@ For now these keys are useful: `q' : Bury this buffer. Conversion will go on in background. `k' : Kill the conversion process and this buffer.\n") - (setq inhibit-read-only nil)) + (set-buffer-modified-p nil)) (defun doc-view-show-tooltip () (interactive) (tooltip-show doc-view-current-info)) +;;;;; Toggle between text and image display + +(defun doc-view-toggle-display () + "Start or stop displaying a document file as a set of images. +This command toggles between showing the text of the document +file and showing the document as a set of images." + (interactive) + (if (get-text-property (point-min) 'display) + ;; Switch to text display + (let ((inhibit-read-only t)) + (erase-buffer) + (insert-file-contents doc-view-current-doc) + (use-local-map doc-view-mode-text-map) + (setq mode-name "DocView[text]" + doc-view-current-display 'text) + (if (called-interactively-p) + (message "Repeat this command to go back to displaying the file as images"))) + ;; Switch to image display + (let ((inhibit-read-only t)) + (erase-buffer) + (doc-view-buffer-message) + (setq doc-view-current-page (or doc-view-current-page 1)) + (if (file-exists-p (doc-view-current-cache-dir)) + (progn + (message "DocView: using cached files!") + (doc-view-display doc-view-current-doc)) + (doc-view-convert-current-doc)) + (use-local-map doc-view-mode-map) + (setq mode-name (format "DocView") + doc-view-current-display 'image) + (if (called-interactively-p) + (message "Repeat this command to go back to displaying the file as text")))) + (set-buffer-modified-p nil)) + +;;;;; Leave doc-view-mode and open the file for edit + +(defun doc-view-edit-doc () + "Leave `doc-view-mode' and open the current doc with an appropriate editing mode." + (interactive) + (let ((filename doc-view-current-doc) + (auto-mode-alist (append '(("\\.[eE]?[pP][sS]\\'" . ps-mode) + ("\\.\\(pdf\\|PDF\\|dvi\\|DVI\\)$" . fundamental-mode)) + auto-mode-alist))) + (kill-buffer (current-buffer)) + (find-file filename))) + ;;;; Searching (defun doc-view-search-internal (regexp file) @@ -637,8 +709,7 @@ conversion finished." (interactive) ;; New search, so forget the old results. (setq doc-view-current-search-matches nil) - (let ((txt (concat (doc-view-file-name-to-directory-name - doc-view-current-doc) + (let ((txt (concat (doc-view-current-cache-dir) "doc.txt"))) (if (file-readable-p txt) (progn @@ -661,14 +732,12 @@ conversion finished." ;; Doc is a PS, so convert it to PDF (which will be converted to ;; TXT thereafter). (doc-view-ps->pdf doc-view-current-doc - (concat (doc-view-file-name-to-directory-name - doc-view-current-doc) + (concat (doc-view-current-cache-dir) "doc.pdf"))) ((string= ext "dvi") ;; Doc is a DVI. This means that a doc.pdf already exists in its ;; cache subdirectory. - (doc-view-pdf->txt (concat (doc-view-file-name-to-directory-name - doc-view-current-doc) + (doc-view-pdf->txt (concat (doc-view-current-cache-dir) "doc.pdf") txt)) (t (error "DocView doesn't know what to do")))))))) @@ -699,52 +768,42 @@ conversion finished." (y-or-n-p "No more matches before current page. Wrap to last match? ")) (doc-view-goto-page (caar (last doc-view-current-search-matches))))))) -;;;; User Interface Commands +;;;; User interface commands and the mode + +(put 'doc-view-mode 'mode-class 'special) ;;;###autoload -(defun doc-view (no-cache &optional file) - "Convert FILE to png and start viewing it. -If no FILE is given, query for on. -If this FILE is still in the cache, don't convert and use the -existing page files. With prefix arg NO-CACHE, don't use the -cached files and convert anew." - (interactive "P") - (if (not (and (image-type-available-p 'png) - (display-images-p))) - (message "DocView: your emacs or display doesn't support png images.") - (let* ((doc (or file - (expand-file-name - (let ((completion-ignored-extensions - ;; Don't hide files doc-view can display - (remove-if (lambda (str) - (string-match "\\.\\(ps\\|pdf\\|dvi\\)$" - str)) - completion-ignored-extensions))) - (read-file-name "File: " nil nil t))))) - (buffer (get-buffer-create (format "*DocView: %s*" doc))) - (dir (doc-view-file-name-to-directory-name doc))) - (switch-to-buffer buffer) - (doc-view-buffer-message) - (doc-view-mode) - (setq doc-view-current-doc doc) - (setq doc-view-current-page 1) - (if (not (and (file-exists-p dir) - (not no-cache))) - (progn - (setq doc-view-current-cache-dir nil) - (doc-view-convert-doc doc-view-current-doc)) - (message "DocView: using cached files!") - (doc-view-display doc-view-current-doc))))) - -(defun doc-view-dired (no-cache) - "View the current dired file with doc-view. -NO-CACHE is the same as in `doc-view'. - -You might want to bind this command to a dired key, e.g. - - (define-key dired-mode-map (kbd \"C-c d\") 'doc-view-dired)" - (interactive "P") - (doc-view no-cache (dired-get-file-for-visit))) +(define-derived-mode doc-view-mode nil "DocView" + "Major mode in DocView buffers. +You can use \\\\[doc-view-toggle-display] to +toggle between display as a set of images and display as text." + :group 'doc-view + (make-local-variable 'doc-view-current-files) + (make-local-variable 'doc-view-current-doc) + (make-local-variable 'doc-view-current-image) + (make-local-variable 'doc-view-current-page) + (make-local-variable 'doc-view-current-converter-process) + (make-local-variable 'doc-view-current-timer) + (make-local-variable 'doc-view-current-slice) + (make-local-variable 'doc-view-current-cache-dir) + (make-local-variable 'doc-view-current-info) + (make-local-variable 'doc-view-current-search-matches) + (setq doc-view-current-doc (buffer-file-name)) + (insert-file-contents doc-view-current-doc) + (use-local-map doc-view-mode-text-map) + (setq mode-name "DocView[text]" + doc-view-current-display 'text + buffer-read-only t + revert-buffer-function 'doc-view-reconvert-doc) + ;; Switch to image display if possible + (if (and (display-images-p) + (image-type-available-p 'png) + (not (get-text-property (point-min) 'display))) + (doc-view-toggle-display)) + (message + "%s" + (substitute-command-keys + "Type \\[doc-view-toggle-display] to toggle between image and text display."))) (defun doc-view-clear-cache () "Delete the whole cache (`doc-view-cache-directory')." diff --git a/lisp/files.el b/lisp/files.el index be28dec4c40..3b0b670e21f 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2059,7 +2059,7 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\)\\'" . archive-mode) ("\\.\\(as\\|mi\\|sm\\)2\\'" . snmpv2-mode) ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode) ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MSDOG - ("\\.[eE]?[pP][sS]\\'" . ps-mode) + ("\\(?:DVI\\|EPS\\|P\\(?:DF\\|S\\)\\|dvi\\|eps\\|p\\(?:df\\|s\\)\\)" . doc-view-mode) ("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode) ("BROWSE\\'" . ebrowse-tree-mode) ("\\.ebrowse\\'" . ebrowse-tree-mode) From 9f1bc31f0ae1f386f44a1dad2eb5a8b09d37ef12 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Wed, 17 Oct 2007 22:27:24 +0000 Subject: [PATCH 075/127] display-world-time does not work on Windows. --- etc/PROBLEMS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 72e5a7afa76..76753c38066 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -2198,6 +2198,13 @@ month names with consistent widths for some locales on some versions of Windows. This is caused by a deficiency in the underlying system library function. +The functions set-time-zone-rule, and display-time-world (which uses it) +do not work on Windows. Fixing this is difficult, since Windows uses +localtime for the system clock, and any attempt to change the timezone +would have to be accompanied by a clock change for the results to remain +consistent. The way in which these functions are used is not intended to +cause such system-wide disruption. + Files larger than 4GB cause overflow in the size (represented as a 32-bit integer) reported by `file-attributes'. This affects Dired as well, since the Windows port uses a Lisp emulation of `ls' that relies From b5307e9c2bd6222f9af6a6792ae69f3bb45fdf45 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 17 Oct 2007 23:05:54 +0000 Subject: [PATCH 076/127] (feature-symbols, file-provides, file-requires, file-set-intersect, file-dependents): Simplify. (unload-feature-special-hooks): Update list of special hooks. --- lisp/ChangeLog | 8 ++++++- lisp/loadhist.el | 61 ++++++++++++++++++++++-------------------------- 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d6b0dd86cac..9e7dd58d79d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-10-17 Juanma Barranquero + + * loadhist.el (feature-symbols, file-provides, file-requires) + (file-set-intersect, file-dependents): Simplify. + (unload-feature-special-hooks): Update list of special hooks. + 2007-10-17 Tassilo Horn * bindings.el (completion-ignored-extensions): Remove pdf and dvi @@ -11,7 +17,7 @@ text and image display. Add binding C-c C-e to switch to an editing mode. (doc-view-ghostscript-options, doc-view-ps->pdf): Add "-dSAFER" to - avoid security problems when rendering files untrusted sources. + avoid security problems when rendering files from untrusted sources. 2007-10-17 Aaron Hawley diff --git a/lisp/loadhist.el b/lisp/loadhist.el index 4e9ee480d65..95de0d822a3 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el @@ -38,12 +38,11 @@ "Return the file and list of definitions associated with FEATURE. The value is actually the element of `load-history' for the file that did (provide FEATURE)." - (catch 'foundit - (mapc (lambda (x) - (if (member (cons 'provide feature) (cdr x)) - (throw 'foundit x))) - load-history) - nil)) + (catch 'foundit + (let ((element (cons 'provide feature))) + (dolist (x load-history nil) + (when (member element (cdr x)) + (throw 'foundit x)))))) (defun feature-file (feature) "Return the file name from which a given FEATURE was loaded. @@ -72,32 +71,25 @@ A library name is equivalent to the file name that `load-library' would load." "Return the list of features provided by FILE as it was loaded. FILE can be a file name, or a library name. A library name is equivalent to the file name that `load-library' would load." - (let ((symbols (file-loadhist-lookup file)) - provides) - (mapc (lambda (x) - (if (and (consp x) (eq (car x) 'provide)) - (setq provides (cons (cdr x) provides)))) - symbols) - provides)) + (let (provides) + (dolist (x (file-loadhist-lookup file) provides) + (when (eq (car-safe x) 'provide) + (push x provides))))) (defun file-requires (file) "Return the list of features required by FILE as it was loaded. FILE can be a file name, or a library name. A library name is equivalent to the file name that `load-library' would load." - (let ((symbols (file-loadhist-lookup file)) - requires) - (mapc (lambda (x) - (if (and (consp x) (eq (car x) 'require)) - (setq requires (cons (cdr x) requires)))) - symbols) - requires)) + (let (requires) + (dolist (x (file-loadhist-lookup file) requires) + (when (eq (car-safe x) 'require) + (push x requires))))) (defsubst file-set-intersect (p q) "Return the set intersection of two lists." - (let ((ret nil)) + (let (ret) (dolist (x p ret) - (if (memq x q) (setq ret (cons x ret)))) - ret)) + (when (memq x q) (push x ret))))) (defun file-dependents (file) "Return the list of loaded libraries that depend on FILE. @@ -107,9 +99,8 @@ A library name is equivalent to the file name that `load-library' would load." (let ((provides (file-provides file)) (dependents nil)) (dolist (x load-history dependents) - (if (file-set-intersect provides (file-requires (car x))) - (setq dependents (cons (car x) dependents)))) - dependents)) + (when (file-set-intersect provides (file-requires (car x))) + (push (car x) dependents))))) (defun read-feature (prompt &optional loaded-p) "Read feature name from the minibuffer, prompting with string PROMPT. @@ -126,15 +117,19 @@ from a file." (defvaralias 'loadhist-hook-functions 'unload-feature-special-hooks) (defvar unload-feature-special-hooks - '(after-change-functions - after-insert-file-functions auto-fill-function - before-change-functions blink-paren-function - buffer-access-fontify-functions command-line-functions - comment-indent-function kill-buffer-query-functions - kill-emacs-query-functions lisp-indent-function - mouse-position-function + '(after-change-functions after-insert-file-functions + after-make-frame-functions auto-fill-function before-change-functions + blink-paren-function buffer-access-fontify-functions command-line-functions + comment-indent-function compilation-finish-functions + disabled-command-function find-file-not-found-functions + font-lock-beginning-of-syntax-function font-lock-fontify-buffer-function + font-lock-fontify-region-function font-lock-mark-block-function + font-lock-syntactic-face-function font-lock-unfontify-buffer-function + font-lock-unfontify-region-function kill-buffer-query-functions + kill-emacs-query-functions lisp-indent-function mouse-position-function redisplay-end-trigger-functions temp-buffer-show-function window-scroll-functions window-size-change-functions + write-contents-functions write-file-functions write-region-annotate-functions) "A list of special hooks from Info node `(elisp)Standard Hooks'. From 3f8f71448069af3788742afd51f2e5f19a748e0e Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Wed, 17 Oct 2007 23:14:15 +0000 Subject: [PATCH 077/127] Include COPYING in top level directory of all distributed archives. --- admin/nt/makedist.bat | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/nt/makedist.bat b/admin/nt/makedist.bat index 5afef00e9b3..db9446db36e 100755 --- a/admin/nt/makedist.bat +++ b/admin/nt/makedist.bat @@ -35,8 +35,8 @@ copy %3\README.W32 emacs-%1\README.W32 rem Info-ZIP zip seems to be broken on Windows. rem It always writes to zip.zip and treats the zipfile argument as one rem of the files to go in it. -rem zip -9 -r %2-bin-i386 emacs-%1/BUGS emacs-%1/README emacs-%1/README.W32 emacs-%1/INSTALL emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp emacs-%1/leim -x emacs.mdp *.pdb *.opt *~ CVS -7z a -tZIP -mx=9 -xr!emacs.mdp -xr!*.pdb -xr!*.opt -xr!*~ -xr!CVS -xr!.arch-inventory %2-bin-i386.zip emacs-%1/BUGS emacs-%1/README emacs-%1/README.W32 emacs-%1/INSTALL emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp emacs-%1/leim emacs-%1/site-lisp +rem zip -9 -r %2-bin-i386 emacs-%1/BUGS emacs-%1/COPYING emacs-%1/README emacs-%1/README.W32 emacs-%1/INSTALL emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp emacs-%1/leim -x emacs.mdp *.pdb *.opt *~ CVS +7z a -tZIP -mx=9 -xr!emacs.mdp -xr!*.pdb -xr!*.opt -xr!*~ -xr!CVS -xr!.arch-inventory %2-bin-i386.zip emacs-%1/BUGS emacs-%1/COPYING emacs-%1/README emacs-%1/README.W32 emacs-%1/INSTALL emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp emacs-%1/leim emacs-%1/site-lisp del emacs-%1\README.W32 if not (%4) == () goto end @@ -49,8 +49,8 @@ copy %3\dump.bat emacs-%1\bin\dump.bat rem Info-ZIP zip seems to be broken on Windows. rem It always writes to zip.zip and treats the zipfile argument as one rem of the files to go in it. -rem zip -9 -r %2-barebin-i386.zip emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc/DOC-X -7z a -tZIP -mx=9 %2-barebin-i386.zip emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc/DOC-X +rem zip -9 -r %2-barebin-i386.zip emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc/DOC-X emacs-%1/COPYING +7z a -tZIP -mx=9 %2-barebin-i386.zip emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc/DOC-X emacs-%1/COPYING del emacs-%1\README.W32 if not (%4) == () goto end From 99784d6399c1f49ca5d98a3156a7c3262b5e7ee9 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 17 Oct 2007 23:43:52 +0000 Subject: [PATCH 078/127] * xselect.c (x_own_selection, x_handle_selection_clear) (x_clear_frame_selections): * w32menu.c (list_of_panes, list_of_items): * w32fns.c (w32_color_map_lookup, Fx_create_frame, Fx_display_list): * textprop.c (validate_plist, interval_has_all_properties) (interval_has_some_properties, interval_has_some_properties_list) (add_properties, text_property_list): * process.c (Fget_buffer_process, list_processes_1, status_notify): * minibuf.c (Fassoc_string): * macselect.c (x_own_selection, x_clear_frame_selections) (Fx_disown_selection_internal): * keymap.c (Fcommand_remapping, where_is_internal, describe_map_tree): Use CONSP rather than !NILP and XC[AD]R rather than Fc[ad]r. --- src/ChangeLog | 16 ++++++++++++++++ src/keymap.c | 18 +++++++++--------- src/macselect.c | 6 +++--- src/minibuf.c | 4 ++-- src/process.c | 16 ++++++++-------- src/textprop.c | 44 ++++++++++++++++++++++---------------------- src/w32fns.c | 8 ++++---- src/w32menu.c | 8 ++++---- src/xselect.c | 6 +++--- 9 files changed, 71 insertions(+), 55 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 98bf9978907..dcd9f0955dd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,19 @@ +2007-10-17 Stefan Monnier + + * xselect.c (x_own_selection, x_handle_selection_clear) + (x_clear_frame_selections): + * w32menu.c (list_of_panes, list_of_items): + * w32fns.c (w32_color_map_lookup, Fx_create_frame, Fx_display_list): + * textprop.c (validate_plist, interval_has_all_properties) + (interval_has_some_properties, interval_has_some_properties_list) + (add_properties, text_property_list): + * process.c (Fget_buffer_process, list_processes_1, status_notify): + * minibuf.c (Fassoc_string): + * macselect.c (x_own_selection, x_clear_frame_selections) + (Fx_disown_selection_internal): + * keymap.c (Fcommand_remapping, where_is_internal, describe_map_tree): + Use CONSP rather than !NILP and XC[AD]R rather than Fc[ad]r. + 2007-10-17 Chong Yidong * process.c: Link to libs for calling res_init() if available. diff --git a/src/keymap.c b/src/keymap.c index be23c20a3aa..2edad90b732 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1247,9 +1247,9 @@ remapping in all currently active keymaps. */) { Lisp_Object maps, binding; - for (maps = keymaps; !NILP (maps); maps = Fcdr (maps)) + for (maps = keymaps; CONSP (maps); maps = XCDR (maps)) { - binding = Flookup_key (Fcar (maps), command_remapping_vector, Qnil); + binding = Flookup_key (XCAR (maps), command_remapping_vector, Qnil); if (!NILP (binding) && !INTEGERP (binding)) return binding; } @@ -2681,7 +2681,7 @@ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap) && !NILP (Fcommand_remapping (definition, Qnil, keymaps))) RETURN_UNGCPRO (Qnil); - for (; !NILP (maps); maps = Fcdr (maps)) + for (; CONSP (maps); maps = XCDR (maps)) { /* Key sequence to reach map, and the map that it reaches */ register Lisp_Object this, map, tem; @@ -2693,8 +2693,8 @@ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap) Lisp_Object last; int last_is_meta; - this = Fcar (Fcar (maps)); - map = Fcdr (Fcar (maps)); + this = Fcar (XCAR (maps)); + map = Fcdr (XCAR (maps)); last = make_number (XINT (Flength (this)) - 1); last_is_meta = (XINT (last) >= 0 && EQ (Faref (this, last), meta_prefix_char)); @@ -3179,11 +3179,11 @@ key binding\n\ Lisp_Object list; /* Delete from MAPS each element that is for the menu bar. */ - for (list = maps; !NILP (list); list = XCDR (list)) + for (list = maps; CONSP (list); list = XCDR (list)) { Lisp_Object elt, prefix, tem; - elt = Fcar (list); + elt = XCAR (list); prefix = Fcar (elt); if (XVECTOR (prefix)->size >= 1) { @@ -3210,11 +3210,11 @@ key binding\n\ something = 1; } - for (; !NILP (maps); maps = Fcdr (maps)) + for (; CONSP (maps); maps = XCDR (maps)) { register Lisp_Object elt, prefix, tail; - elt = Fcar (maps); + elt = XCAR (maps); prefix = Fcar (elt); sub_shadows = Qnil; diff --git a/src/macselect.c b/src/macselect.c index 9515a5774ec..f8038effd8b 100644 --- a/src/macselect.c +++ b/src/macselect.c @@ -487,7 +487,7 @@ x_own_selection (selection_name, selection_value) if (!NILP (prev_value)) { Lisp_Object rest; /* we know it's not the CAR, so it's easy. */ - for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) + for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest)) if (EQ (prev_value, Fcar (XCDR (rest)))) { XSETCDR (rest, Fcdr (XCDR (rest))); @@ -619,7 +619,7 @@ x_clear_frame_selections (f) } /* Delete elements after the beginning of Vselection_alist. */ - for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) + for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest)) if (EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (XCDR (rest)))))))) { /* Let random Lisp code notice that the selection has been stolen. */ @@ -762,7 +762,7 @@ Disowning it means there is no such selection. */) else { Lisp_Object rest; - for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) + for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest)) if (EQ (local_selection_data, Fcar (XCDR (rest)))) { XSETCDR (rest, Fcdr (XCDR (rest))); diff --git a/src/minibuf.c b/src/minibuf.c index e7c2aec7b3f..d3c9eb505b6 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -2110,10 +2110,10 @@ string rather than a cons cell whose car is a string. */) if (SYMBOLP (key)) key = Fsymbol_name (key); - for (tail = list; !NILP (tail); tail = Fcdr (tail)) + for (tail = list; CONSP (tail); tail = XCDR (tail)) { register Lisp_Object elt, tem, thiscar; - elt = Fcar (tail); + elt = XCAR (tail); thiscar = CONSP (elt) ? XCAR (elt) : elt; if (SYMBOLP (thiscar)) thiscar = Fsymbol_name (thiscar); diff --git a/src/process.c b/src/process.c index 6749ebda117..37181158a19 100644 --- a/src/process.c +++ b/src/process.c @@ -739,9 +739,9 @@ BUFFER may be a buffer or the name of one. */) buf = Fget_buffer (buffer); if (NILP (buf)) return Qnil; - for (tail = Vprocess_alist; !NILP (tail); tail = Fcdr (tail)) + for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail)) { - proc = Fcdr (Fcar (tail)); + proc = Fcdr (XCAR (tail)); if (PROCESSP (proc) && EQ (XPROCESS (proc)->buffer, buf)) return proc; } @@ -1345,11 +1345,11 @@ list_processes_1 (query_only) w_buffer = 6; /* Buffer */ w_tty = 0; /* Omit if no ttys */ - for (tail = Vprocess_alist; !NILP (tail); tail = Fcdr (tail)) + for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail)) { int i; - proc = Fcdr (Fcar (tail)); + proc = Fcdr (XCAR (tail)); p = XPROCESS (proc); if (NILP (p->childp)) continue; @@ -1408,11 +1408,11 @@ list_processes_1 (query_only) Findent_to (i_command, minspace); write_string ("-------", -1); write_string ("\n", -1); - for (tail = Vprocess_alist; !NILP (tail); tail = Fcdr (tail)) + for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail)) { Lisp_Object symbol; - proc = Fcdr (Fcar (tail)); + proc = Fcdr (XCAR (tail)); p = XPROCESS (proc); if (NILP (p->childp)) continue; @@ -6799,12 +6799,12 @@ status_notify (deleting_process) that we run, we get called again to handle their status changes. */ update_tick = process_tick; - for (tail = Vprocess_alist; !NILP (tail); tail = Fcdr (tail)) + for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail)) { Lisp_Object symbol; register struct Lisp_Process *p; - proc = Fcdr (Fcar (tail)); + proc = Fcdr (XCAR (tail)); p = XPROCESS (proc); if (p->tick != p->update_tick) diff --git a/src/textprop.c b/src/textprop.c index 8ce5656e5a2..e8ba1d87afc 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -201,9 +201,9 @@ validate_plist (list) { register int i; register Lisp_Object tail; - for (i = 0, tail = list; !NILP (tail); i++) + for (i = 0, tail = list; CONSP (tail); i++) { - tail = Fcdr (tail); + tail = XCDR (tail); QUIT; } if (i & 1) @@ -226,18 +226,18 @@ interval_has_all_properties (plist, i) register int found; /* Go through each element of PLIST. */ - for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1))) + for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1))) { - sym1 = Fcar (tail1); + sym1 = XCAR (tail1); found = 0; /* Go through I's plist, looking for sym1 */ - for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2))) - if (EQ (sym1, Fcar (tail2))) + for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2))) + if (EQ (sym1, XCAR (tail2))) { /* Found the same property on both lists. If the values are unequal, return zero. */ - if (! EQ (Fcar (Fcdr (tail1)), Fcar (Fcdr (tail2)))) + if (! EQ (Fcar (XCDR (tail1)), Fcar (XCDR (tail2)))) return 0; /* Property has same value on both lists; go to next one. */ @@ -263,13 +263,13 @@ interval_has_some_properties (plist, i) register Lisp_Object tail1, tail2, sym; /* Go through each element of PLIST. */ - for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1))) + for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1))) { - sym = Fcar (tail1); + sym = XCAR (tail1); /* Go through i's plist, looking for tail1 */ - for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2))) - if (EQ (sym, Fcar (tail2))) + for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2))) + if (EQ (sym, XCAR (tail2))) return 1; } @@ -287,12 +287,12 @@ interval_has_some_properties_list (list, i) register Lisp_Object tail1, tail2, sym; /* Go through each element of LIST. */ - for (tail1 = list; ! NILP (tail1); tail1 = XCDR (tail1)) + for (tail1 = list; CONSP (tail1); tail1 = XCDR (tail1)) { sym = Fcar (tail1); /* Go through i's plist, looking for tail1 */ - for (tail2 = i->plist; ! NILP (tail2); tail2 = XCDR (XCDR (tail2))) + for (tail2 = i->plist; CONSP (tail2); tail2 = XCDR (XCDR (tail2))) if (EQ (sym, XCAR (tail2))) return 1; } @@ -391,21 +391,21 @@ add_properties (plist, i, object) GCPRO3 (tail1, sym1, val1); /* Go through each element of PLIST. */ - for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1))) + for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1))) { - sym1 = Fcar (tail1); - val1 = Fcar (Fcdr (tail1)); + sym1 = XCAR (tail1); + val1 = Fcar (XCDR (tail1)); found = 0; /* Go through I's plist, looking for sym1 */ - for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2))) - if (EQ (sym1, Fcar (tail2))) + for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2))) + if (EQ (sym1, XCAR (tail2))) { /* No need to gcpro, because tail2 protects this and it must be a cons cell (we get an error otherwise). */ register Lisp_Object this_cdr; - this_cdr = Fcdr (tail2); + this_cdr = XCDR (tail2); /* Found the property. Now check its value. */ found = 1; @@ -1965,10 +1965,10 @@ text_property_list (object, start, end, prop) plist = i->plist; if (!NILP (prop)) - for (; !NILP (plist); plist = Fcdr (Fcdr (plist))) - if (EQ (Fcar (plist), prop)) + for (; CONSP (plist); plist = Fcdr (XCDR (plist))) + if (EQ (XCAR (plist), prop)) { - plist = Fcons (prop, Fcons (Fcar (Fcdr (plist)), Qnil)); + plist = Fcons (prop, Fcons (Fcar (XCDR (plist)), Qnil)); break; } diff --git a/src/w32fns.c b/src/w32fns.c index 8af99a2d0b9..41a1994f3fe 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -845,11 +845,11 @@ w32_color_map_lookup (colorname) BLOCK_INPUT; - for (tail = Vw32_color_map; !NILP (tail); tail = Fcdr (tail)) + for (tail = Vw32_color_map; CONSP (tail); tail = XCDR (tail)) { register Lisp_Object elt, tem; - elt = Fcar (tail); + elt = XCAR (tail); if (!CONSP (elt)) continue; tem = Fcar (elt); @@ -4450,7 +4450,7 @@ This function is an internal primitive--use `make-frame' instead. */) /* All remaining specified parameters, which have not been "used" by x_get_arg and friends, now go in the misc. alist of the frame. */ - for (tem = parameters; !NILP (tem); tem = XCDR (tem)) + for (tem = parameters; CONSP (tem); tem = XCDR (tem)) if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) f->param_alist = Fcons (XCAR (tem), f->param_alist); @@ -6838,7 +6838,7 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0, Lisp_Object tail, result; result = Qnil; - for (tail = w32_display_name_list; ! NILP (tail); tail = XCDR (tail)) + for (tail = w32_display_name_list; CONSP (tail); tail = XCDR (tail)) result = Fcons (XCAR (XCAR (tail)), result); return result; diff --git a/src/w32menu.c b/src/w32menu.c index a94be08902d..a0ce8c655cb 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -567,10 +567,10 @@ list_of_panes (menu) init_menu_items (); - for (tail = menu; !NILP (tail); tail = Fcdr (tail)) + for (tail = menu; CONSP (tail); tail = XCDR (tail)) { Lisp_Object elt, pane_name, pane_data; - elt = Fcar (tail); + elt = XCAR (tail); pane_name = Fcar (elt); CHECK_STRING (pane_name); push_menu_pane (pane_name, Qnil); @@ -590,9 +590,9 @@ list_of_items (pane) { Lisp_Object tail, item, item1; - for (tail = pane; !NILP (tail); tail = Fcdr (tail)) + for (tail = pane; CONSP (tail); tail = XCDR (tail)) { - item = Fcar (tail); + item = XCAR (tail); if (STRINGP (item)) push_menu_item (item, Qnil, Qnil, Qt, Qnil, Qnil, Qnil, Qnil); else if (NILP (item)) diff --git a/src/xselect.c b/src/xselect.c index d71ac42aa7c..0db5ef57767 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -442,7 +442,7 @@ x_own_selection (selection_name, selection_value) if (!NILP (prev_value)) { Lisp_Object rest; /* we know it's not the CAR, so it's easy. */ - for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) + for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest)) if (EQ (prev_value, Fcar (XCDR (rest)))) { XSETCDR (rest, Fcdr (XCDR (rest))); @@ -1072,7 +1072,7 @@ x_handle_selection_clear (event) else { Lisp_Object rest; - for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) + for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest)) if (EQ (local_selection_data, Fcar (XCDR (rest)))) { XSETCDR (rest, Fcdr (XCDR (rest))); @@ -1153,7 +1153,7 @@ x_clear_frame_selections (f) } /* Delete elements after the beginning of Vselection_alist. */ - for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) + for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest)) if (EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (XCDR (rest)))))))) { /* Let random Lisp code notice that the selection has been stolen. */ From 77f698ef0912f19c2baa68423dae7bfe4719b123 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 17 Oct 2007 23:49:26 +0000 Subject: [PATCH 079/127] Don't require loadhist. --- lisp/ChangeLog | 2 ++ lisp/emacs-lisp/find-func.el | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9e7dd58d79d..d6132f665aa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2007-10-17 Juanma Barranquero + * emacs-lisp/find-func.el: Don't require loadhist. + * loadhist.el (feature-symbols, file-provides, file-requires) (file-set-intersect, file-dependents): Simplify. (unload-feature-special-hooks): Update list of special hooks. diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 6a259ffd4f7..20b91b10547 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -46,8 +46,6 @@ ;;; Code: -(require 'loadhist) - ;;; User variables: (defgroup find-function nil From b2d35abb427ccf9c0b826039c18db8e71419f4c8 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 18 Oct 2007 00:06:33 +0000 Subject: [PATCH 080/127] (fill-paragraph-or-region): Remove function at the request of RMS. (fill-paragraph): Change `arg' to optional `justify'. Add interactive arg `region'. Fix docstring. At the first `or' branch add call to `fill-region' if it the region is active in transient-mark-mode. --- lisp/textmodes/fill.el | 137 ++++++++++++++++++++--------------------- 1 file changed, 67 insertions(+), 70 deletions(-) diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 2671680542a..cf52793f7b5 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -752,10 +752,10 @@ space does not end a sentence, so don't break a line there." (narrow-to-region (minibuffer-prompt-end) (point-max)) (fill-paragraph arg))) -(defun fill-paragraph (arg) +(defun fill-paragraph (&optional justify region) "Fill paragraph at or after point. -If ARG is non-nil (interactively, with prefix argument), justify as well. +If JUSTIFY is non-nil (interactively, with prefix argument), justify as well. If `sentence-end-double-space' is non-nil, then period followed by one space does not end a sentence, so don't break a line there. the variable `fill-column' controls the width for filling. @@ -763,64 +763,73 @@ the variable `fill-column' controls the width for filling. If `fill-paragraph-function' is non-nil, we call it (passing our argument to it), and if it returns non-nil, we simply return its value. -If `fill-paragraph-function' is nil, return the `fill-prefix' used for filling." +If `fill-paragraph-function' is nil, return the `fill-prefix' used for filling. + +Interactively (when `region' is non-nil) in Transient Mark mode when +the mark is active, call `fill-region' to fill each of the paragraphs +in the active region." (interactive (progn (barf-if-buffer-read-only) - (list (if current-prefix-arg 'full)))) - ;; First try fill-paragraph-function. - (or (and (not (eq fill-paragraph-function t)) - (or fill-paragraph-function - (and (minibufferp (current-buffer)) - (= 1 (point-min)))) - (let ((function (or fill-paragraph-function - ;; In the minibuffer, don't count the width - ;; of the prompt. - 'fill-minibuffer-function)) - ;; If fill-paragraph-function is set, it probably takes care - ;; of comments and stuff. If not, it will have to set - ;; fill-paragraph-handle-comment back to t explicitly or - ;; return nil. - (fill-paragraph-handle-comment nil) - (fill-paragraph-function t)) - (funcall function arg))) - ;; Then try our syntax-aware filling code. - (and fill-paragraph-handle-comment - ;; Our code only handles \n-terminated comments right now. - comment-start (equal comment-end "") - (let ((fill-paragraph-handle-comment nil)) - (fill-comment-paragraph arg))) - ;; If it all fails, default to the good ol' text paragraph filling. - (let ((before (point)) - (paragraph-start paragraph-start) - ;; Fill prefix used for filling the paragraph. - fill-pfx) - ;; Try to prevent code sections and comment sections from being - ;; filled together. - (when (and fill-paragraph-handle-comment comment-start-skip) - (setq paragraph-start - (concat paragraph-start "\\|[ \t]*\\(?:" - comment-start-skip "\\)"))) - (save-excursion - ;; To make sure the return value of forward-paragraph is meaningful, - ;; we have to start from the beginning of line, otherwise skipping - ;; past the last few chars of a paragraph-separator would count as - ;; a paragraph (and not skipping any chars at EOB would not count - ;; as a paragraph even if it is). - (move-to-left-margin) - (if (not (zerop (forward-paragraph))) - ;; There's no paragraph at or after point: give up. - (setq fill-pfx "") - (let ((end (point)) - (beg (progn (backward-paragraph) (point)))) - (goto-char before) - (setq fill-pfx - (if use-hard-newlines - ;; Can't use fill-region-as-paragraph, since this - ;; paragraph may still contain hard newlines. See - ;; fill-region. - (fill-region beg end arg) - (fill-region-as-paragraph beg end arg)))))) - fill-pfx))) + (list (if current-prefix-arg 'full) t))) + (or + ;; 1. Fill the region if it is active when called interactively. + (and region transient-mark-mode mark-active + (not (eq (region-beginning) (region-end))) + (fill-region (region-beginning) (region-end) justify)) + ;; 2. Try fill-paragraph-function. + (and (not (eq fill-paragraph-function t)) + (or fill-paragraph-function + (and (minibufferp (current-buffer)) + (= 1 (point-min)))) + (let ((function (or fill-paragraph-function + ;; In the minibuffer, don't count the width + ;; of the prompt. + 'fill-minibuffer-function)) + ;; If fill-paragraph-function is set, it probably takes care + ;; of comments and stuff. If not, it will have to set + ;; fill-paragraph-handle-comment back to t explicitly or + ;; return nil. + (fill-paragraph-handle-comment nil) + (fill-paragraph-function t)) + (funcall function justify))) + ;; 3. Try our syntax-aware filling code. + (and fill-paragraph-handle-comment + ;; Our code only handles \n-terminated comments right now. + comment-start (equal comment-end "") + (let ((fill-paragraph-handle-comment nil)) + (fill-comment-paragraph justify))) + ;; 4. If it all fails, default to the good ol' text paragraph filling. + (let ((before (point)) + (paragraph-start paragraph-start) + ;; Fill prefix used for filling the paragraph. + fill-pfx) + ;; Try to prevent code sections and comment sections from being + ;; filled together. + (when (and fill-paragraph-handle-comment comment-start-skip) + (setq paragraph-start + (concat paragraph-start "\\|[ \t]*\\(?:" + comment-start-skip "\\)"))) + (save-excursion + ;; To make sure the return value of forward-paragraph is meaningful, + ;; we have to start from the beginning of line, otherwise skipping + ;; past the last few chars of a paragraph-separator would count as + ;; a paragraph (and not skipping any chars at EOB would not count + ;; as a paragraph even if it is). + (move-to-left-margin) + (if (not (zerop (forward-paragraph))) + ;; There's no paragraph at or after point: give up. + (setq fill-pfx "") + (let ((end (point)) + (beg (progn (backward-paragraph) (point)))) + (goto-char before) + (setq fill-pfx + (if use-hard-newlines + ;; Can't use fill-region-as-paragraph, since this + ;; paragraph may still contain hard newlines. See + ;; fill-region. + (fill-region beg end justify) + (fill-region-as-paragraph beg end justify)))))) + fill-pfx))) (defun fill-comment-paragraph (&optional justify) "Fill current comment. @@ -1007,18 +1016,6 @@ space does not end a sentence, so don't break a line there." (goto-char end)))) fill-pfx)) -(defun fill-paragraph-or-region (arg) - "Fill the active region or current paragraph. -In Transient Mark mode, when the mark is active, it calls `fill-region' -on the active region. Otherwise, it calls `fill-paragraph'." - (interactive (progn - (barf-if-buffer-read-only) - (list (if current-prefix-arg 'full)))) - (if (and transient-mark-mode mark-active - (not (eq (region-beginning) (region-end)))) - (fill-region (region-beginning) (region-end) arg) - (fill-paragraph arg))) - (defcustom default-justification 'left "*Method of justifying text not otherwise specified. From 792eb7196d01d6a65839437a31c110c849dc794a Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 18 Oct 2007 00:07:04 +0000 Subject: [PATCH 081/127] (esc-map): Bind M-q to fill-paragraph instead of fill-paragraph-or-region. --- lisp/bindings.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/bindings.el b/lisp/bindings.el index 5080eb8c3b0..2ca7c8afea8 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -1041,7 +1041,7 @@ language you are using." (define-key ctl-x-map "rw" 'window-configuration-to-register) (define-key ctl-x-map "rf" 'frame-configuration-to-register) -(define-key esc-map "q" 'fill-paragraph-or-region) +(define-key esc-map "q" 'fill-paragraph) (define-key ctl-x-map "." 'set-fill-prefix) (define-key esc-map "{" 'backward-paragraph) From 09e8c671a4967a23e8805170159db4fc77117edd Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 18 Oct 2007 00:07:24 +0000 Subject: [PATCH 082/127] (tutorial--default-keys): Replace fill-paragraph-or-region with fill-paragraph. --- lisp/tutorial.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/tutorial.el b/lisp/tutorial.el index 4913da63f5c..336593891ab 100644 --- a/lisp/tutorial.el +++ b/lisp/tutorial.el @@ -291,7 +291,7 @@ LEFT and RIGHT are the elements to compare." ;; * MODE LINE (describe-mode [?\C-h ?m]) (set-fill-column [?\C-x ?f]) - (fill-paragraph-or-region [?\M-q]) + (fill-paragraph [?\M-q]) ;; * SEARCHING (isearch-forward [?\C-s]) From 69f5930ae5ef109229ca5702b43abd646faf7f37 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 18 Oct 2007 00:07:48 +0000 Subject: [PATCH 083/127] (ispell-word): Add interactive arg `region'. Fix docstring. --- lisp/textmodes/ispell.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 0e6605dc131..fbeeffaee02 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1566,7 +1566,7 @@ This allows it to improve the suggestion list based on actual mispellings." (translate-region pos (point) translation-table-for-input)))) ;;;###autoload -(defun ispell-word (&optional following quietly continue) +(defun ispell-word (&optional following quietly continue region) "Check spelling of word under or before the cursor. If the word is not found in dictionary, display possible corrections in a window allowing you to choose one. @@ -1580,6 +1580,9 @@ when called interactively, non-corrective messages are suppressed. With a prefix argument (or if CONTINUE is non-nil), resume interrupted spell-checking of a buffer or region. +Interactively, in Transient Mark mode when the mark is active, call +`ispell-region' to check the active region for spelling errors. + Word syntax is controlled by the definition of the chosen dictionary, which is in `ispell-local-dictionary-alist' or `ispell-dictionary-alist'. @@ -1592,10 +1595,9 @@ nil word is correct or spelling is accepted. \"word\" word corrected from word list. \(\"word\" arg\) word is hand entered. quit spell session exited." - - (interactive (list ispell-following-word ispell-quietly current-prefix-arg)) + (interactive (list ispell-following-word ispell-quietly current-prefix-arg t)) (cond - ((and transient-mark-mode mark-active + ((and region transient-mark-mode mark-active (not (eq (region-beginning) (region-end)))) (ispell-region (region-beginning) (region-end))) (continue (ispell-continue)) From bc3214eda6c4c4e9fb64fd75a4d492f500367490 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 18 Oct 2007 00:08:08 +0000 Subject: [PATCH 084/127] (indent-for-tab-command): Change interactive spec from "P" to "p". (indent-for-tab-command): Add check for interactive arg before indenting the active region. --- lisp/indent.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/indent.el b/lisp/indent.el index db8958bd1ca..77354444cfa 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -86,10 +86,10 @@ If `transient-mark-mode' is turned on the region is active, indent the region. The function actually called to indent the line is determined by the value of `indent-line-function'." - (interactive "P") + (interactive "p") (cond ;; The region is active, indent it. - ((and transient-mark-mode mark-active + ((and arg transient-mark-mode mark-active (not (eq (region-beginning) (region-end)))) (indent-region (region-beginning) (region-end))) ((or ;; indent-to-left-margin is only meant for indenting, From ad6d10b1b21064d015aa13df2480b0f73ae3f1dd Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 18 Oct 2007 00:09:22 +0000 Subject: [PATCH 085/127] (Fill Commands): Undocument fill-paragraph-or-region. fill-paragraph operates on the active region in Transient Mark mode. (Fill Prefix, Format Indentation): Replace fill-paragraph-or-region with fill-paragraph. --- doc/emacs/text.texi | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index 9cfd4ffe922..c151c75e8bb 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -486,11 +486,9 @@ The section on init files says how to arrange this permanently for yourself. @table @kbd @item M-q -Fill current paragraph or active region (@code{fill-paragraph-or-region}). +Fill current paragraph (@code{fill-paragraph}). @item C-x f Set the fill column (@code{set-fill-column}). -@item M-x fill-paragraph -Fill current paragraph (@code{fill-paragraph}). @item M-x fill-region Fill each paragraph in the region (@code{fill-region}). @item M-x fill-region-as-paragraph @@ -499,39 +497,35 @@ Fill the region, considering it as one paragraph. Center a line. @end table +@kindex M-q @findex fill-paragraph - To refill a paragraph, use @kbd{M-x fill-paragraph}. This operates -on the paragraph that point is inside, or the one after point if point -is between paragraphs. Refilling works by removing all the -line-breaks, then inserting new ones where necessary. + To refill a paragraph, use the command @kbd{M-q} +(@code{fill-paragraph}). This operates on the paragraph that point is +inside, or the one after point if point is between paragraphs. +Refilling works by removing all the line-breaks, then inserting new ones +where necessary. When the mark is active in Transient Mark mode, this +command operates on the active region like @code{fill-region}. @findex fill-region To refill many paragraphs, use @kbd{M-x fill-region}, which finds the paragraphs in the region and fills each of them. -@kindex M-q -@findex fill-paragraph-or-region - The command @kbd{M-q} (@code{fill-paragraph-or-region}), operates on -the active region like @code{fill-region} when the mark is active in -Transient Mark mode. Otherwise, it operates on the current paragraph -like @code{fill-paragraph}. - @findex fill-region-as-paragraph - @kbd{M-q}, @code{fill-paragraph} and @code{fill-region} use the same -criteria as @kbd{M-h} for finding paragraph boundaries (@pxref{Paragraphs}). -For more control, you can use @kbd{M-x fill-region-as-paragraph}, -which refills everything between point and mark as a single paragraph. -This command deletes any blank lines within the region, so separate -blocks of text end up combined into one block. + @kbd{M-q} and @code{fill-region} use the same criteria as @kbd{M-h} +for finding paragraph boundaries (@pxref{Paragraphs}). For more +control, you can use @kbd{M-x fill-region-as-paragraph}, which refills +everything between point and mark as a single paragraph. This command +deletes any blank lines within the region, so separate blocks of text +end up combined into one block. @cindex justification A numeric argument to @kbd{M-q} tells it to @dfn{justify} the text as well as filling it. This means that extra spaces are inserted to make the right margin line up exactly at the fill column. To remove the extra spaces, use @kbd{M-q} with no argument. (Likewise for -@code{fill-paragraph} and @code{fill-region}.) Another way to control -justification, and choose other styles of filling, is with the -@code{justification} text property; see @ref{Format Justification}. +@code{fill-region}.) Another way to control justification, and choose +other styles of filling, is with the @code{justification} text +property; see @ref{Format Justification}. @kindex M-s @r{(Text mode)} @cindex centering @@ -595,7 +589,7 @@ fill prefix automatically (@pxref{Adaptive Fill}). @item C-x . Set the fill prefix (@code{set-fill-prefix}). @item M-q -Fill a paragraph using current fill prefix (@code{fill-paragraph-or-region}). +Fill a paragraph using current fill prefix (@code{fill-paragraph}). @item M-x fill-individual-paragraphs Fill the region, considering each change of indentation as starting a new paragraph. @@ -2256,7 +2250,7 @@ margin width either with a numeric argument or in the minibuffer. Sometimes, as a result of editing, the filling of a paragraph becomes messed up---parts of the paragraph may extend past the left or right -margins. When this happens, use @kbd{M-q} (@code{fill-paragraph-or-region}) to +margins. When this happens, use @kbd{M-q} (@code{fill-paragraph}) to refill the paragraph. The fill prefix, if any, works in addition to the specified paragraph From f0a35bd4ff35e06115aad24a0de94a630b3135e4 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 18 Oct 2007 00:09:49 +0000 Subject: [PATCH 086/127] (Arguments): Replace fill-paragraph-or-region with fill-paragraph. --- doc/emacs/basic.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi index 418d54f677b..333985e4a4a 100644 --- a/doc/emacs/basic.texi +++ b/doc/emacs/basic.texi @@ -707,7 +707,7 @@ C-n} (move down a good fraction of a screen), @kbd{C-u C-u C-o} (make ``a lot'' of blank lines), and @kbd{C-u C-k} (kill four lines). Some commands care whether there is an argument, but ignore its -value. For example, the command @kbd{M-q} (@code{fill-paragraph-or-region}) +value. For example, the command @kbd{M-q} (@code{fill-paragraph}) fills text; with an argument, it justifies the text as well. (@xref{Filling}, for more information on @kbd{M-q}.) Plain @kbd{C-u} is a handy way of providing an argument for such commands. From 168b980f4bf0dccf8f445a264aa8a863780b7bc4 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 18 Oct 2007 00:10:41 +0000 Subject: [PATCH 087/127] (Spelling): ispell-word operates on the active region in Transient Mark mode. --- doc/emacs/ChangeLog | 13 +++++++++++++ doc/emacs/fixit.texi | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 3490f786ecd..0c2c96337a6 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,16 @@ +2007-10-17 Juri Linkov + + * text.texi (Fill Commands): Undocument fill-paragraph-or-region. + fill-paragraph operates on the active region in Transient Mark mode. + (Fill Prefix, Format Indentation): Replace fill-paragraph-or-region + with fill-paragraph. + + * basic.texi (Arguments): Replace fill-paragraph-or-region with + fill-paragraph. + + * fixit.texi (Spelling): ispell-word operates on the active region + in Transient Mark mode. + 2007-10-17 Aaron S. Hawley * building.texi (Source Buffers): diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi index d1577e2f528..2d827f5a1a2 100644 --- a/doc/emacs/fixit.texi +++ b/doc/emacs/fixit.texi @@ -325,7 +325,9 @@ you give an explicit command to do so. To check the spelling of the word around or before point, and optionally correct it as well, use the command @kbd{M-$} (@code{ispell-word}). If the word is not correct, the command offers -you various alternatives for what to do about it. +you various alternatives for what to do about it. When the mark is +active in Transient Mark mode, this command operates on the active +region like @code{ispell-region}. @findex ispell-buffer @findex ispell-region From 65ced25fcb43c1719868b6e56b3d9a49034fe9e1 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 18 Oct 2007 00:14:35 +0000 Subject: [PATCH 088/127] (Filling): Update arguments of fill-paragraph. fill-paragraph operates on the active region in Transient Mark mode. Remove fill-paragraph-or-region. --- doc/lispref/ChangeLog | 6 ++++++ doc/lispref/text.texi | 11 ++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index d95597e940b..e0d9db962f9 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,9 @@ +2007-10-17 Juri Linkov + + * text.texi (Filling): Update arguments of fill-paragraph. + fill-paragraph operates on the active region in Transient Mark mode. + Remove fill-paragraph-or-region. + 2007-10-13 Karl Berry * elisp.texi (@dircategory): Move to after @copying, diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index daaaf6c9b9d..5b935bc6e23 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -1432,11 +1432,14 @@ as @code{full}. When you call the filling functions interactively, using a prefix argument implies the value @code{full} for @var{justify}. -@deffn Command fill-paragraph justify +@deffn Command fill-paragraph &optional justify region This command fills the paragraph at or after point. If @var{justify} is non-@code{nil}, each line is justified as well. It uses the ordinary paragraph motion commands to find paragraph boundaries. @xref{Paragraphs,,, emacs, The GNU Emacs Manual}. +Interactively, when @var{region} is non-@code{nil} in Transient Mark +mode and the mark is active, this command calls @code{fill-region} +on the active region. @end deffn @deffn Command fill-region start end &optional justify nosqueeze to-eop @@ -1453,12 +1456,6 @@ The variable @code{paragraph-separate} controls how to distinguish paragraphs. @xref{Standard Regexps}. @end deffn -@deffn Command fill-paragraph-or-region justify -In Transient Mark mode, when the mark is active, this command calls -@code{fill-region} on the active region. Otherwise, it calls -@code{fill-paragraph}. -@end deffn - @deffn Command fill-individual-paragraphs start end &optional justify citation-regexp This command fills each paragraph in the region according to its individual fill prefix. Thus, if the lines of a paragraph were indented From ecde850af07c3ed64a638fe843da967214b4d3f3 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 18 Oct 2007 00:14:53 +0000 Subject: [PATCH 089/127] Remove fill-paragraph-or-region. --- etc/NEWS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 21cb6b3ffff..2d3a0a03d2c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -118,8 +118,9 @@ following arguments. +++ ** M-q now fills the region if the region is active and `transient-mark-mode' is turned on. Otherwise, it fills the current -paragraph. The new command bound to M-q is `fill-paragraph-or-region'. +paragraph. ++++ ** M-$ now checks spelling of the region if the region is active and `transient-mark-mode' is turned on. Otherwise, it checks spelling of the word at point. From 8dd4830b2a894e90c06921033d8cd8bd05469fe6 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 18 Oct 2007 00:17:38 +0000 Subject: [PATCH 090/127] (auto-mode-alist): Add \\. before PDF/PS/DVI extensions. Regroup. --- lisp/ChangeLog | 24 ++++++++++++++++++++++++ lisp/files.el | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d6132f665aa..8e0853ea612 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,27 @@ +2007-10-17 Juri Linkov + + * textmodes/fill.el (fill-paragraph-or-region): Remove function + at the request of RMS. + (fill-paragraph): Change `arg' to optional `justify'. Add interactive + arg `region'. Fix docstring. At the first `or' branch add call to + `fill-region' if it the region is active in transient-mark-mode. + + * bindings.el (esc-map): Bind M-q to fill-paragraph + instead of fill-paragraph-or-region. + + * tutorial.el (tutorial--default-keys): Replace fill-paragraph-or-region + with fill-paragraph. + + * textmodes/ispell.el (ispell-word): Add interactive arg `region'. + Fix docstring. + + * indent.el (indent-for-tab-command): Change interactive spec from + "P" to "p". Add check for interactive arg before indenting the + active region. + + * files.el (auto-mode-alist): Add \\. before PDF/PS/DVI extensions. + Regroup. + 2007-10-17 Juanma Barranquero * emacs-lisp/find-func.el: Don't require loadhist. diff --git a/lisp/files.el b/lisp/files.el index 3b0b670e21f..d856d7f34a7 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2059,7 +2059,7 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\)\\'" . archive-mode) ("\\.\\(as\\|mi\\|sm\\)2\\'" . snmpv2-mode) ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode) ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MSDOG - ("\\(?:DVI\\|EPS\\|P\\(?:DF\\|S\\)\\|dvi\\|eps\\|p\\(?:df\\|s\\)\\)" . doc-view-mode) + ("\\.\\(?:PDF\\|E?PS\\|DVI\\|pdf\\|e?ps\\|dvi\\)" . doc-view-mode) ("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode) ("BROWSE\\'" . ebrowse-tree-mode) ("\\.ebrowse\\'" . ebrowse-tree-mode) From 65d306e2b720c8b7d0be34fd55dc9087a2db66e9 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Thu, 18 Oct 2007 00:56:59 +0000 Subject: [PATCH 091/127] *** empty log message *** --- nt/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nt/ChangeLog b/nt/ChangeLog index b85b743937f..88cddd2643e 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2007-10-18 Jason Rumney + + * makefile.w32-in (install): Install COPYING in top-level and bin dirs. + 2007-09-27 Jason Rumney * gmake.defs (COMCTL32): New system library. From da3ef617bfe45566bba433287e8fd93aa6025eee Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Thu, 18 Oct 2007 00:57:12 +0000 Subject: [PATCH 092/127] (install): Install COPYING in top-level and bin dirs. --- nt/makefile.w32-in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nt/makefile.w32-in b/nt/makefile.w32-in index 05e9a665879..c8b94a639a0 100644 --- a/nt/makefile.w32-in +++ b/nt/makefile.w32-in @@ -211,6 +211,8 @@ install: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE) $(IFNOTSAMEDIR) $(CP_DIR) ../etc $(INSTALL_DIR) $(ENDIF) - $(CP_DIR) icons $(INSTALL_DIR)/etc $(IFNOTSAMEDIR) $(CP_DIR) ../info $(INSTALL_DIR) $(ENDIF) + $(IFNOTSAMEDIR) $(CP) ../COPYING $(INSTALL_DIR) $(ENDIF) + - $(CP) ../COPYING $(INSTALL_DIR)/bin - $(DEL) ../same-dir.tst - $(DEL) $(INSTALL_DIR)/same-dir.tst From fe1afc9b878fa523c24cee0435fbfa7ef17331bc Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 18 Oct 2007 04:08:42 +0000 Subject: [PATCH 093/127] Drew Adams (mode-line-minor-mode-keymap): Add mouse-minor-mode-menu on mouse-1. (mode-line-modes): Add mouse-1 to help-echo text. (mouse-minor-mode-menu, minor-mode-menu-from-indicator): New functions. (mode-line-minor-mode-help): Doc fix. --- lisp/ChangeLog | 9 +++++++++ lisp/bindings.el | 25 +++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8e0853ea612..c57c5aaacff 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2007-10-18 Drew Adams + + * bindings.el (mode-line-minor-mode-keymap): + Add mouse-minor-mode-menu on mouse-1. + (mode-line-modes): Add mouse-1 to help-echo text. + (mouse-minor-mode-menu, minor-mode-menu-from-indicator): + New functions. + (mode-line-minor-mode-help): Doc fix. + 2007-10-17 Juri Linkov * textmodes/fill.el (fill-paragraph-or-region): Remove function diff --git a/lisp/bindings.el b/lisp/bindings.el index 2ca7c8afea8..ad7470e07e3 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -289,6 +289,7 @@ Keymap to display on major mode.") (defvar mode-line-minor-mode-keymap (let ((map (make-sparse-keymap))) + (define-key map [mode-line down-mouse-1] 'mouse-minor-mode-menu) (define-key map [mode-line mouse-2] 'mode-line-minor-mode-help) (define-key map [mode-line down-mouse-3] 'mode-line-mode-menu-1) (define-key map [header-line down-mouse-3] 'mode-line-mode-menu-1) @@ -331,7 +332,7 @@ Keymap to display on minor modes.") '("" mode-line-process) `(:propertize ("" minor-mode-alist) mouse-face mode-line-highlight - help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes" + help-echo "mouse-1: minor mode, mouse-2: minor mode help, mouse-3: toggle minor modes" local-map ,mode-line-minor-mode-keymap) (propertize "%n" 'help-echo "mouse-2: widen" 'mouse-face 'mode-line-highlight @@ -492,8 +493,28 @@ Menu of mode operations in the mode line.") (interactive "@e") (x-popup-menu event mode-line-mode-menu)) +(defun mouse-minor-mode-menu (event) + "Show minor-mode menu for EVENT on minor modes area of the mode line." + (interactive "@e") + (let ((indicator (car (nth 4 (car (cdr event)))))) + (minor-mode-menu-from-indicator indicator))) + +(defun minor-mode-menu-from-indicator (indicator) + "Show menu, if any, for minor mode specified by INDICATOR. +Interactively, INDICATOR is read using completion." + (interactive (list (completing-read "Minor mode indicator: " + (describe-minor-mode-completion-table-for-indicator)))) + (let ((minor-mode (lookup-minor-mode-from-indicator indicator))) + (if minor-mode + (let* ((map (cdr-safe (assq minor-mode minor-mode-map-alist))) + (menu (and (keymapp map) (lookup-key map [menu-bar])))) + (if menu + (popup-menu menu) + (message "No menu for minor mode `%s'" minor-mode))) + (error "Cannot find minor mode for `%s'" indicator)))) + (defun mode-line-minor-mode-help (event) - "Describe minor mode for EVENT occurred on minor modes area of the mode line." + "Describe minor mode for EVENT on minor modes area of the mode line." (interactive "@e") (let ((indicator (car (nth 4 (car (cdr event)))))) (describe-minor-mode-from-indicator indicator))) From c9447ae1d8814d083f2392dd920c0e896e908ff5 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 18 Oct 2007 04:15:58 +0000 Subject: [PATCH 094/127] Add mouse-1 in mode-line for minor modes. --- doc/emacs/ChangeLog | 4 ++++ etc/NEWS | 3 +++ 2 files changed, 7 insertions(+) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 0c2c96337a6..6fc359fed59 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,7 @@ +2007-10-18 Glenn Morris + + * frames.texi (Mode Line Mouse): Mention minor mode names. + 2007-10-17 Juri Linkov * text.texi (Fill Commands): Undocument fill-paragraph-or-region. diff --git a/etc/NEWS b/etc/NEWS index 2d3a0a03d2c..07faf9c8061 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -83,6 +83,9 @@ recenter the visited source file. Its value can be a number (for example, ** The mode-line displays a `@' if the default-directory for the current buffer is on a remote machine, or a hyphen otherwise. +** The mode-line displays a mode menu when mouse-1 is clicked on a minor mode, +in the same way as it already did for major modes. + ** The new command balance-windows-area balances windows both vertically and horizontally. From 7b6be8339cf8e739a5ef5f77174865e0431f9715 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 18 Oct 2007 04:16:09 +0000 Subject: [PATCH 095/127] (Mode Line Mouse): Mention minor mode names. --- doc/emacs/frames.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index a45b582b455..e1207738cfa 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -430,8 +430,8 @@ This menu is for specifying the frame's default font. You can use mouse clicks on window mode lines to select and manipulate windows. - Some areas of the mode line, such as the buffer name and the major -mode name, have their own special mouse bindings. These areas are + Some areas of the mode line, such as the buffer name, and major and minor +mode names, have their own special mouse bindings. These areas are highlighted when you hold the mouse over them, and information about the special bindings will be displayed (@pxref{Tooltips}). This section's commands do not apply in those areas. From 760e92066843914ff043086bf496e5088f7e6257 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 18 Oct 2007 04:41:52 +0000 Subject: [PATCH 096/127] *** empty log message *** --- lisp/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d875705e63e..0054a7d08ca 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-10-18 Glenn Morris + + * ibuf-ext.el (ibuffer-saved-filter-groups): Doc fix. + 2007-10-17 Aaron Hawley * tutorial.el (tutorial--save-tutorial): Display message when tutorial From 4fbd8ec33410648262e62705f97810e21fa48cad Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 18 Oct 2007 04:42:11 +0000 Subject: [PATCH 097/127] *** empty log message *** --- lisp/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c57c5aaacff..c1603b12907 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-10-18 Glenn Morris + + * ibuf-ext.el (ibuffer-saved-filter-groups): Doc fix. + 2007-10-18 Drew Adams * bindings.el (mode-line-minor-mode-keymap): From eca4dc4453a190b0c698fbc7c40e730d63536fe3 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 18 Oct 2007 04:43:01 +0000 Subject: [PATCH 098/127] (ibuffer-saved-filter-groups): Doc fix. --- lisp/ibuf-ext.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index 7847bed6f2d..2c39b736097 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -180,8 +180,8 @@ QUALIFIERS is a list of the same form as See also the variables `ibuffer-filter-groups', `ibuffer-filtering-qualifiers', `ibuffer-filtering-alist', and the -functions `ibuffer-switch-to-saved-filter-group', -`ibuffer-save-filter-group'." +functions `ibuffer-switch-to-saved-filter-groups', +`ibuffer-save-filter-groups'." :type '(repeat sexp) :group 'ibuffer) From ecacd8b472d02865e2f22fc96e38cb5dd4428b44 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 18 Oct 2007 04:43:08 +0000 Subject: [PATCH 099/127] (ibuffer-saved-filter-groups): Doc fix. --- lisp/ibuf-ext.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index 7847bed6f2d..2c39b736097 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -180,8 +180,8 @@ QUALIFIERS is a list of the same form as See also the variables `ibuffer-filter-groups', `ibuffer-filtering-qualifiers', `ibuffer-filtering-alist', and the -functions `ibuffer-switch-to-saved-filter-group', -`ibuffer-save-filter-group'." +functions `ibuffer-switch-to-saved-filter-groups', +`ibuffer-save-filter-groups'." :type '(repeat sexp) :group 'ibuffer) From 5d9c8a3406a4e48e6e68240b4d718edd9d1b74e8 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 18 Oct 2007 04:46:28 +0000 Subject: [PATCH 100/127] Regenerate. --- src/config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.in b/src/config.in index ed3a6b8f273..a960e970082 100644 --- a/src/config.in +++ b/src/config.in @@ -486,7 +486,7 @@ Boston, MA 02110-1301, USA. */ /* Define to 1 if you have the `rename' function. */ #undef HAVE_RENAME -/* Define to 1 if you have the `res_init' function. */ +/* Define to 1 if res_init is available. */ #undef HAVE_RES_INIT /* Define to 1 if you have the `rindex' function. */ From d4cb4833594d0b11d79bc96842b55666c8733d9e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 18 Oct 2007 04:52:15 +0000 Subject: [PATCH 101/127] Tom Horsley (interprogram-paste-function): Doc fix. (current-kill): Accept list of strings as well as single string from `interprogram-paste-function'. --- lisp/ChangeLog | 6 ++++++ lisp/simple.el | 21 ++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c1603b12907..b4d5f159adf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-10-15 Tom Horsley + + * simple.el (interprogram-paste-function): Doc fix. + (current-kill): Accept list of strings as well + as single string from `interprogram-paste-function'. + 2007-10-18 Glenn Morris * ibuf-ext.el (ibuffer-saved-filter-groups): Doc fix. diff --git a/lisp/simple.el b/lisp/simple.el index 3d5f6bfab10..ebf0a5ff71e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2564,6 +2564,11 @@ of the Emacs kill ring should be used. If the function returns a string, then the caller of the function \(usually `current-kill') should put this string in the kill ring as the latest kill. +This function may also return a list of strings if the window +system supports multiple selections. The first string will be +used as the pasted text, but the other will be placed in the +kill ring for easy access via `yank-pop'. + Note that the function should return a string only if a program other than Emacs has provided a string for pasting; if Emacs provided the most recent string, the function should return nil. If it is @@ -2647,11 +2652,11 @@ If `interprogram-cut-function' is set, pass the resulting kill to it." (defun current-kill (n &optional do-not-move) "Rotate the yanking point by N places, and then return that kill. -If N is zero, `interprogram-paste-function' is set, and calling it -returns a string, then that string is added to the front of the -kill ring and returned as the latest kill. -If optional arg DO-NOT-MOVE is non-nil, then don't actually move the -yanking point; just return the Nth kill forward." +If N is zero, `interprogram-paste-function' is set, and calling it returns a +string or list of strings, then that string (or list) is added to the front +of the kill ring and the string (or first string in the list) is returned as +the latest kill. If optional arg DO-NOT-MOVE is non-nil, then don't +actually move the yanking point; just return the Nth kill forward." (let ((interprogram-paste (and (= n 0) interprogram-paste-function (funcall interprogram-paste-function)))) @@ -2661,8 +2666,10 @@ yanking point; just return the Nth kill forward." ;; text to the kill ring, so Emacs doesn't try to own the ;; selection, with identical text. (let ((interprogram-cut-function nil)) - (kill-new interprogram-paste)) - interprogram-paste) + (if (listp interprogram-paste) + (mapc 'kill-new (nreverse interprogram-paste)) + (kill-new interprogram-paste))) + (car kill-ring)) (or kill-ring (error "Kill ring is empty")) (let ((ARGth-kill-element (nthcdr (mod (- n (length kill-ring-yank-pointer)) From 539f5bdad231f4bd7a195427790207abefb7b2cf Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 18 Oct 2007 04:53:10 +0000 Subject: [PATCH 102/127] Tom Horsley : interprogram-paste-function can return a list. --- etc/NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 07faf9c8061..62258f67ff4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -136,6 +136,10 @@ word at point. ** New command kill-matching-buffers kills buffers whose name matches a regexp. +** `interprogram-paste-function' can now return one string or a list +of strings. In the latter case, Emacs puts the second and following +strings on the kill ring. + ** Minibuffer changes: *** isearch started in the minibuffer searches in the minibuffer history. From a80859d4d11603a264341d6376d3fc3ecdeca12a Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Thu, 18 Oct 2007 08:12:59 +0000 Subject: [PATCH 103/127] (Quitting): Fix typo. --- man/ChangeLog | 4 ++++ man/trouble.texi | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/man/ChangeLog b/man/ChangeLog index 9f162ab2186..aa61bec2868 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2007-10-18 Martin Rudalics + + * trouble.texi (Quitting): Fix typo. + 2007-10-17 Aaron S. Hawley * building.texi (Source Buffers): diff --git a/man/trouble.texi b/man/trouble.texi index ea494445a4e..494637c8eeb 100644 --- a/man/trouble.texi +++ b/man/trouble.texi @@ -84,7 +84,7 @@ waiting for the operating system to do something, quitting is impossible unless special pains are taken for the particular system call within Emacs where the waiting occurs. We have done this for the system calls that users are likely to want to quit from, but it's -possible you will a case not handled. In one very common +possible you will encounter a case not handled. In one very common case---waiting for file input or output using NFS---Emacs itself knows how to quit, but many NFS implementations simply do not allow user programs to stop waiting for NFS when the NFS server is hung. From 3e4dfbb6bd727b604cdc4b989772becd0d6a3664 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 18 Oct 2007 13:27:04 +0000 Subject: [PATCH 104/127] (fill-individual-paragraphs): Doc fix. (adaptive-fill-function): Doc fix. Remove * from docstring. --- lisp/ChangeLog | 7 ++++++- lisp/textmodes/fill.el | 7 ++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b4d5f159adf..daaeee3e93d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,4 +1,9 @@ -2007-10-15 Tom Horsley +2007-10-18 Juanma Barranquero + + * textmodes/fill.el (fill-individual-paragraphs): Doc fix. + (adaptive-fill-function): Doc fix. Remove * from docstring. + +2007-10-18 Tom Horsley * simple.el (interprogram-paste-function): Doc fix. (current-kill): Accept list of strings as well diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index cf52793f7b5..ad42845eb53 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -117,8 +117,8 @@ if it would act as a paragraph-starter on the second line." :group 'fill) (defcustom adaptive-fill-function nil - "*Function to call to choose a fill prefix for a paragraph, or nil. -nil means the function has not determined the fill prefix." + "Function to call to choose a fill prefix for a paragraph, or nil. +A nil value means the function has not determined the fill prefix." :type '(choice (const nil) function) :group 'fill) @@ -1359,7 +1359,7 @@ These lines are filled together. When calling from a program, pass the range to fill as the first two arguments. -Optional third and fourth arguments JUSTIFY and MAIL-FLAG: +Optional third and fourth arguments JUSTIFY and CITATION-REGEXP: JUSTIFY to justify paragraphs (prefix arg), When filling a mail message, pass a regexp for CITATION-REGEXP which will match the prefix of a line which is a citation marker @@ -1448,6 +1448,7 @@ Also, if CITATION-REGEXP is non-nil, don't fill header lines." (fill-region-as-paragraph start (point) justify) (if (and (bolp) (not had-newline)) (delete-char -1)))))))) + (defun fill-individual-paragraphs-prefix (citation-regexp) (let* ((adaptive-fill-first-line-regexp ".*") (just-one-line-prefix From fdd2ae6d90f05195d31a686b02923896324762f2 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 18 Oct 2007 13:29:30 +0000 Subject: [PATCH 105/127] (fill-individual-paragraphs): Fix typo in docstring. --- lisp/textmodes/fill.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index ad42845eb53..ca89fc7a83c 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -1360,7 +1360,7 @@ When calling from a program, pass the range to fill as the first two arguments. Optional third and fourth arguments JUSTIFY and CITATION-REGEXP: -JUSTIFY to justify paragraphs (prefix arg), +JUSTIFY to justify paragraphs (prefix arg). When filling a mail message, pass a regexp for CITATION-REGEXP which will match the prefix of a line which is a citation marker plus whitespace, but no other kind of prefix. From efffe5a38f345b0d2f1df8ab1b684affe3d80faf Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 18 Oct 2007 13:35:16 +0000 Subject: [PATCH 106/127] (fill-individual-paragraphs): Doc fix. (adaptive-fill-function): Doc fix. Remove * from docstring. --- lisp/ChangeLog | 13 +++++++++---- lisp/textmodes/fill.el | 8 ++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0054a7d08ca..d76b474164e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-18 Juanma Barranquero + + * textmodes/fill.el (fill-individual-paragraphs): Doc fix. + (adaptive-fill-function): Doc fix. Remove * from docstring. + 2007-10-18 Glenn Morris * ibuf-ext.el (ibuffer-saved-filter-groups): Doc fix. @@ -11,8 +16,8 @@ * longlines.el (longlines-wrap-follows-window-size): Integer value specifies wrapping margin. - (longlines-mode, longlines-window-change-function): Set - window-specific wrapping margin based on the above. + (longlines-mode, longlines-window-change-function): + Set window-specific wrapping margin based on the above. 2007-10-17 John Wiegley @@ -20,8 +25,8 @@ 2007-10-17 Glenn Morris - * progmodes/cc-menus.el (cc-imenu-c++-generic-expression): Tweak - regexp to avoid stack overflow. + * progmodes/cc-menus.el (cc-imenu-c++-generic-expression): + Tweak regexp to avoid stack overflow. 2007-10-16 Juanma Barranquero diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 88a4286aad2..36167f599f4 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -117,8 +117,8 @@ if it would act as a paragraph-starter on the second line." :group 'fill) (defcustom adaptive-fill-function nil - "*Function to call to choose a fill prefix for a paragraph, or nil. -nil means the function has not determined the fill prefix." + "Function to call to choose a fill prefix for a paragraph, or nil. +A nil value means the function has not determined the fill prefix." :type '(choice (const nil) function) :group 'fill) @@ -1350,8 +1350,8 @@ These lines are filled together. When calling from a program, pass the range to fill as the first two arguments. -Optional third and fourth arguments JUSTIFY and MAIL-FLAG: -JUSTIFY to justify paragraphs (prefix arg), +Optional third and fourth arguments JUSTIFY and CITATION-REGEXP: +JUSTIFY to justify paragraphs (prefix arg). When filling a mail message, pass a regexp for CITATION-REGEXP which will match the prefix of a line which is a citation marker plus whitespace, but no other kind of prefix. From aecedc825df99e5c2f9b81b6514bef0e9a041e1e Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 18 Oct 2007 13:51:21 +0000 Subject: [PATCH 107/127] (unload-feature-special-hooks): Update list of special hooks. --- lisp/ChangeLog | 3 +++ lisp/loadhist.el | 18 +++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d76b474164e..481e889db9f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2007-10-18 Juanma Barranquero + * loadhist.el (unload-feature-special-hooks): + Update list of special hooks. + * textmodes/fill.el (fill-individual-paragraphs): Doc fix. (adaptive-fill-function): Doc fix. Remove * from docstring. diff --git a/lisp/loadhist.el b/lisp/loadhist.el index 4e9ee480d65..0ae1a3260b0 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el @@ -126,15 +126,19 @@ from a file." (defvaralias 'loadhist-hook-functions 'unload-feature-special-hooks) (defvar unload-feature-special-hooks - '(after-change-functions - after-insert-file-functions auto-fill-function - before-change-functions blink-paren-function - buffer-access-fontify-functions command-line-functions - comment-indent-function kill-buffer-query-functions - kill-emacs-query-functions lisp-indent-function - mouse-position-function + '(after-change-functions after-insert-file-functions + after-make-frame-functions auto-fill-function before-change-functions + blink-paren-function buffer-access-fontify-functions command-line-functions + comment-indent-function compilation-finish-functions + disabled-command-function find-file-not-found-functions + font-lock-beginning-of-syntax-function font-lock-fontify-buffer-function + font-lock-fontify-region-function font-lock-mark-block-function + font-lock-syntactic-face-function font-lock-unfontify-buffer-function + font-lock-unfontify-region-function kill-buffer-query-functions + kill-emacs-query-functions lisp-indent-function mouse-position-function redisplay-end-trigger-functions temp-buffer-show-function window-scroll-functions window-size-change-functions + write-contents-functions write-file-functions write-region-annotate-functions) "A list of special hooks from Info node `(elisp)Standard Hooks'. From cb7bddf66162ba9383cb18b54e8380ca02afb5fb Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 18 Oct 2007 15:56:22 +0000 Subject: [PATCH 108/127] (artist-previous-line, artist-next-line): Use forward-line. --- lisp/ChangeLog | 5 +++++ lisp/textmodes/artist.el | 22 ++++++++-------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index daaeee3e93d..b469883c4cc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-18 Thien-Thi Nguyen + + * textmodes/artist.el (artist-previous-line, artist-next-line): + Use forward-line. + 2007-10-18 Juanma Barranquero * textmodes/fill.el (fill-individual-paragraphs): Doc fix. diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index bc0434e151a..f0442904185 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -4383,13 +4383,10 @@ With non-nil ARG, set the last point." If N is negative, move cursor down." (interactive "p") (let ((col (artist-current-column))) - (if (not artist-key-is-drawing) - (progn - (previous-line n) - (move-to-column col t)) - (previous-line n) - (move-to-column col t) - (artist-key-do-continously-common)))) + (forward-line (- n)) + (move-to-column col t)) + (when artist-key-is-drawing + (artist-key-do-continously-common))) (defun artist-next-line (&optional n) @@ -4397,13 +4394,10 @@ If N is negative, move cursor down." If N is negative, move cursor up." (interactive "p") (let ((col (artist-current-column))) - (if (not artist-key-is-drawing) - (progn - (next-line n) - (move-to-column col t)) - (next-line n) - (move-to-column col t) - (artist-key-do-continously-common)))) + (forward-line n) + (move-to-column col t)) + (when artist-key-is-drawing + (artist-key-do-continously-common))) (defun artist-backward-char (&optional n) "Move cursor backward optional N chars (default is 1), updating curr shape. From e82a724f613fbad7217097c5f999b0d0fbcfc297 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 18 Oct 2007 16:00:00 +0000 Subject: [PATCH 109/127] (dired-next-line, dired-previous-line): Use forward-line. --- lisp/ChangeLog | 1 + lisp/dired.el | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b469883c4cc..48774e38958 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,7 @@ 2007-10-18 Thien-Thi Nguyen * textmodes/artist.el (artist-previous-line, artist-next-line): + * dired.el (dired-next-line, dired-previous-line): Use forward-line. 2007-10-18 Juanma Barranquero diff --git a/lisp/dired.el b/lisp/dired.el index 7bdb195543a..16b53acb6da 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1682,14 +1682,14 @@ Otherwise, for buffers inheriting from dired-mode, call `toggle-read-only'." "Move down lines then position at filename. Optional prefix ARG says how many lines to move; default is one line." (interactive "p") - (next-line arg) + (forward-line arg) (dired-move-to-filename)) (defun dired-previous-line (arg) "Move up lines then position at filename. Optional prefix ARG says how many lines to move; default is one line." (interactive "p") - (previous-line arg) + (forward-line (- arg)) (dired-move-to-filename)) (defun dired-next-dirline (arg &optional opoint) From 8cd670fbef6c7d8c6dbb592a6c4c21cad3e8adcc Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 18 Oct 2007 16:01:02 +0000 Subject: [PATCH 110/127] (delphi-newline): Use forward-line. --- lisp/progmodes/delphi.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/delphi.el b/lisp/progmodes/delphi.el index 6cbef6f426d..7c2417fde1a 100644 --- a/lisp/progmodes/delphi.el +++ b/lisp/progmodes/delphi.el @@ -1642,7 +1642,7 @@ before the indent, the point is moved to the indent." (when delphi-newline-always-indents ;; Indent both the (now) previous and current line first. (save-excursion - (previous-line 1) + (forward-line -1) (delphi-indent-line)) (delphi-indent-line))) From dc11adf6bfec36ac0cc84cd52965745fd511edfb Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 18 Oct 2007 16:05:45 +0000 Subject: [PATCH 111/127] Delete eol whitespace; nfc. --- lisp/textmodes/org.el | 104 +++++++++++++++++++++--------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el index 6c48c47d3ad..626d8c63395 100644 --- a/lisp/textmodes/org.el +++ b/lisp/textmodes/org.el @@ -129,7 +129,7 @@ (progn (if pc-mode (partial-completion-mode -1)) ,@body) - (if pc-mode (partial-completion-mode 1))))) + (if pc-mode (partial-completion-mode 1))))) ;;; The custom variables @@ -1399,7 +1399,7 @@ When this variable is nil, `C-c C-c' give you the prompts, and `C-u C-c C-c' trigger the fasttrack." :group 'org-remember :type 'boolean) - + (defcustom org-remember-default-headline "" "The headline that should be the default location in the notes file. When filing remember notes, the cursor will start at that position. @@ -2702,7 +2702,7 @@ directory where the exported Org-mode files lives." (repeat (cons (choice :tag "Type" - (const :html) (const :LaTeX) + (const :html) (const :LaTeX) (const :ascii) (const :ical) (const :xoxo)) (directory))))) @@ -3516,7 +3516,7 @@ color of the frame." ;; Make sure that a fixed-width face is used when we have a column table. (set-face-attribute 'org-column nil :height (face-attribute 'default :height) - :family (face-attribute 'default :family))) + :family (face-attribute 'default :family))) (defface org-warning (org-compatible-face @@ -5544,7 +5544,7 @@ Works for outline headings and for plain lists alike." (cond ((org-on-heading-p) (org-do-demote)) ((org-at-item-p) (org-indent-item 1)))) - + ;;; Promotion and Demotion (defun org-promote-subtree () @@ -6064,7 +6064,7 @@ If WITH-CASE is non-nil, the sorting will be case-sensitive." (if (string-match org-priority-regexp x) (string-to-char (match-string 2 x)) org-default-priority)) - comparefun (if (= dcst sorting-type) '< '>))) + comparefun (if (= dcst sorting-type) '< '>))) (t (error "Invalid sorting type `%c'" sorting-type))) (sort (mapcar (lambda (x) (cons (funcall extractfun (car x)) (cdr x))) @@ -6778,7 +6778,7 @@ off orgstruct-mode will *not* remove these additonal settings." (orgstruct-make-binding 'org-cycle 102 [(tab)] "\C-i")) (org-defkey orgstruct-mode-map "\C-i" (orgstruct-make-binding 'org-cycle 103 "\C-i" [(tab)])) - + (org-defkey orgstruct-mode-map "\M-\C-m" (orgstruct-make-binding 'org-insert-heading 105 "\M-\C-m" [(meta return)])) @@ -6789,10 +6789,10 @@ off orgstruct-mode will *not* remove these additonal settings." (org-defkey orgstruct-mode-map [(shift meta return)] (orgstruct-make-binding 'org-insert-todo-heading 107 [(meta return)] "\M-\C-m")) - + (unless org-local-vars (setq org-local-vars (org-get-local-variables))) - + t)) (defun orgstruct-make-binding (fun n &rest keys) @@ -6843,7 +6843,7 @@ Possible values in the list of contexts are `table', `headline', and `item'." (kill-buffer "*Org tmp*") (delq nil (mapcar - (lambda (x) + (lambda (x) (setq x (if (symbolp x) (list x) @@ -11258,12 +11258,12 @@ according to FMT (default from `org-email-link-description-format')." (if description (concat "[" description "]") "") "]")) -(defconst org-link-escape-chars +(defconst org-link-escape-chars '((" " . "%20") ("[" . "%5B") ("]" . "%5d") ("\340" . "%E0") ; `a - ("\342" . "%E2") ; ^a + ("\342" . "%E2") ; ^a ("\347" . "%E7") ; ,c ("\350" . "%E8") ; `e ("\351" . "%E9") ; 'e @@ -11280,7 +11280,7 @@ according to FMT (default from `org-email-link-description-format')." "Association list of escapes for some characters problematic in links. This is the list that is used for internal purposes.") -(defconst org-link-escape-chars-browser +(defconst org-link-escape-chars-browser '((" " . "%20")) "Association list of escapes for some characters problematic in links. This is the list that is used before handing over to the browser.") @@ -11459,7 +11459,7 @@ With three \\[universal-argument] prefixes, negate the meaning of (setq org-stored-links (delq (assoc link org-stored-links) org-stored-links))) (setq desc (or desc (nth 1 entry))))) - + (if (string-match org-plain-link-re link) ;; URL-like link, normalize the use of angular brackets. (setq link (org-make-link (org-remove-angle-brackets link)))) @@ -12537,7 +12537,7 @@ to be run from that hook to fucntion properly." (when (string-match "\\S-" ins) (or (equal (char-before) ?:) (insert ":")) (insert ins) - (or (equal (char-after) ?:) (insert ":"))))) + (or (equal (char-after) ?:) (insert ":"))))) (char (setq org-time-was-given (equal (upcase char) char)) (setq time (org-read-date (equal (upcase char) "U") t nil @@ -12710,7 +12710,7 @@ See also the variable `org-reverse-note-order'." (org-end-of-subtree t) (org-paste-subtree level txt)) (t (error "This should not happen")))) - + ((and (bobp) (not reversed)) ;; Put it at the end, one level below level 1 (save-restriction @@ -12718,7 +12718,7 @@ See also the variable `org-reverse-note-order'." (goto-char (point-max)) (if (not (bolp)) (newline)) (org-paste-subtree (org-get-legal-level 1 1) txt))) - + ((and (bobp) reversed) ;; Put it at the start, as level 1 (save-restriction @@ -13834,7 +13834,7 @@ also TODO lines." (setq match (completing-read "Match: " 'org-tags-completion-function nil nil nil 'org-tags-history)))) - + ;; Parse the string and create a lisp form (let ((match0 match) (re (org-re "^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL=\\([0-9]+\\)\\|\\([[:alnum:]]+\\)=\\({[^}]+}\\|\"[^\"]+\"\\)\\|[[:alnum:]_@]+\\)")) @@ -13997,12 +13997,12 @@ With prefix ARG, realign all tags in headings in the current buffer." (while (string-match "[-+&]+" tags) ;; No boolean logic, just a list (setq tags (replace-match ":" t t tags)))) - + (if (string-match "\\`[\t ]*\\'" tags) (setq tags "") (unless (string-match ":$" tags) (setq tags (concat tags ":"))) (unless (string-match "^:" tags) (setq tags (concat ":" tags)))) - + ;; Insert new tags at the correct column (beginning-of-line 1) (cond @@ -14321,7 +14321,7 @@ Returns the new tags string, or nil to not change the current settings." (let (tags) (save-excursion (goto-char (point-min)) - (while (re-search-forward + (while (re-search-forward (org-re "[ \t]:\\([[:alnum:]_@:]+\\):[ \t\r\n]") nil t) (when (equal (char-after (point-at-bol 0)) ?*) (mapc (lambda (x) (add-to-list 'tags x)) @@ -14469,7 +14469,7 @@ If WHICH is nil or `all', get all properties. If WHICH is (unless (member key excluded) (push (cons key (or value "")) props))))) (append sum-props (nreverse props))))))) - + (defun org-entry-get (pom property &optional inherit) "Get value of PROPERTY for entry at point-or-marker POM. If INHERIT is non-nil and the entry does not have the property, @@ -14636,7 +14636,7 @@ internally: ARCHIVE, CATEGORY, SUMMARY, DESCRIPTION, LOCATION, and LOGGING." (defun org-set-property (property value) "In the current entry, set PROPERTY to VALUE." (interactive - (let* ((prop (completing-read "Property: " + (let* ((prop (completing-read "Property: " (mapcar 'list (org-buffer-property-keys)))) (cur (org-entry-get nil prop)) (allowed (org-property-get-allowed-values nil prop 'table)) @@ -14657,7 +14657,7 @@ internally: ARCHIVE, CATEGORY, SUMMARY, DESCRIPTION, LOCATION, and LOGGING." (let* ((prop (completing-read "Property: " (org-entry-properties nil 'standard)))) (list prop))) - (message (concat "Property " property + (message (concat "Property " property (if (org-entry-delete nil property) " deleted" " was not present in the entry")))) @@ -14666,7 +14666,7 @@ internally: ARCHIVE, CATEGORY, SUMMARY, DESCRIPTION, LOCATION, and LOGGING." "Remove PROPERTY globally, from all entries." (interactive (let* ((prop (completing-read - "Globally remove property: " + "Globally remove property: " (mapcar 'list (org-buffer-property-keys))))) (list prop))) (save-excursion @@ -14703,7 +14703,7 @@ completion." (let (vals) (cond ((equal property "TODO") - (setq vals (org-with-point-at pom + (setq vals (org-with-point-at pom (append org-todo-keywords-1 '(""))))) ((equal property "PRIORITY") (let ((n org-lowest-priority)) @@ -14713,7 +14713,7 @@ completion." ((member property org-special-properties)) (t (setq vals (org-entry-get pom (concat property "_ALL") 'inherit)) - + (when (and vals (string-match "\\S-" vals)) (setq vals (car (read-from-string (concat "(" vals ")")))) (setq vals (mapcar (lambda (x) @@ -14843,7 +14843,7 @@ This is the compiled version of the format.") (beginning-of-line 1) (and (looking-at "\\(\\**\\)\\(\\* \\)") (org-get-level-face 2)))) - (color (list :foreground + (color (list :foreground (face-attribute (or level-face 'default) :foreground))) props pom property ass width f string ov column) ;; Check if the entry is in another buffer. @@ -14988,7 +14988,7 @@ Where possible, use the standard interface for changing this line." nval eval allowed) (when (equal key "ITEM") (error "Cannot edit item headline from here")) - + (cond ((equal key "TODO") (setq eval '(org-with-point-at pom @@ -15021,7 +15021,7 @@ Where possible, use the standard interface for changing this line." (remove-text-properties (1- bol) eol '(read-only t)) (unwind-protect (progn - (setq org-columns-overlays + (setq org-columns-overlays (org-delete-all line-overlays org-columns-overlays)) (mapc 'org-delete-overlay line-overlays) (org-columns-eval eval)) @@ -15040,7 +15040,7 @@ Where possible, use the standard interface for changing this line." (allowed (org-entry-get (point) key1 t)) nval) (setq nval (read-string "Allowed: " allowed)) - (org-entry-put + (org-entry-put (cond ((marker-position org-entry-property-inherited-from) org-entry-property-inherited-from) ((marker-position org-columns-top-level-marker) @@ -15099,7 +15099,7 @@ Where possible, use the standard interface for changing this line." (remove-text-properties (1- bol) eol '(read-only t)) (unwind-protect (progn - (setq org-columns-overlays + (setq org-columns-overlays (org-delete-all line-overlays org-columns-overlays)) (mapc 'org-delete-overlay line-overlays) (org-columns-eval '(org-entry-put pom key nval))) @@ -15250,7 +15250,7 @@ Where possible, use the standard interface for changing this line." (error "Cannot shift this column further to the left")) (backward-char 1) (org-columns-move-right) - (backward-char 1))) + (backward-char 1))) (defun org-columns-store-format () "Store the text version of the current columns format in appropriate place. @@ -15348,7 +15348,7 @@ display, or in the #+COLUMNS line of the current buffer." (setq pos (org-overlay-start ov)) (goto-char pos) (when (setq val (cdr (assoc property - (get-text-property + (get-text-property (point-at-bol) 'org-summaries)))) (setq fmt (org-overlay-get ov 'org-columns-format)) (org-overlay-put ov 'org-columns-value val) @@ -15404,7 +15404,7 @@ display, or in the #+COLUMNS line of the current buffer." (if flag str val) format)))) (aset lflag level t)) ;; clear accumulators for deeper levels - (loop for l from (1+ level) to (1- lmax) do + (loop for l from (1+ level) to (1- lmax) do (aset lsum l 0) (aset lflag l nil))) ((>= level last-level) @@ -15720,7 +15720,7 @@ user." minute (if (match-end 3) (string-to-number (match-string 3 ans)) 0) - pm (equal ?p + pm (equal ?p (string-to-char (downcase (match-string 4 ans))))) (if (and (= hour 12) (not pm)) (setq hour 0) @@ -16354,7 +16354,7 @@ in the timestamp determines what will be changed." (setq ng 6 new (car (rassoc (+ n (cdr (assoc (match-string 6 s) idx))) idx)))) ((org-pos-in-match-range pos 5) (setq ng 5 new (format "%d" (max 1 (+ n (string-to-number (match-string 5 s)))))))) - + (when ng (setq s (concat (substring s 0 (match-beginning ng)) @@ -16421,28 +16421,28 @@ belonging to the category \"Work\"." (require 'org) (if (equal filter '(4)) (setq filter (read-from-minibuffer "Regexp filter: "))) - (let* ((today (org-date-to-gregorian + (let* ((today (org-date-to-gregorian (time-to-days (current-time)))) (files org-agenda-files) entries file) (while (setq file (pop files)) (setq entries (append entries (org-agenda-get-day-entries file today :timestamp)))) (setq entries (delq nil entries)) - (mapc + (mapc (lambda(x) (let* ((evt (org-trim (get-text-property 1 'txt x))) (cat (get-text-property 1 'org-category x)) (tod (get-text-property 1 'time-of-day x)) (ok (or (and (stringp filter) (string-match filter evt)) (and (not (null filter)) (listp filter) - (or (string-match + (or (string-match (cadr (assoc 'category filter)) cat) - (string-match + (string-match (cadr (assoc 'headline filter)) evt)))))) ;; (setq evt (set-text-properties 0 (length event) nil evt)) (when (and ok tod) (setq tod (number-to-string tod) - tod (when (string-match + tod (when (string-match "\\([0-9]\\{1,2\\}\\)\\([0-9]\\{2\\}\\)" tod) (concat (match-string 1 tod) ":" (match-string 2 tod)))) @@ -16923,7 +16923,7 @@ the returned times will be formatted strings." (setq total-time (+ (or total-time 0) org-clock-file-total-minutes))))))) (goto-char pos) - + (unless (eq scope 'agenda) (org-clock-sum ts te) (goto-char (point-min)) @@ -16968,7 +16968,7 @@ the returned times will be formatted strings." (insert-before-markers "|-\n|" (if (eq scope 'agenda) "|" "") - "|" + "|" "*Total time*| " (format "*%d:%02d*" h m) "|\n|-\n") @@ -19766,7 +19766,7 @@ With prefix ARG, go forward that many times the current span." (list (car org-agenda-last-arguments) sd nd t))) (org-agenda-redo) (org-agenda-find-today-or-agenda)))) - + (defun org-agenda-earlier (arg) "Go backward in time by the current span. With prefix ARG, go backward that many times the current span." @@ -20480,7 +20480,7 @@ be used to request time specification in the time stamp." (save-excursion (org-back-to-heading t) (if (looking-at - (if no-tags + (if no-tags (org-re "\\*+[ \t]+\\([^\n\r]*?\\)\\([ \t]+:[[:alnum:]:_@]+:[ \t]*\\)?$") "\\*+[ \t]+\\([^\r\n]*\\)")) (match-string 1) ""))) @@ -21530,7 +21530,7 @@ translations. There is currently no way for users to extend this.") (setq fmt (pop formatters)) (when (car fmt) (goto-char (point-min)) - (while (re-search-forward (concat "^#\\+" (cadr fmt) + (while (re-search-forward (concat "^#\\+" (cadr fmt) ":[ \t]*\\(.*\\)") nil t) (replace-match "\\1" t) (add-text-properties @@ -21538,7 +21538,7 @@ translations. There is currently no way for users to extend this.") '(org-protected t)))) (goto-char (point-min)) (while (re-search-forward - (concat "^#\\+" + (concat "^#\\+" (caddr fmt) "\\>.*\\(\\(\n.*\\)*?\n\\)#\\+" (cadddr fmt) "\\>.*\n?") nil t) (if (car fmt) @@ -21689,7 +21689,7 @@ translations. There is currently no way for users to extend this.") (add-text-properties (point) (1+ (point-at-eol)) (list :org-license-to-kill t))))) title)) - + (defun org-solidify-link-text (s &optional alist) "Take link text and make a safe target out of it." (save-match-data @@ -22778,7 +22778,7 @@ lang=\"%s\" xml:lang=\"%s\"> (if (and (string-match org-todo-line-regexp line) (match-beginning 2)) - (setq line + (setq line (concat (substring line 0 (match-beginning 2)) " (lambda (x) (setq gr (pop org-table-colgroup-info)) (format "%s%s" - (if (memq gr '(:start :startend)) + (if (memq gr '(:start :startend)) (prog1 (if colgropen "\n" "") (setq colgropen t)) "") (if (> (/ (float x) nlines) org-table-number-fraction) "right" "left") - (if (memq gr '(:end :startend)) + (if (memq gr '(:end :startend)) (progn (setq colgropen nil) "") ""))) fnum "") From e73ea842b7b0b34ae56004432a7e01cb1e667610 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 18 Oct 2007 16:07:35 +0000 Subject: [PATCH 112/127] (org-columns-eval): Use forward-line. --- lisp/ChangeLog | 2 ++ lisp/textmodes/org.el | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 48774e38958..24be4370154 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,8 @@ * textmodes/artist.el (artist-previous-line, artist-next-line): * dired.el (dired-next-line, dired-previous-line): + * progmodes/delphi.el (delphi-newline): + * textmodes/org.el (org-columns-eval): Use forward-line. 2007-10-18 Juanma Barranquero diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el index 626d8c63395..5487609343b 100644 --- a/lisp/textmodes/org.el +++ b/lisp/textmodes/org.el @@ -15050,8 +15050,7 @@ Where possible, use the standard interface for changing this line." (defun org-columns-eval (form) (let (hidep) (save-excursion - (beginning-of-line 1) - (next-line 1) + (forward-line 1) (setq hidep (org-on-heading-p 1))) (eval form) (and hidep (hide-entry)))) From de3cc8168d9f9840c2b65265611c6541a2232d5c Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 18 Oct 2007 18:25:15 +0000 Subject: [PATCH 113/127] (emerge-setup): Use insert-buffer-substring. (emerge-prepare-error-list, emerge-setup-with-ancestor): Likewise. --- lisp/ChangeLog | 3 +++ lisp/emerge.el | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 24be4370154..39daa6aef77 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -6,6 +6,9 @@ * textmodes/org.el (org-columns-eval): Use forward-line. + * emerge.el (emerge-setup): Use insert-buffer-substring. + (emerge-prepare-error-list, emerge-setup-with-ancestor): Likewise. + 2007-10-18 Juanma Barranquero * textmodes/fill.el (fill-individual-paragraphs): Doc fix. diff --git a/lisp/emerge.el b/lisp/emerge.el index 0c1b3b170cd..fd002409a7f 100644 --- a/lisp/emerge.el +++ b/lisp/emerge.el @@ -633,7 +633,7 @@ This is *not* a user option, since Emerge uses it for its own processing.") (if output-file (concat "Output to file: " output-file) (concat "Output to buffer: " (buffer-name merge-buffer)))) - (insert-buffer emerge-A-buffer) + (save-excursion (insert-buffer-substring emerge-A-buffer)) (emerge-set-keys) (setq emerge-difference-list (emerge-make-diff-list file-A file-B)) (setq emerge-number-of-differences (length emerge-difference-list)) @@ -712,7 +712,7 @@ This is *not* a user option, since Emerge uses it for its own processing.") (emerge-eval-in-buffer emerge-diff-error-buffer (erase-buffer) - (insert-buffer emerge-diff-buffer) + (save-excursion (insert-buffer-substring emerge-diff-buffer)) (delete-matching-lines ok-regexp))) ;;; Top-level and setup functions for three-file mode. @@ -802,7 +802,7 @@ This is *not* a user option, since Emerge uses it for its own processing.") (if output-file (concat "Output to file: " output-file) (concat "Output to buffer: " (buffer-name merge-buffer)))) - (insert-buffer emerge-A-buffer) + (save-excursion (insert-buffer-substring emerge-A-buffer)) (emerge-set-keys) (setq emerge-difference-list (emerge-make-diff3-list file-A file-B file-ancestor)) From 1bb5ab899b4014b4dc309f1b3cd41258de63e6cd Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 18 Oct 2007 18:53:28 +0000 Subject: [PATCH 114/127] (encoded-kbd-setup-display): Be careful not to remove keymaps that just happen to inherit from one of ours. When setting up our keymap, make sure it won't be accidentally modified by someone else. --- lisp/ChangeLog | 7 +++ lisp/international/encoded-kb.el | 87 ++++++++++++++++++++------------ 2 files changed, 63 insertions(+), 31 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 39daa6aef77..b92d3b1b654 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2007-10-18 Stefan Monnier + + * international/encoded-kb.el (encoded-kbd-setup-display): Be careful + not to remove keymaps that just happen to inherit from one of ours. + When setting up our keymap, make sure it won't be accidentally + modified by someone else. + 2007-10-18 Thien-Thi Nguyen * textmodes/artist.el (artist-previous-line, artist-next-line): diff --git a/lisp/international/encoded-kb.el b/lisp/international/encoded-kb.el index 14c61560a41..5e690048aeb 100644 --- a/lisp/international/encoded-kb.el +++ b/lisp/international/encoded-kb.el @@ -262,38 +262,63 @@ DISPLAY may be a display id, a frame, or nil for the selected frame's display." (when frame (with-selected-frame frame ;; Remove any previous encoded-kb keymap from input-decode-map. - (let ((m input-decode-map)) - (if (equal (keymap-prompt m) "encoded-kb") - (setq input-decode-map (keymap-parent m)) - (while (keymap-parent m) - (if (equal (keymap-prompt (keymap-parent m)) "encoded-kb") - (set-keymap-parent m (keymap-parent (keymap-parent m)))) - (setq m (keymap-parent m))))) + (let ((m input-decode-map) + (child nil)) + (while (keymapp m) + (if (not (equal (keymap-prompt m) "encoded-kb")) + (progn + (setq child m) + (setq m (keymap-parent m))) + ;; We've found an encoded-kb map, but maybe the prompt we get + ;; is really inherited from the encoded-kb map. + (let (mp) + (while (and (keymapp (setq mp (keymap-parent m))) + (equal (keymap-prompt mp) "encoded-kb")) + (setq child m) + (setq m mp)) + ;; (assert (equal (keymap-prompt m) "encoded-kb")) + ;; (assert (eq mp (keymap-parent m))) + ;; (assert (not (and (keymapp mp) + ;; (equal (keymap-prompt mp) "encoded-kb")))) + ;; (assert (eq m (if child + ;; (keymap-parent child) input-decode-map))) + ;; We can finally do the actual removal. + (if child + (set-keymap-parent child mp) + (setq input-decode-map mp)) + (setq m mp)))))) - (if (keyboard-coding-system) - ;; We are turning on Encoded-kbd mode. - (let ((coding (keyboard-coding-system)) - (keymap (make-sparse-keymap "encoded-kb")) - (cim (current-input-mode)) - result) - (set-keymap-parent keymap input-decode-map) - (setq input-decode-map keymap) - (unless (terminal-parameter nil 'encoded-kbd-saved-input-meta-mode) - (set-terminal-parameter nil 'encoded-kbd-saved-input-mode (nth 2 cim))) - (setq result (and coding (encoded-kbd-setup-keymap keymap coding))) - (if result - (when (and (eq result 8) - (memq (nth 2 cim) '(t nil))) - (set-input-meta-mode 'use-8th-bit)) - (set-terminal-parameter nil 'encoded-kbd-saved-input-meta-mode nil) - (error "Unsupported coding system in Encoded-kbd mode: %S" - coding))) - ;; We are turning off Encoded-kbd mode. - (when (and (terminal-parameter nil 'encoded-kbd-saved-input-meta-mode) - (not (equal (nth 2 (current-input-mode)) - (terminal-parameter nil 'encoded-kbd-saved-input-meta-mode)))) - (set-input-meta-mode (terminal-parameter nil 'encoded-kbd-saved-input-meta-mode))) - (set-terminal-parameter nil 'saved-input-meta-mode nil)))))) + (if (keyboard-coding-system) + ;; We are turning on Encoded-kbd mode. + (let ((coding (keyboard-coding-system)) + (keymap (make-sparse-keymap "encoded-kb")) + (cim (current-input-mode)) + result) + ;; Place `keymap' as the immediate parent of input-decode-map + ;; rather than on top, so that later `define-key' on + ;; input-decode-map don't end up accidentally changing our + ;; part of the keymap, which would lead to bugs when/if we later + ;; on remove that part. + (set-keymap-parent keymap (keymap-parent input-decode-map)) + (set-keymap-parent input-decode-map keymap) + (unless (terminal-parameter nil 'encoded-kbd-saved-input-meta-mode) + (set-terminal-parameter nil 'encoded-kbd-saved-input-mode + (nth 2 cim))) + (setq result (and coding (encoded-kbd-setup-keymap keymap coding))) + (if result + (when (and (eq result 8) + (memq (nth 2 cim) '(t nil))) + (set-input-meta-mode 'use-8th-bit)) + (set-terminal-parameter + nil 'encoded-kbd-saved-input-meta-mode nil) + (error "Unsupported coding system in Encoded-kbd mode: %S" + coding))) + ;; We are turning off Encoded-kbd mode. + (let ((old (terminal-parameter nil 'encoded-kbd-saved-input-meta-mode))) + (when (and old (not (equal (nth 2 (current-input-mode)) old))) + (set-input-meta-mode old)) + (set-terminal-parameter + nil 'encoded-kbd-saved-input-meta-mode nil)))))) (provide 'encoded-kb) From 8782c744ef0c1732c513e29f260b0e73263deffd Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 18 Oct 2007 19:02:23 +0000 Subject: [PATCH 115/127] (tty-create-frame-with-faces): Make sure not only tty-run-terminal-initialization but also set-locale-environment are run only once per terminal. (tty-run-terminal-initialization): Don't check if the terminal was already initted. --- lisp/ChangeLog | 6 ++++++ lisp/faces.el | 11 +++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b92d3b1b654..9063215b99f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2007-10-18 Stefan Monnier + * faces.el (tty-create-frame-with-faces): Make sure not only + tty-run-terminal-initialization but also set-locale-environment + are run only once per terminal. + (tty-run-terminal-initialization): Don't check if the terminal was + already initted. + * international/encoded-kb.el (encoded-kbd-setup-display): Be careful not to remove keymaps that just happen to inherit from one of ours. When setting up our keymap, make sure it won't be accidentally diff --git a/lisp/faces.el b/lisp/faces.el index e31622d9ba0..ab299160b6d 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1876,8 +1876,10 @@ created." (modify-frame-parameters frame '((interprogram-cut-function . nil))) (modify-frame-parameters frame '((interprogram-paste-function . nil))) - (set-locale-environment nil frame) - (tty-run-terminal-initialization frame) + (unless (terminal-parameter frame 'terminal-initted) + (set-terminal-parameter frame 'terminal-initted t) + (set-locale-environment nil frame) + (tty-run-terminal-initialization frame)) (frame-set-background-mode frame) (face-set-after-frame-default frame) (setq success t)) @@ -1910,10 +1912,7 @@ terminal type to a different value." ;; Load library for our terminal type. ;; User init file can set term-file-prefix to nil to prevent this. (with-selected-frame frame - (unless (or (null term-file-prefix) - ;; Don't reinitialize the terminal each time a new - ;; frame is opened on it. - (terminal-parameter frame 'terminal-initted)) + (unless (null term-file-prefix) (let* (term-init-func) ;; First, load the terminal initialization file, if it is ;; available and it hasn't been loaded already. From af020a0464b03976a56041e25087f132e7d38160 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 18 Oct 2007 19:06:44 +0000 Subject: [PATCH 116/127] Don't change the global function-key-map anny more. (xterm-mouse-mode): Use terminal-init-xterm-hook. Don't use after-make-frame-functions now that term/xterm.el calls us directly. (turn-on-xterm-mouse-tracking, turn-off-xterm-mouse-tracking): Use turn-*-xterm-mouse-tracking-on-terminal. Only once per terminal. (turn-on-xterm-mouse-tracking-on-terminal): Make param optional. Setup input-decode-map and remember that xterm-mouse-mode was enabled in this terminal. (turn-off-xterm-mouse-tracking-on-terminal): Only disable on those terminals where it has been enabled. --- lisp/ChangeLog | 12 ++++++++++++ lisp/xt-mouse.el | 45 ++++++++++++++++++++++++--------------------- 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9063215b99f..1714b9e850d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,17 @@ 2007-10-18 Stefan Monnier + * xt-mouse.el: Don't change the global function-key-map anny more. + (xterm-mouse-mode): Use terminal-init-xterm-hook. + Don't use after-make-frame-functions now that term/xterm.el calls + us directly. + (turn-on-xterm-mouse-tracking, turn-off-xterm-mouse-tracking): + Use turn-*-xterm-mouse-tracking-on-terminal. Only once per terminal. + (turn-on-xterm-mouse-tracking-on-terminal): Make param optional. + Setup input-decode-map and remember that xterm-mouse-mode was + enabled in this terminal. + (turn-off-xterm-mouse-tracking-on-terminal): Only disable on those + terminals where it has been enabled. + * faces.el (tty-create-frame-with-faces): Make sure not only tty-run-terminal-initialization but also set-locale-environment are run only once per terminal. diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index 15aebb08ab2..adb6f08943c 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -45,9 +45,6 @@ (defvar xterm-mouse-debug-buffer nil) -;; XXX Perhaps this should be terminal-local instead. --lorentey -(define-key function-key-map "\e[M" 'xterm-mouse-translate) - (defvar xterm-mouse-last) ;; Mouse events symbols must have an 'event-kind property with @@ -78,7 +75,7 @@ (error "Unexpected escape sequence from XTerm"))) (let* ((click (if is-click down (xterm-mouse-event))) - (click-command (nth 0 click)) + ;; (click-command (nth 0 click)) (click-data (nth 1 click)) (click-where (nth 1 click-data))) (if (memq down-binding '(nil ignore)) @@ -209,14 +206,15 @@ down the SHIFT key while pressing the mouse button." ;; Turn it on (progn ;; Frame creation and deletion. - (add-hook 'after-make-frame-functions - 'turn-on-xterm-mouse-tracking-on-terminal) + (add-hook 'terminal-init-xterm-hook + 'turn-on-xterm-mouse-tracking-on-terminal) + (add-hook 'delete-frame-functions 'xterm-mouse-handle-delete-frame) ;; Restore normal mouse behaviour outside Emacs. (add-hook 'suspend-tty-functions 'turn-off-xterm-mouse-tracking-on-terminal) - (add-hook 'resume-tty-functions + (add-hook 'resume-tty-functions 'turn-on-xterm-mouse-tracking-on-terminal) (add-hook 'suspend-hook 'turn-off-xterm-mouse-tracking) (add-hook 'suspend-resume-hook 'turn-on-xterm-mouse-tracking) @@ -224,8 +222,6 @@ down the SHIFT key while pressing the mouse button." (setq mouse-position-function #'xterm-mouse-position-function) (turn-on-xterm-mouse-tracking)) ;; Turn it off - (remove-hook 'after-make-frame-functions - 'turn-on-xterm-mouse-tracking-on-terminal) (remove-hook 'delete-frame-functions 'xterm-mouse-handle-delete-frame) (remove-hook 'suspend-tty-functions 'turn-off-xterm-mouse-tracking-on-terminal) @@ -239,28 +235,35 @@ down the SHIFT key while pressing the mouse button." (defun turn-on-xterm-mouse-tracking () "Enable Emacs mouse tracking in xterm." - (dolist (f (frame-list)) - (when (eq t (frame-live-p f)) - (with-selected-frame f - (when xterm-mouse-mode - (send-string-to-terminal "\e[?1000h")))))) + (dolist (terminal (delete-dups (mapcar 'frame-terminal (frame-list)))) + (turn-on-xterm-mouse-tracking-on-terminal terminal))) (defun turn-off-xterm-mouse-tracking (&optional force) "Disable Emacs mouse tracking in xterm." - (dolist (f (frame-list)) - (when (eq t (frame-live-p f)) - (with-selected-frame f - (when (or force xterm-mouse-mode) - (send-string-to-terminal "\e[?1000l")))))) + (dolist (terminal (delete-dups (mapcar 'frame-terminal (frame-list)))) + (turn-off-xterm-mouse-tracking-on-terminal terminal))) -(defun turn-on-xterm-mouse-tracking-on-terminal (terminal) +(defun turn-on-xterm-mouse-tracking-on-terminal (&optional terminal) "Enable xterm mouse tracking on TERMINAL." (when (and xterm-mouse-mode (eq t (terminal-live-p terminal))) + (unless (terminal-parameter terminal 'xterm-mouse-mode) + ;; Simulate selecting a terminal by selecting one of its frames ;-( + (with-selected-frame (car (frames-on-display-list terminal)) + (define-key input-decode-map "\e[M" 'xterm-mouse-translate)) + (set-terminal-parameter terminal 'xterm-mouse-mode t)) (send-string-to-terminal "\e[?1000h" terminal))) (defun turn-off-xterm-mouse-tracking-on-terminal (terminal) "Disable xterm mouse tracking on TERMINAL." - (when (and xterm-mouse-mode (eq t (terminal-live-p terminal))) + ;; Only send the disable command to those terminals to which we've already + ;; sent the enable command. + (when (and (terminal-parameter terminal 'xterm-mouse-mode) + (eq t (terminal-live-p terminal))) + ;; We could remove the key-binding and unset the `xterm-mouse-mode' + ;; terminal parameter, but it seems less harmful to send this escape + ;; command too many times (or to catch an unintended key sequence), than + ;; to send it too few times (or to fail to let xterm-mouse events + ;; pass by untranslated). (send-string-to-terminal "\e[?1000l" terminal))) (defun xterm-mouse-handle-delete-frame (frame) From 4387d9f4f93d1614c1718b797f0375e96f84c353 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 18 Oct 2007 19:07:49 +0000 Subject: [PATCH 117/127] Don't require xt-mouse. (terminal-init-xterm): Run terminal-init-xterm-hook rather than calling turn-on-xterm-mouse-tracking-on-terminal directly. --- lisp/ChangeLog | 4 ++++ lisp/term/xterm.el | 12 ++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1714b9e850d..15309eac955 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2007-10-18 Stefan Monnier + * term/xterm.el: Don't require xt-mouse. + (terminal-init-xterm): Run terminal-init-xterm-hook rather than + calling turn-on-xterm-mouse-tracking-on-terminal directly. + * xt-mouse.el: Don't change the global function-key-map anny more. (xterm-mouse-mode): Use terminal-init-xterm-hook. Don't use after-make-frame-functions now that term/xterm.el calls diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 1c4b60706aa..a60aa90255f 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -27,8 +27,6 @@ ;;; Code: -(eval-when-compile (require 'xt-mouse)) - (defvar xterm-function-map (let ((map (make-sparse-keymap))) @@ -469,12 +467,8 @@ ;; This recomputes all the default faces given the colors we've just set up. (tty-set-up-initial-frame-faces) - (when xterm-mouse-mode - (turn-on-xterm-mouse-tracking-on-terminal - (frame-terminal (selected-frame)))) - ;; Try to turn on the modifyOtherKeys feature on modern xterms. - ;; When it is turned on much more key bindings work: things like + ;; When it is turned on many more key bindings work: things like ;; C-. C-, etc. ;; To do that we need to find out if the current terminal supports ;; modifyOtherKeys. At this time only xterm does. @@ -506,7 +500,9 @@ ;; need to deal with modify-other-keys. (push (frame-terminal (selected-frame)) xterm-modify-other-keys-terminal-list) - (xterm-turn-on-modify-other-keys))))))) + (xterm-turn-on-modify-other-keys)))))) + + (run-hooks 'terminal-init-xterm-hook)) ;; Set up colors, for those versions of xterm that support it. (defvar xterm-standard-colors From 6a658a30577e3b020632b1d03f5fe8b6a33809ee Mon Sep 17 00:00:00 2001 From: Reiner Steib Date: Thu, 18 Oct 2007 19:24:30 +0000 Subject: [PATCH 118/127] (doc-view-ghostscript-options, doc-view-ps->pdf): Add comment about "-dSAFER". --- lisp/ChangeLog | 5 +++++ lisp/doc-view.el | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 15309eac955..7f0615e1dd5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-18 Reiner Steib + + * doc-view.el (doc-view-ghostscript-options, doc-view-ps->pdf): + Add comment about "-dSAFER". + 2007-10-18 Stefan Monnier * term/xterm.el: Don't require xt-mouse. diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 64ee1bbd8ea..241b87065d3 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -120,9 +120,10 @@ :group 'doc-view) (defcustom doc-view-ghostscript-options - '("-dNOPAUSE" "-sDEVICE=png16m" "-dTextAlphaBits=4" - "-dBATCH" "-dGraphicsAlphaBits=4" "-dQUIET" - "-dSAFER" "-r100") + '("-dSAFER" ;; Avoid security problems when rendering files from untrusted + ;; sources. + "-dNOPAUSE" "-sDEVICE=png16m" "-dTextAlphaBits=4" + "-dBATCH" "-dGraphicsAlphaBits=4" "-dQUIET" "-r100") "A list of options to give to ghostscript." :type '(sexp) :group 'doc-view) @@ -488,7 +489,10 @@ It's a subdirectory of `doc-view-cache-directory'." (setq doc-view-current-converter-process (start-process "ps->pdf" doc-view-conversion-buffer doc-view-ps2pdf-program - ps pdf "-dSAFER") + ps pdf + ;; Avoid security problems when rendering files from + ;; untrusted sources. + "-dSAFER") mode-line-process (list (format ":%s" doc-view-current-converter-process))) (set-process-sentinel doc-view-current-converter-process 'doc-view-ps->pdf-sentinel) From d27180ec629f761684bfa5c3bf6b4cb6dd1cb93e Mon Sep 17 00:00:00 2001 From: Reiner Steib Date: Thu, 18 Oct 2007 19:30:23 +0000 Subject: [PATCH 119/127] * doc-view.el (doc-view-dvi->pdf-sentinel, doc-view-dvi->pdf) (doc-view-pdf/ps->png-sentinel, doc-view-pdf/ps->png) (doc-view-pdf->txt-sentinel, doc-view-pdf->txt) (doc-view-ps->pdf-sentinel, doc-view-ps->pdf): Remove superfluous messages. --- lisp/ChangeLog | 8 ++++++++ lisp/doc-view.el | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7f0615e1dd5..79830aa53d6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2007-10-18 Tassilo Horn + + * doc-view.el (doc-view-dvi->pdf-sentinel, doc-view-dvi->pdf) + (doc-view-pdf/ps->png-sentinel, doc-view-pdf/ps->png) + (doc-view-pdf->txt-sentinel, doc-view-pdf->txt) + (doc-view-ps->pdf-sentinel, doc-view-ps->pdf): Remove superfluous + messages. + 2007-10-18 Reiner Steib * doc-view.el (doc-view-ghostscript-options, doc-view-ps->pdf): diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 241b87065d3..da116fa2bde 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -390,7 +390,6 @@ It's a subdirectory of `doc-view-cache-directory'." (set-buffer (process-get proc 'buffer)) (setq doc-view-current-converter-process nil mode-line-process nil) - (message "DocView: finished conversion from DVI to PDF!") ;; Now go on converting this PDF to a set of PNG files. (let* ((pdf (process-get proc 'pdf-file)) (png (concat (doc-view-current-cache-dir) @@ -399,7 +398,6 @@ It's a subdirectory of `doc-view-cache-directory'." (defun doc-view-dvi->pdf (dvi pdf) "Convert DVI to PDF asynchrounously." - (message "DocView: converting DVI to PDF now!") (setq doc-view-current-converter-process (start-process "dvi->pdf" doc-view-conversion-buffer doc-view-dvipdfm-program @@ -420,13 +418,11 @@ It's a subdirectory of `doc-view-cache-directory'." (when doc-view-current-timer (cancel-timer doc-view-current-timer) (setq doc-view-current-timer nil)) - (message "DocView: finished conversion from PDF/PS to PNG!") ;; Yippie, finished. Update the display! (doc-view-display doc-view-current-doc))) (defun doc-view-pdf/ps->png (pdf-ps png) "Convert PDF-PS to PNG asynchrounously." - (message "DocView: converting PDF or PS to PNG now!") (setq doc-view-current-converter-process (apply 'start-process (append (list "pdf/ps->png" doc-view-conversion-buffer @@ -453,7 +449,6 @@ It's a subdirectory of `doc-view-cache-directory'." (set-buffer proc-buffer) (setq doc-view-current-converter-process nil mode-line-process nil) - (message "DocView: finished conversion from PDF to TXT!") ;; If the user looks at the DocView buffer where the conversion was ;; performed, search anew. This time it will be queried for a regexp. (when (eq current-buffer proc-buffer) @@ -461,7 +456,6 @@ It's a subdirectory of `doc-view-cache-directory'." (defun doc-view-pdf->txt (pdf txt) "Convert PDF to TXT asynchrounously." - (message "DocView: converting PDF to TXT now!") (setq doc-view-current-converter-process (start-process "pdf->txt" doc-view-conversion-buffer doc-view-pdftotext-program "-raw" @@ -477,7 +471,6 @@ It's a subdirectory of `doc-view-cache-directory'." (set-buffer (process-get proc 'buffer)) (setq doc-view-current-converter-process nil mode-line-process nil) - (message "DocView: finished conversion from PS to PDF!") ;; Now we can transform to plain text. (doc-view-pdf->txt (process-get proc 'pdf-file) (concat (doc-view-current-cache-dir) @@ -485,7 +478,6 @@ It's a subdirectory of `doc-view-cache-directory'." (defun doc-view-ps->pdf (ps pdf) "Convert PS to PDF asynchronously." - (message "DocView: converting PS to PDF now!") (setq doc-view-current-converter-process (start-process "ps->pdf" doc-view-conversion-buffer doc-view-ps2pdf-program From 414dd971eb69040f206a89f26426c925a1bcfa57 Mon Sep 17 00:00:00 2001 From: Reiner Steib Date: Thu, 18 Oct 2007 19:33:57 +0000 Subject: [PATCH 120/127] (doc-view-mode-map): Use the image-mode scrolling commands. Don't rebind C-x k. --- lisp/ChangeLog | 3 +++ lisp/doc-view.el | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 79830aa53d6..b1a674aa363 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -5,6 +5,9 @@ (doc-view-pdf->txt-sentinel, doc-view-pdf->txt) (doc-view-ps->pdf-sentinel, doc-view-ps->pdf): Remove superfluous messages. + (doc-view-mode-map): Use the image-mode scrolling commands. Don't + rebind C-x k. + 2007-10-18 Reiner Steib diff --git a/lisp/doc-view.el b/lisp/doc-view.el index da116fa2bde..dd7565ced87 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -102,6 +102,7 @@ ;;; Code: (require 'dired) +(require 'image-mode) (eval-when-compile (require 'cl)) ;;;; Customization Options @@ -222,7 +223,6 @@ has finished." ;; Killing/burying the buffer (and the process) (define-key map (kbd "q") 'bury-buffer) (define-key map (kbd "k") 'doc-view-kill-proc-and-buffer) - (define-key map (kbd "C-x k") 'doc-view-kill-proc-and-buffer) ;; Slicing the image (define-key map (kbd "s s") 'doc-view-set-slice) (define-key map (kbd "s m") 'doc-view-set-slice-using-mouse) @@ -233,6 +233,14 @@ has finished." (define-key map (kbd "C-S-n") 'doc-view-search-next-match) (define-key map (kbd "C-S-p") 'doc-view-search-previous-match) ;; Scrolling + (define-key map (kbd "") 'image-forward-hscroll) + (define-key map (kbd "") 'image-backward-hscroll) + (define-key map (kbd "") 'image-next-line) + (define-key map (kbd "") 'image-previous-line) + (define-key map (kbd "C-f") 'image-forward-hscroll) + (define-key map (kbd "C-b") 'image-backward-hscroll) + (define-key map (kbd "C-n") 'image-next-line) + (define-key map (kbd "C-p") 'image-previous-line) (define-key map (kbd "C-v") 'scroll-up) (define-key map (kbd "") 'mwheel-scroll) (define-key map (kbd "") 'mwheel-scroll) From c9a9a5e389dab928aac8d907e0d2adfa59963907 Mon Sep 17 00:00:00 2001 From: Reiner Steib Date: Thu, 18 Oct 2007 19:46:39 +0000 Subject: [PATCH 121/127] Remove version keyword. (doc-view-ghostscript-program, doc-view-dvipdfm-program) (doc-view-ps2pdf-program): Use executable-find. Simplify custom type. (doc-view-ghostscript-options): Improve custom type. (doc-view-cache-directory, doc-view-conversion-buffer) (doc-view-conversion-refresh-interval): Simplify custom type. --- lisp/ChangeLog | 10 +++++++++- lisp/doc-view.el | 25 ++++++++++++------------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b1a674aa363..fb0f80907bc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2007-10-18 Reiner Steib + + * doc-view.el: Remove version keyword. + (doc-view-ghostscript-program, doc-view-dvipdfm-program) + (doc-view-ps2pdf-program): Use executable-find. Simplify custom type. + (doc-view-ghostscript-options): Improve custom type. + (doc-view-cache-directory, doc-view-conversion-buffer) + (doc-view-conversion-refresh-interval): Simplify custom type. + 2007-10-18 Tassilo Horn * doc-view.el (doc-view-dvi->pdf-sentinel, doc-view-dvi->pdf) @@ -8,7 +17,6 @@ (doc-view-mode-map): Use the image-mode scrolling commands. Don't rebind C-x k. - 2007-10-18 Reiner Steib * doc-view.el (doc-view-ghostscript-options, doc-view-ps->pdf): diff --git a/lisp/doc-view.el b/lisp/doc-view.el index dd7565ced87..d93a8ca316d 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -5,7 +5,6 @@ ;; Author: Tassilo Horn ;; Maintainer: Tassilo Horn ;; Keywords: files, pdf, ps, dvi -;; Version: <2007-10-17 Wed 22:15> ;; This file is part of GNU Emacs. @@ -115,9 +114,9 @@ :group 'multimedia :prefix "doc-view-") -(defcustom doc-view-ghostscript-program "gs" +(defcustom doc-view-ghostscript-program (executable-find "gs") "Program to convert PS and PDF files to PNG." - :type '(file) + :type 'file :group 'doc-view) (defcustom doc-view-ghostscript-options @@ -126,40 +125,40 @@ "-dNOPAUSE" "-sDEVICE=png16m" "-dTextAlphaBits=4" "-dBATCH" "-dGraphicsAlphaBits=4" "-dQUIET" "-r100") "A list of options to give to ghostscript." - :type '(sexp) + :type '(repeat string) :group 'doc-view) -(defcustom doc-view-dvipdfm-program "dvipdfm" +(defcustom doc-view-dvipdfm-program (executable-find "dvipdfm") "Program to convert DVI files to PDF. DVI file will be converted to PDF before the resulting PDF is converted to PNG." - :type '(file) + :type 'file :group 'doc-view) -(defcustom doc-view-ps2pdf-program "ps2pdf" +(defcustom doc-view-ps2pdf-program (executable-find "ps2pdf") "Program to convert PS files to PDF. PS files will be converted to PDF before searching is possible." - :type '(file) + :type 'file :group 'doc-view) -(defcustom doc-view-pdftotext-program "pdftotext" +(defcustom doc-view-pdftotext-program (executable-find "pdftotext") "Program to convert PDF files to plain text. Needed for searching." - :type '(file) + :type 'file :group 'doc-view) (defcustom doc-view-cache-directory (concat temporary-file-directory "doc-view") "The base directory, where the PNG images will be saved." - :type '(directory) + :type 'directory :group 'doc-view) (defcustom doc-view-conversion-buffer "*doc-view conversion output*" "The buffer where messages from the converter programs go to." - :type '(string) + :type 'string :group 'doc-view) (defcustom doc-view-conversion-refresh-interval 3 @@ -168,7 +167,7 @@ After such an refresh newly converted pages will be available for viewing. If set to nil there won't be any refreshes and the pages won't be displayed before conversion of the whole document has finished." - :type '(string) + :type 'integer :group 'doc-view) ;;;; Internal Variables From 9a9057825c16c518b41f3899fd4cd8202f50d4b4 Mon Sep 17 00:00:00 2001 From: Reiner Steib Date: Thu, 18 Oct 2007 19:59:52 +0000 Subject: [PATCH 122/127] (auto-mode-alist): Don't use doc-view for PS and EPS. --- lisp/ChangeLog | 2 ++ lisp/files.el | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fb0f80907bc..7c62aecfd55 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2007-10-18 Reiner Steib + * files.el (auto-mode-alist): Don't use doc-view for PS and EPS. + * doc-view.el: Remove version keyword. (doc-view-ghostscript-program, doc-view-dvipdfm-program) (doc-view-ps2pdf-program): Use executable-find. Simplify custom type. diff --git a/lisp/files.el b/lisp/files.el index d856d7f34a7..6d03ad24dbe 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2059,7 +2059,8 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\)\\'" . archive-mode) ("\\.\\(as\\|mi\\|sm\\)2\\'" . snmpv2-mode) ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode) ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MSDOG - ("\\.\\(?:PDF\\|E?PS\\|DVI\\|pdf\\|e?ps\\|dvi\\)" . doc-view-mode) + ("\\.[eE]?[pP][sS]\\'" . ps-mode) + ("\\.\\(?:PDF\\|DVI\\|pdf\\|dvi\\)" . doc-view-mode) ("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode) ("BROWSE\\'" . ebrowse-tree-mode) ("\\.ebrowse\\'" . ebrowse-tree-mode) From 9ccbb53dcf9e9e5ce794ca11a14e58dc2b8fd03d Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Thu, 18 Oct 2007 21:00:43 +0000 Subject: [PATCH 123/127] Add Image Support section. --- admin/nt/README.W32 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/admin/nt/README.W32 b/admin/nt/README.W32 index 4b2cc4edc98..4c74f12f96c 100644 --- a/admin/nt/README.W32 +++ b/admin/nt/README.W32 @@ -64,6 +64,32 @@ (non-windowed) mode of operation is most useful if you have a telnet server on your machine, allowing you to run Emacs remotely. +* Image support + + Emacs has built in support for XBM and PPM/PGM/PBM images, and the + libXpm library is bundled, providing XPM support (required for color + toolbar icons and splash screen). + + Emacs can also support some other image formats with appropriate + libraries. These libraries are all available as part of GTK, or from + gnuwin32.sourceforge.net. Emacs will find them if the directory they + are installed in is on the PATH. + + PNG: requires the PNG reference library 1.2 or later, which will + be named libpng13d.dll, libpng13.dll, libpng12d.dll, libpng12.dll + or libpng.dll. LibPNG requires zlib, which should come from the same + source as you got libpng. + + JPEG: requires the Independant JPEG Group's libjpeg 6b or later, + which will be called jpeg62.dll, libjpeg.dll, jpeg-62.dll or jpeg.dll. + + TIFF: requires libTIFF 3.0 or later, which will be called libtiff3.dll + or libtiff.dll. + + GIF: requires libungif or giflib 4.1 or later, which will be + called giflib4.dll, libungif4.dll or libungif.dll. + + * Uninstalling Emacs If you should need to uninstall Emacs, simply delete all the files and From b4fde39fda2eed0fd1b60c10fdf832fabb8cb7cd Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 18 Oct 2007 21:09:02 +0000 Subject: [PATCH 124/127] Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 257-258) - Merge from emacs--rel--22 - Update from CVS 2007-10-15 Katsumi Yamaoka * lisp/gnus/gnus-util.el (gnus-string<): New function. * lisp/gnus/gnus-sum.el (gnus-article-sort-by-author) (gnus-article-sort-by-subject): Use it. 2007-10-15 Katsumi Yamaoka * lisp/gnus/gnus-win.el (gnus-configure-windows): Focus on the frame for which the frame-focus tag is set in gnus-buffer-configuration. Revision: emacs@sv.gnu.org/emacs--rel--22--patch-128 --- lisp/gnus/ChangeLog | 12 ++++++++++++ lisp/gnus/gnus-sum.el | 4 ++-- lisp/gnus/gnus-util.el | 9 +++++++++ lisp/gnus/gnus-win.el | 3 ++- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 1def50da1e3..9d95f0a6c6a 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,15 @@ +2007-10-15 Katsumi Yamaoka + + * gnus-util.el (gnus-string<): New function. + + * gnus-sum.el (gnus-article-sort-by-author) + (gnus-article-sort-by-subject): Use it. + +2007-10-15 Katsumi Yamaoka + + * gnus-win.el (gnus-configure-windows): Focus on the frame for which + the frame-focus tag is set in gnus-buffer-configuration. + 2007-10-08 Reiner Steib * mm-util.el (mm-charset-synonym-alist): Alias gbk to cp936. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 36e93796a63..8fb18d3a990 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -4674,7 +4674,7 @@ using some other form will lead to serious barfage." (defsubst gnus-article-sort-by-author (h1 h2) "Sort articles by root author." - (string-lessp + (gnus-string< (let ((extract (funcall gnus-extract-address-components (mail-header-from h1)))) @@ -4691,7 +4691,7 @@ using some other form will lead to serious barfage." (defsubst gnus-article-sort-by-subject (h1 h2) "Sort articles by root subject." - (string-lessp + (gnus-string< (downcase (gnus-simplify-subject-re (mail-header-subject h1))) (downcase (gnus-simplify-subject-re (mail-header-subject h2))))) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 74aacdd2860..3d3e4148c2d 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -290,6 +290,15 @@ is slower." (not (or (string< s1 s2) (string= s1 s2)))) +(defun gnus-string< (s1 s2) + "Return t if first arg string is less than second in lexicographic order. +Case is significant if and only if `case-fold-search' is nil. +Symbols are also allowed; their print names are used instead." + (if case-fold-search + (string-lessp (downcase (if (symbolp s1) (symbol-name s1) s1)) + (downcase (if (symbolp s2) (symbol-name s2) s2))) + (string-lessp s1 s2))) + ;;; Time functions. (defun gnus-file-newer-than (file date) diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el index 5c57aaa1886..7e1609cc196 100644 --- a/lisp/gnus/gnus-win.el +++ b/lisp/gnus/gnus-win.el @@ -471,7 +471,8 @@ See the Gnus manual for an explanation of the syntax used.") (gnus-configure-frame split) (run-hooks 'gnus-configure-windows-hook) (when gnus-window-frame-focus - (select-frame (window-frame gnus-window-frame-focus)))))))) + (gnus-select-frame-set-input-focus + (window-frame gnus-window-frame-focus)))))))) (defun gnus-delete-windows-in-gnusey-frames () "Do a `delete-other-windows' in all frames that have Gnus windows." From 658dcd4753808b503e9cd327db2033632cdd4f7c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 18 Oct 2007 21:23:32 +0000 Subject: [PATCH 125/127] (display-time-world-time-format): Display day # not month #. --- lisp/ChangeLog | 4 ++++ lisp/time.el | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7c62aecfd55..eabf820754c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-10-18 Richard Stallman + + * time.el (display-time-world-time-format): Display day # not month #. + 2007-10-18 Reiner Steib * files.el (auto-mode-alist): Don't use doc-view for PS and EPS. diff --git a/lisp/time.el b/lisp/time.el index 8bc14974315..4d94fb7aeb3 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -127,7 +127,7 @@ LABEL is a string to display to label that zone's time." :type '(repeat (list string string)) :version "23.1") -(defcustom display-time-world-time-format "%A %m %B %R %Z" +(defcustom display-time-world-time-format "%A %d %B %R %Z" "Format of the time displayed, see `format-time-string'." :group 'display-time :type 'string From 3278f20eee991e78086bb3b93391ccf68001f586 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 18 Oct 2007 22:07:34 +0000 Subject: [PATCH 126/127] (read_key_sequence): Undo a change introduced by multi-tty which caused key-translation-map to applied repeatedly (thus breaking double-mode). --- src/ChangeLog | 6 ++++++ src/keyboard.c | 22 +++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index dcd9f0955dd..c50b6286407 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2007-10-18 Stefan Monnier + + * keyboard.c (read_key_sequence): Undo a change introduced by multi-tty + which caused key-translation-map to applied repeatedly (thus breaking + double-mode). + 2007-10-17 Stefan Monnier * xselect.c (x_own_selection, x_handle_selection_clear) diff --git a/src/keyboard.c b/src/keyboard.c index fccf5c88eaa..ddb0b4407b7 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -9185,13 +9185,16 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, orig_keymap = get_local_map (PT, current_buffer, Qkeymap); from_string = Qnil; - /* We jump here when the key sequence has been thoroughly changed, and - we need to rescan it starting from the beginning. When we jump here, - keybuf[0..mock_input] holds the sequence we should reread. */ - replay_sequence: - - /* We may switch keyboards between rescans, so we need to - reinitialize fkey and keytran before each replay. */ + /* The multi-tty merge moved the code below to right after + `replay_sequence' which caused alll these translation maps to be applied + repeatedly, even tho their doc says very clearly they are not applied to + their own output. + The reason for this move was: "We may switch keyboards between rescans, + so we need to reinitialize fkey and keytran before each replay". + This move was wrong (even if we switch keyboards, keybuf still holds the + keys we've read already from the original keyboard and some of those keys + may have already been translated). So there may still be a bug out there + lurking. */ indec.map = indec.parent = current_kboard->Vinput_decode_map; fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map; keytran.map = keytran.parent = Vkey_translation_map; @@ -9199,6 +9202,11 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, fkey.start = fkey.end = 0; keytran.start = keytran.end = 0; + /* We jump here when the key sequence has been thoroughly changed, and + we need to rescan it starting from the beginning. When we jump here, + keybuf[0..mock_input] holds the sequence we should reread. */ + replay_sequence: + starting_buffer = current_buffer; first_unbound = bufsize + 1; From bd3164743080f3eb5fc316aca7cc5322ca58fe33 Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Thu, 18 Oct 2007 22:49:05 +0000 Subject: [PATCH 127/127] From_ Johan Bockgrd, * net/tramp.el (tramp-rfn-eshadow-update-overlay): Save excursion. Use `save-restriction' rather than `widen'. --- lisp/ChangeLog | 5 +++++ lisp/net/tramp.el | 13 +++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eabf820754c..d4363b03818 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-18 Johan Bockg,Ae(Brd + + * net/tramp.el (tramp-rfn-eshadow-update-overlay): Save excursion. + Use `save-restriction' rather than `widen'. + 2007-10-18 Richard Stallman * time.el (display-time-world-time-format): Display day # not month #. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index c8b2a72aad0..0af9c457995 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2092,12 +2092,13 @@ been set up by `rfn-eshadow-setup-minibuffer'." (symbol-value 'rfn-eshadow-overlay)) (funcall (symbol-function 'minibuffer-prompt-end))))) (when (file-remote-p (buffer-substring-no-properties end (point-max))) - (narrow-to-region - (1+ (or (string-match "/" (buffer-string) end) end)) (point-max)) - (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay) - (rfn-eshadow-update-overlay-hook nil)) - (funcall (symbol-function 'rfn-eshadow-update-overlay))) - (widen)))) + (save-excursion + (save-restriction + (narrow-to-region + (1+ (or (string-match "/" (buffer-string) end) end)) (point-max)) + (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay) + (rfn-eshadow-update-overlay-hook nil)) + (funcall (symbol-function 'rfn-eshadow-update-overlay)))))))) (when (boundp 'rfn-eshadow-update-overlay-hook) (add-hook 'rfn-eshadow-update-overlay-hook