Now on revision 107952. ------------------------------------------------------------ revno: 107952 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 20:08:05 -0700 message: NEWS placeholder diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-04-17 02:46:22 +0000 +++ etc/NEWS 2012-04-17 03:08:05 +0000 @@ -74,6 +74,8 @@ ** In Perl mode, new option `perl-indent-parens-as-block' causes non-block closing brackets to be aligned with the line of the opening bracket. +** FIXME something happened to ses.el, 2012-04-17. + ** Obsolete packages: *** mailpost.el ------------------------------------------------------------ revno: 107951 [merge] committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 20:06:56 -0700 message: Merge from pending; try to fix-up suboptimal ses ChangeLog. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-17 02:46:22 +0000 +++ lisp/ChangeLog 2012-04-17 03:06:56 +0000 @@ -1,3 +1,35 @@ +2012-04-17 Stefan Monnier + + * emacs-lisp/smie.el: Provide smarter auto-filling. + (smie-auto-fill): New function. + (smie-setup): Use it. + + * newcomment.el (comment-choose-indent): Obey comment-inline-offset. + +2012-04-17 Philipp Haselwarter (tiny change) + + * newcomment.el (comment-inline-offset): New custom var (bug#11090). + (comment-indent): Use it. + +2012-04-17 Vincent Belaïche + + * ses.el: The overall change is to add cell renaming, that is + setting fancy names for cell symbols other than name matching + "\\`[A-Z]+[0-9]+\\'" regexp . + (ses-localvars): Add ses--renamed-cell-symb-list. + (ses-create-cell-variable): New defun. + (ses-destroy-cell-variable-range): Respect ses--numrows, ses--numcols. + (ses-relocate-formula): Relocate formulas only for cells the + symbols of which are not renamed, i.e. symbols whose names do not + match regexp "\\`[A-Z]+[0-9]+\\'". + (ses-relocate-all): Relocate values only for cells the symbols of + which are not renamed. + (ses-load): Create cells variables as the (ses-cell ...) are read, + in order to check row col consistency with cell symbol name only + for cells that are not renamed. + (ses-replace-name-in-formula): New defun. + (ses-rename-cell): New defun. + 2012-04-17 Peter Oliver (tiny change) * progmodes/perl-mode.el (perl-indent-parens-as-block): === modified file 'lisp/emacs-lisp/smie.el' --- lisp/emacs-lisp/smie.el 2012-02-04 08:43:26 +0000 +++ lisp/emacs-lisp/smie.el 2012-03-25 20:37:21 +0000 @@ -1602,6 +1602,38 @@ (save-excursion (indent-line-to indent)) (indent-line-to indent))))) +(defun smie-auto-fill () + (let ((fc (current-fill-column)) + (try-again nil)) + (while (and fc (> (current-column) fc)) + (cond + ((not (or (nth 8 (save-excursion + (syntax-ppss (line-beginning-position)))) + (nth 8 (syntax-ppss)))) + (save-excursion + (beginning-of-line) + (smie-indent-forward-token) + (let ((bsf (point)) + (gain 0) + curcol) + (while (<= (setq curcol (current-column)) fc) + ;; FIXME? `smie-indent-calculate' can (and often will) + ;; return a result that actually depends on the presence/absence + ;; of a newline, so the gain computed here may not be accurate, + ;; but in practice it seems to works well enough. + (let* ((newcol (smie-indent-calculate)) + (newgain (- curcol newcol))) + (when (> newgain gain) + (setq gain newgain) + (setq bsf (point)))) + (smie-indent-forward-token)) + (when (> gain 0) + (setq try-again) + (goto-char bsf) + (newline-and-indent))))) + (t (do-auto-fill)))))) + + (defun smie-setup (grammar rules-function &rest keywords) "Setup SMIE navigation and indentation. GRAMMAR is a grammar table generated by `smie-prec2->grammar'. @@ -1612,6 +1644,7 @@ (set (make-local-variable 'smie-rules-function) rules-function) (set (make-local-variable 'smie-grammar) grammar) (set (make-local-variable 'indent-line-function) 'smie-indent-line) + (set (make-local-variable 'normal-auto-fill-function) 'smie-auto-fill) (set (make-local-variable 'forward-sexp-function) 'smie-forward-sexp-command) (while keywords === modified file 'lisp/newcomment.el' --- lisp/newcomment.el 2012-04-09 13:05:48 +0000 +++ lisp/newcomment.el 2012-04-17 03:06:56 +0000 @@ -269,6 +269,19 @@ :type '(choice string integer (const nil)) :group 'comment) +(defcustom comment-inline-offset 1 + "Inline comments have to be preceded by at least this many spaces. +This is useful when style-conventions require a certain minimal offset. +Python's PEP8 for example recommends two spaces, so you could do: + +\(add-hook 'python-mode-hook + (lambda () (set (make-local-variable 'comment-inline-offset) 2))) + +See `comment-padding' for whole-line comments." + :version "24.2" + :type 'integer + :group 'comment) + ;;;###autoload (defcustom comment-multi-line nil "Non-nil means `comment-indent-new-line' continues comments. @@ -587,7 +600,7 @@ (save-excursion (end-of-line) (current-column))))) (other nil) (min (save-excursion (skip-chars-backward " \t") - (if (bolp) 0 (1+ (current-column)))))) + (if (bolp) 0 (+ comment-inline-offset (current-column)))))) ;; Fix up the range. (if (< max min) (setq max min)) ;; Don't move past the fill column. @@ -687,7 +700,8 @@ (save-excursion (skip-chars-backward " \t") (unless (bolp) - (setq indent (max indent (1+ (current-column)))))) + (setq indent (max indent + (+ (current-column) comment-inline-offset))))) ;; If that's different from comment's current position, change it. (unless (= (current-column) indent) (delete-region (point) (progn (skip-chars-backward " \t") (point))) === modified file 'lisp/ses.el' --- lisp/ses.el 2012-02-11 22:13:29 +0000 +++ lisp/ses.el 2012-03-25 20:37:21 +0000 @@ -282,6 +282,9 @@ ses--numcols ses--numrows ses--symbolic-formulas ses--data-marker ses--params-marker (ses--Dijkstra-attempt-nb . 0) ses--Dijkstra-weight-bound + ;; This list is useful to speed-up clean-up of symbols when + ;; an area containing renamed cell is deleted. + ses--renamed-cell-symb-list ;; Global variables that we override mode-line-process next-line-add-newlines transient-mark-mode) "Buffer-local variables used by SES.") @@ -674,6 +677,17 @@ (put sym 'ses-cell (cons xrow xcol)) (make-local-variable sym))))) +(defun ses-create-cell-variable (sym row col) + "Create a buffer-local variable `SYM' for cell at position (ROW, COL). + +SYM is the symbol for that variable, ROW and COL are integers for +row and column of the cell, with numbering starting from 0. + +Return nil in case of failure." + (unless (local-variable-p sym) + (make-local-variable sym) + (put sym 'ses-cell (cons row col)))) + ;; We do not delete the ses-cell properties for the cell-variables, in ;; case a formula that refers to this cell is in the kill-ring and is ;; later pasted back in. @@ -682,7 +696,10 @@ (let (sym) (dotimes (row (1+ (- maxrow minrow))) (dotimes (col (1+ (- maxcol mincol))) - (setq sym (ses-create-cell-symbol (+ row minrow) (+ col mincol))) + (let ((xrow (+ row minrow)) (xcol (+ col mincol))) + (setq sym (if (and (< xrow ses--numrows) (< xcol ses--numcols)) + (ses-cell-symbol xrow xcol) + (ses-create-cell-symbol xrow xcol)))) (if (boundp sym) (push `(apply ses-set-with-undo ,sym ,(symbol-value sym)) buffer-undo-list)) @@ -1400,7 +1417,8 @@ Sets `ses-relocate-return' to 'delete if cell-references were removed." (let (rowcol result) (if (or (atom formula) (eq (car formula) 'quote)) - (if (setq rowcol (ses-sym-rowcol formula)) + (if (and (setq rowcol (ses-sym-rowcol formula)) + (string-match "\\`[A-Z]+[0-9]+\\'" (symbol-name formula))) (ses-relocate-symbol formula rowcol startrow startcol rowincr colincr) formula) ; Pass through as-is. @@ -1508,14 +1526,15 @@ the rectangle (MINROW,MINCOL)..(NUMROWS,NUMCOLS) by adding ROWINCR and COLINCR to each symbol." (let (reform) - (let (mycell newval) + (let (mycell newval xrow) (dotimes-with-progress-reporter (row ses--numrows) "Relocating formulas..." (dotimes (col ses--numcols) (setq ses-relocate-return nil mycell (ses-get-cell row col) newval (ses-relocate-formula (ses-cell-formula mycell) - minrow mincol rowincr colincr)) + minrow mincol rowincr colincr) + xrow (- row rowincr)) (ses-set-cell row col 'formula newval) (if (eq ses-relocate-return 'range) ;; This cell contains a (ses-range X Y) where a cell has been @@ -1531,8 +1550,22 @@ minrow mincol rowincr colincr)) (ses-set-cell row col 'references newval) (and (>= row minrow) (>= col mincol) - (ses-set-cell row col 'symbol - (ses-create-cell-symbol row col)))))) + (let ((sym (ses-cell-symbol row col)) + (xcol (- col colincr))) + (if (and + sym + (>= xrow 0) + (>= xcol 0) + (null (eq sym + (ses-create-cell-symbol xrow xcol)))) + ;; This is a renamed cell, do not update the cell + ;; name, but just update the coordinate property. + (put sym 'ses-cell (cons row col)) + (ses-set-cell row col 'symbol + (setq sym (ses-create-cell-symbol row col))) + (unless (and (boundp sym) (local-variable-p sym)) + (set (make-local-variable sym) nil) + (put sym 'ses-cell (cons row col)))))) ))) ;; Relocate the cell values. (let (oldval myrow mycol xrow xcol) (cond @@ -1545,11 +1578,17 @@ (setq mycol (+ col mincol) xrow (- myrow rowincr) xcol (- mycol colincr)) - (if (and (< xrow ses--numrows) (< xcol ses--numcols)) - (setq oldval (ses-cell-value xrow xcol)) - ;; Cell is off the end of the array. - (setq oldval (symbol-value (ses-create-cell-symbol xrow xcol)))) - (ses-set-cell myrow mycol 'value oldval)))) + (let ((sym (ses-cell-symbol myrow mycol)) + (xsym (ses-create-cell-symbol xrow xcol))) + ;; Make the value relocation only when if the cell is not + ;; a renamed cell. Otherwise this is not needed. + (and (eq sym xsym) + (ses-set-cell myrow mycol 'value + (if (and (< xrow ses--numrows) (< xcol ses--numcols)) + (ses-cell-value xrow xcol) + ;;Cell is off the end of the array + (symbol-value xsym)))))))) + ((and (wholenump rowincr) (wholenump colincr)) ;; Insertion of rows and/or columns. Run the loop backwards. (let ((disty (1- ses--numrows)) @@ -1659,7 +1698,6 @@ (message "Upgrading from SES-1 file format"))) (or (= ses--file-format 2) (error "This file needs a newer version of the SES library code")) - (ses-create-cell-variable-range 0 (1- ses--numrows) 0 (1- ses--numcols)) ;; Initialize cell array. (setq ses--cells (make-vector ses--numrows nil)) (dotimes (row ses--numrows) @@ -1679,11 +1717,10 @@ (dotimes (row ses--numrows) (dotimes (col ses--numcols) (let* ((x (read (current-buffer))) - (rowcol (ses-sym-rowcol (car-safe (cdr-safe x))))) + (sym (car-safe (cdr-safe x)))) (or (and (looking-at "\n") (eq (car-safe x) 'ses-cell) - (eq row (car rowcol)) - (eq col (cdr rowcol))) + (ses-create-cell-variable sym row col)) (error "Cell-def error")) (eval x))) (or (looking-at "\n\n") @@ -3140,6 +3177,63 @@ (mouse-set-point event) (ses-insert-ses-range)) +(defun ses-replace-name-in-formula (formula old-name new-name) + (let ((new-formula formula)) + (unless (and (consp formula) + (eq (car-safe formula) 'quote)) + (while formula + (let ((elt (car-safe formula))) + (cond + ((consp elt) + (setcar formula (ses-replace-name-in-formula elt old-name new-name))) + ((and (symbolp elt) + (eq (car-safe formula) old-name)) + (setcar formula new-name)))) + (setq formula (cdr formula)))) + new-formula)) + +(defun ses-rename-cell (new-name) + "Rename current cell." + (interactive "*SEnter new name: ") + (ses-check-curcell) + (or + (and (local-variable-p new-name) + (ses-sym-rowcol new-name) + ;; this test is needed because ses-cell property of deleted cells + ;; is not deleted in case of subsequent undo + (memq new-name ses--renamed-cell-symb-list) + (error "Already a cell name")) + (and (boundp new-name) + (null (yes-or-no-p (format "`%S' is already bound outside this buffer, continue? " + new-name))) + (error "Already a bound cell name"))) + (let* ((rowcol (ses-sym-rowcol ses--curcell)) + (cell (ses-get-cell (car rowcol) (cdr rowcol)))) + (put new-name 'ses-cell rowcol) + (dolist (reference (ses-cell-references (car rowcol) (cdr rowcol))) + (let* ((rowcol (ses-sym-rowcol reference)) + (cell (ses-get-cell (car rowcol) (cdr rowcol)))) + (ses-cell-set-formula (car rowcol) + (cdr rowcol) + (ses-replace-name-in-formula + (ses-cell-formula cell) + ses--curcell + new-name)))) + (push new-name ses--renamed-cell-symb-list) + (set new-name (symbol-value ses--curcell)) + (aset cell 0 new-name) + (put ses--curcell 'ses-cell nil) + (makunbound ses--curcell) + (setq ses--curcell new-name) + (let* ((pos (point)) + (inhibit-read-only t) + (col (current-column)) + (end (save-excursion + (move-to-column (1+ col)) + (if (eolp) + (+ pos (ses-col-width col) 1) + (point))))) + (put-text-property pos end 'intangible new-name))) ) ;;---------------------------------------------------------------------------- ;; Checking formulas for safety ------------------------------------------------------------ revno: 107950 fixes bug(s): http://debbugs.gnu.org/11118 author: Peter Oliver committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 19:46:22 -0700 message: Add perl-indent-parens-as-block option (tiny change) * lisp/progmodes/perl-mode.el (perl-indent-parens-as-block): New option. (perl-calculate-indent): Respect it. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-04-17 01:35:15 +0000 +++ etc/NEWS 2012-04-17 02:46:22 +0000 @@ -70,7 +70,10 @@ ** The `server-auth-key' variable can be used to set a permanent shared key for Emacs Server. - + +** In Perl mode, new option `perl-indent-parens-as-block' causes non-block +closing brackets to be aligned with the line of the opening bracket. + ** Obsolete packages: *** mailpost.el === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-17 01:52:00 +0000 +++ lisp/ChangeLog 2012-04-17 02:46:22 +0000 @@ -1,3 +1,9 @@ +2012-04-17 Peter Oliver (tiny change) + + * progmodes/perl-mode.el (perl-indent-parens-as-block): + New option (bug#11118). + (perl-calculate-indent): Respect it. + 2012-04-17 Glenn Morris * dired-aux.el (dired-mark-read-string): Doc fix. === modified file 'lisp/progmodes/perl-mode.el' --- lisp/progmodes/perl-mode.el 2012-04-16 19:01:30 +0000 +++ lisp/progmodes/perl-mode.el 2012-04-17 02:46:22 +0000 @@ -506,6 +506,14 @@ :type '(choice integer (const nil)) :group 'perl) +(defcustom perl-indent-parens-as-block nil + "Non-nil means that non-block ()-, {}- and []-groups are indented as blocks. +The closing bracket is aligned with the line of the opening bracket, +not the contents of the brackets." + :version "24.2" + :type 'boolean + :group 'perl) + (defcustom perl-tab-always-indent tab-always-indent "Non-nil means TAB in Perl mode always indents the current line. Otherwise it inserts a tab character if you type it past the first @@ -848,7 +856,8 @@ (cond ((nth 3 state) 'noindent) ; In a quoted string? ((null containing-sexp) ; Line is at top level. (skip-chars-forward " \t\f") - (if (= (following-char) ?{) + (if (memq (following-char) + (if perl-indent-parens-as-block '(?\{ ?\( ?\[) '(?\{))) 0 ; move to beginning of line if it starts a function body ;; indent a little if this is a continuation line (perl-backward-to-noncomment) @@ -892,7 +901,9 @@ 0 perl-continued-statement-offset) (current-column) (if (save-excursion (goto-char indent-point) - (looking-at "[ \t]*{")) + (looking-at + (if perl-indent-parens-as-block + "[ \t]*[{(\[]" "[ \t]*{"))) perl-continued-brace-offset 0))) ;; This line starts a new statement. ;; Position at last unclosed open. ------------------------------------------------------------ revno: 107949 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 21:52:00 -0400 message: * lisp/dired-aux.el (dired-mark-read-string): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-17 01:49:40 +0000 +++ lisp/ChangeLog 2012-04-17 01:52:00 +0000 @@ -1,3 +1,7 @@ +2012-04-17 Glenn Morris + + * dired-aux.el (dired-mark-read-string): Doc fix. + 2012-04-17 Dmitry Antipov * dired-aux.el (dired-mark-read-string): Offer optional completion. === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2012-04-17 01:49:40 +0000 +++ lisp/dired-aux.el 2012-04-17 01:52:00 +0000 @@ -401,7 +401,10 @@ DEFAULT-VALUE, if non-nil, should be a \"standard\" value or list of such values, available via history commands. Note that if the user enters empty input, this function returns the empty string, -not DEFAULT-VALUE." +not DEFAULT-VALUE. + +Optional argument COLLECTION is a collection of possible completions, +suitable for use by `completing-read'." (dired-mark-pop-up nil op-symbol files 'completing-read (format prompt (dired-mark-prompt arg files)) ------------------------------------------------------------ revno: 107948 fixes bug(s): http://debbugs.gnu.org/7900 author: Dmitry Antipov committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 21:49:40 -0400 message: Add user, group name completion to dired Note from committer: I modified the original patch, by adding the new collection argument at the end of the argument list rather than in the middle. * dired-aux.el (dired-mark-read-string): Offer optional completion. (dired-do-chxxx): Complete chown, chgrp over users, groups. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-17 00:04:53 +0000 +++ lisp/ChangeLog 2012-04-17 01:49:40 +0000 @@ -1,3 +1,8 @@ +2012-04-17 Dmitry Antipov + + * dired-aux.el (dired-mark-read-string): Offer optional completion. + (dired-do-chxxx): Complete chown, chgrp over users, groups. (Bug#7900) + 2012-04-17 Glenn Morris * mouse.el (mouse-drag-track): === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2012-04-01 02:44:24 +0000 +++ lisp/dired-aux.el 2012-04-17 01:49:40 +0000 @@ -245,7 +245,11 @@ " (default now): " ": "))) (new-attribute (dired-mark-read-string prompt nil op-symbol - arg files default)) + arg files default + (cond ((eq op-symbol 'chown) + (system-users)) + ((eq op-symbol 'chgrp) + (system-groups))))) (operation (concat program " " new-attribute)) failures) (setq failures @@ -385,7 +389,7 @@ (dired-run-shell-command (dired-shell-stuff-it command file-list nil)))) (defun dired-mark-read-string (prompt initial op-symbol arg files - &optional default-value) + &optional default-value collection) "Read args for a Dired marked-files command, prompting with PROMPT. Return the user input (a string). @@ -399,9 +403,9 @@ user enters empty input, this function returns the empty string, not DEFAULT-VALUE." (dired-mark-pop-up nil op-symbol files - 'read-from-minibuffer + 'completing-read (format prompt (dired-mark-prompt arg files)) - initial nil nil nil default-value)) + collection nil nil initial nil default-value nil)) ;;; Cleaning a directory: flagging some backups for deletion. ------------------------------------------------------------ revno: 107947 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 21:35:15 -0400 message: * src/dired.c (Fsystem_users): Doc fix. * etc/NEWS: Mention system-users, system-groups. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-04-16 03:47:43 +0000 +++ etc/NEWS 2012-04-17 01:35:15 +0000 @@ -32,6 +32,9 @@ * Changes in Emacs 24.2 +** New functions `system-users', `system-groups' return lists of the user +name, group names known to the system (where possible). + ** If your Emacs was built from a bzr checkout, the new variable `emacs-bzr-version' contains information about which bzr revision was used. === modified file 'src/ChangeLog' --- src/ChangeLog 2012-04-17 01:29:58 +0000 +++ src/ChangeLog 2012-04-17 01:35:15 +0000 @@ -1,3 +1,7 @@ +2012-04-17 Glenn Morris + + * dired.c (Fsystem_users): Doc fix. + 2012-04-17 Dmitry Antipov * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900) === modified file 'src/dired.c' --- src/dired.c 2012-04-17 01:29:58 +0000 +++ src/dired.c 2012-04-17 01:35:15 +0000 @@ -1018,7 +1018,8 @@ DEFUN ("system-users", Fsystem_users, Ssystem_users, 0, 0, 0, doc: /* Return a list of user names currently registered in the system. -The value may be nil if not supported on this platform. */) +If we don't know how to determine that on this platform, just +return a list with one element, taken from `user-real-login-name'. */) (void) { Lisp_Object users = Qnil; ------------------------------------------------------------ revno: 107946 fixes bug(s): http://debbugs.gnu.org/7900 author: Dmitry Antipov committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 21:29:58 -0400 message: Add functions to get system user names, group names Note from committer: I removed the part that adds grp.h to AC_CHECK_HEADERS and +#ifdef HAVE_GRP_H #include +#endif to src/dired.c, because the latter has unconditionally included grp.h since 2003, and uses it eg in stat_gname. * configure.in (AC_CHECK_FUNCS): Add getpwent, endpwent, getgrent, endgrent. * src/dired.c (Fsystem_users, Fsystem_groups): New functions. (syms_of_dired): Add them. diff: === modified file 'ChangeLog' --- ChangeLog 2012-04-16 19:13:44 +0000 +++ ChangeLog 2012-04-17 01:29:58 +0000 @@ -1,3 +1,8 @@ +2012-04-17 Dmitry Antipov + + * configure.in (AC_CHECK_FUNCS): + Add getpwent, endpwent, getgrent, endgrent. (Bug#7900) + 2012-04-16 Glenn Morris * configure.in (NS_HAVE_NSINTEGER): Remove unnecessary variable. === modified file 'configure.in' --- configure.in 2012-04-16 19:13:44 +0000 +++ configure.in 2012-04-17 01:29:58 +0000 @@ -2736,6 +2736,7 @@ sendto recvfrom getsockopt setsockopt getsockname getpeername \ gai_strerror mkstemp getline getdelim mremap fsync sync \ difftime mempcpy mblen mbrlen posix_memalign \ +getpwent endpwent getgrent endgrent \ cfmakeraw cfsetspeed copysign __executable_start) dnl Cannot use AC_CHECK_FUNCS === modified file 'src/ChangeLog' --- src/ChangeLog 2012-04-16 06:39:21 +0000 +++ src/ChangeLog 2012-04-17 01:29:58 +0000 @@ -1,3 +1,8 @@ +2012-04-17 Dmitry Antipov + + * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900) + (syms_of_dired): Add them. + 2012-04-16 Paul Eggert Fix minor alloc.c problems found by static checking. === modified file 'src/dired.c' --- src/dired.c 2012-01-19 07:21:25 +0000 +++ src/dired.c 2012-04-17 01:29:58 +0000 @@ -1015,6 +1015,45 @@ return Fstring_lessp (Fcar (f1), Fcar (f2)); } + +DEFUN ("system-users", Fsystem_users, Ssystem_users, 0, 0, 0, + doc: /* Return a list of user names currently registered in the system. +The value may be nil if not supported on this platform. */) + (void) +{ + Lisp_Object users = Qnil; +#if defined(HAVE_GETPWENT) && defined(HAVE_ENDPWENT) + struct passwd *pw; + + while ((pw = getpwent ())) + users = Fcons (DECODE_SYSTEM (build_string (pw->pw_name)), users); + + endpwent (); +#endif + if (EQ (users, Qnil)) + /* At least current user is always known. */ + users = Fcons (Vuser_real_login_name, Qnil); + return users; +} + +DEFUN ("system-groups", Fsystem_groups, Ssystem_groups, 0, 0, 0, + doc: /* Return a list of user group names currently registered in the system. +The value may be nil if not supported on this platform. */) + (void) +{ + Lisp_Object groups = Qnil; +#if defined(HAVE_GETGRENT) && defined(HAVE_ENDGRENT) + struct group *gr; + int length; + + while ((gr = getgrent ())) + groups = Fcons (DECODE_SYSTEM (build_string (gr->gr_name)), groups); + + endgrent (); +#endif + return groups; +} + void syms_of_dired (void) { @@ -1032,6 +1071,8 @@ defsubr (&Sfile_name_all_completions); defsubr (&Sfile_attributes); defsubr (&Sfile_attributes_lessp); + defsubr (&Ssystem_users); + defsubr (&Ssystem_groups); DEFVAR_LISP ("completion-ignored-extensions", Vcompletion_ignored_extensions, doc: /* Completion ignores file names ending in any string in this list. ------------------------------------------------------------ revno: 107945 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 20:04:53 -0400 message: Use auto-hscroll-mode rather than the alias automatic-hscrolling * lisp/mouse.el (mouse-drag-track): * lisp/speedbar.el (speedbar-frame-mode): Use auto-hscroll-mode rather than the alias automatic-hscrolling. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-16 23:57:09 +0000 +++ lisp/ChangeLog 2012-04-17 00:04:53 +0000 @@ -1,3 +1,9 @@ +2012-04-17 Glenn Morris + + * mouse.el (mouse-drag-track): + * speedbar.el (speedbar-frame-mode): + Use auto-hscroll-mode rather than the alias automatic-hscrolling. + 2012-04-16 Leo Liu * progmodes/python.el: Trivial cleanup. === modified file 'lisp/mouse.el' --- lisp/mouse.el 2012-01-19 07:21:25 +0000 +++ lisp/mouse.el 2012-04-17 00:04:53 +0000 @@ -1,6 +1,6 @@ ;;; mouse.el --- window system-independent mouse support -;; Copyright (C) 1993-1995, 1999-2012 Free Software Foundation, Inc. +;; Copyright (C) 1993-1995, 1999-2012 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: hardware, mouse @@ -805,8 +805,8 @@ (= click-count 1))) ;; Suppress automatic hscrolling, because that is a nuisance ;; when setting point near the right fringe (but see below). - (automatic-hscrolling-saved automatic-hscrolling) - (automatic-hscrolling nil) + (auto-hscroll-mode-saved auto-hscroll-mode) + (auto-hscroll-mode nil) event end end-point) (setq mouse-selection-click-count click-count) @@ -838,7 +838,7 @@ ;; Automatic hscrolling did not occur during the call to ;; `read-event'; but if the user subsequently drags the ;; mouse, go ahead and hscroll. - (let ((automatic-hscrolling automatic-hscrolling-saved)) + (let ((auto-hscroll-mode auto-hscroll-mode-saved)) (redisplay)) (setq end (event-end event) end-point (posn-point end)) === modified file 'lisp/speedbar.el' --- lisp/speedbar.el 2012-03-10 07:58:54 +0000 +++ lisp/speedbar.el 2012-04-17 00:04:53 +0000 @@ -1,6 +1,6 @@ ;;; speedbar --- quick access to files and tags in a frame -;; Copyright (C) 1996-2012 Free Software Foundation, Inc. +;; Copyright (C) 1996-2012 Free Software Foundation, Inc. ;; Author: Eric M. Ludlam ;; Keywords: file, tags, tools @@ -1022,7 +1022,7 @@ (set (make-local-variable 'dframe-delete-frame-function) 'speedbar-handle-delete-frame) ;; hscroll - (set (make-local-variable 'automatic-hscrolling) nil) ; Emacs 21 + (set (make-local-variable 'auto-hscroll-mode) nil) ;; reset the selection variable (setq speedbar-last-selected-file nil)) ------------------------------------------------------------ revno: 107944 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 19:57:09 -0400 message: Replace independent implementations of string-prefix-p * vc/vc.el (vc-string-prefix-p): * vc/pcvs-util.el (cvs-string-prefix-p): * textmodes/tex-mode.el (latex-string-prefix-p, tex-string-prefix-p): * mpc.el (mpc-string-prefix-p): Make all of these into obsolete aliases for string-prefix-p. Update callers. * vc/pcvs.el, vc/vc-dispatcher.el, vc/vc-dir.el: Update callers. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-16 20:13:38 +0000 +++ lisp/ChangeLog 2012-04-16 23:57:09 +0000 @@ -4,6 +4,14 @@ 2012-04-16 Glenn Morris + * vc/vc.el (vc-string-prefix-p): + * vc/pcvs-util.el (cvs-string-prefix-p): + * textmodes/tex-mode.el (latex-string-prefix-p, tex-string-prefix-p): + * mpc.el (mpc-string-prefix-p): + Make all of these into obsolete aliases for string-prefix-p. + Update callers. + * vc/pcvs.el, vc/vc-dispatcher.el, vc/vc-dir.el: Update callers. + * textmodes/two-column.el: Move custom options to the start. (frame-width): Remove compat definition. (2C-associate-buffer, 2C-dissociate): === modified file 'lisp/mpc.el' --- lisp/mpc.el 2012-01-19 07:21:25 +0000 +++ lisp/mpc.el 2012-04-16 23:57:09 +0000 @@ -1,6 +1,6 @@ ;;; mpc.el --- A client for the Music Player Daemon -*- coding: utf-8; lexical-binding: t -*- -;; Copyright (C) 2006-2012 Free Software Foundation, Inc. +;; Copyright (C) 2006-2012 Free Software Foundation, Inc. ;; Author: Stefan Monnier ;; Keywords: multimedia @@ -184,10 +184,7 @@ (abs res)) res)))))))) -(defun mpc-string-prefix-p (str1 str2) - ;; FIXME: copied from pcvs-util.el. - "Tell whether STR1 is a prefix of STR2." - (eq t (compare-strings str2 nil (length str1) str1 nil nil))) +(define-obsolete-function-alias 'mpc-string-prefix-p 'string-prefix-p "24.2") ;; This can speed up mpc--song-search significantly. The table may grow ;; very large, tho. It's only bounded by the fact that it gets flushed @@ -1690,7 +1687,7 @@ (process-put (mpc-proc) prop (delq nil (mapcar (lambda (x) - (if (mpc-string-prefix-p name x) + (if (string-prefix-p name x) nil x)) new))))) (mpc-tagbrowser-refresh))) === modified file 'lisp/textmodes/tex-mode.el' --- lisp/textmodes/tex-mode.el 2012-04-09 13:05:48 +0000 +++ lisp/textmodes/tex-mode.el 2012-04-16 23:57:09 +0000 @@ -1492,8 +1492,8 @@ (defvar latex-complete-bibtex-cache nil) -(defun latex-string-prefix-p (str1 str2) - (eq t (compare-strings str1 nil nil str2 0 (length str1)))) +(define-obsolete-function-alias 'latex-string-prefix-p + 'string-prefix-p "24.2") (defvar bibtex-reference-key) (declare-function reftex-get-bibfile-list "reftex-cite.el" ()) @@ -1507,7 +1507,7 @@ keys) (if (and (eq (car latex-complete-bibtex-cache) (reftex-get-bibfile-list)) - (latex-string-prefix-p (nth 1 latex-complete-bibtex-cache) + (string-prefix-p (nth 1 latex-complete-bibtex-cache) key)) ;; Use the cache. (setq keys (nth 2 latex-complete-bibtex-cache)) @@ -2051,10 +2051,7 @@ OUT describes the output file and is either a %-escaped string or nil to indicate that there is no output file.") -;; defsubst* gives better byte-code than defsubst. -(defsubst* tex-string-prefix-p (str1 str2) - "Return non-nil if STR1 is a prefix of STR2" - (eq t (compare-strings str2 nil (length str1) str1 nil nil))) +(define-obsolete-function-alias 'tex-string-prefix-p 'string-prefix-p "24.2") (defun tex-guess-main-file (&optional all) "Find a likely `tex-main-file'. @@ -2069,7 +2066,7 @@ (with-current-buffer buf (when (and (cond ((null all) (equal dir default-directory)) - ((eq all 'sub) (tex-string-prefix-p default-directory dir)) + ((eq all 'sub) (string-prefix-p default-directory dir)) (t)) (stringp tex-main-file)) (throw 'found (expand-file-name tex-main-file))))) @@ -2078,7 +2075,7 @@ (with-current-buffer buf (when (and (cond ((null all) (equal dir default-directory)) - ((eq all 'sub) (tex-string-prefix-p default-directory dir)) + ((eq all 'sub) (string-prefix-p default-directory dir)) (t)) buffer-file-name ;; (or (easy-mmode-derived-mode-p 'latex-mode) === modified file 'lisp/vc/pcvs-util.el' --- lisp/vc/pcvs-util.el 2012-01-19 07:21:25 +0000 +++ lisp/vc/pcvs-util.el 2012-04-16 23:57:09 +0000 @@ -182,9 +182,7 @@ (if oneline (line-end-position) (point-max)))) (file-error nil))) -(defun cvs-string-prefix-p (str1 str2) - "Tell whether STR1 is a prefix of STR2." - (eq t (compare-strings str2 nil (length str1) str1 nil nil))) +(define-obsolete-function-alias 'cvs-string-prefix-p 'string-prefix-p "24.2") ;;;; ;;;; file names === modified file 'lisp/vc/pcvs.el' --- lisp/vc/pcvs.el 2012-01-23 08:45:59 +0000 +++ lisp/vc/pcvs.el 2012-04-16 23:57:09 +0000 @@ -432,8 +432,8 @@ (case cvs-reuse-cvs-buffer (always t) (subdir - (or (cvs-string-prefix-p default-directory dir) - (cvs-string-prefix-p dir default-directory))) + (or (string-prefix-p default-directory dir) + (string-prefix-p dir default-directory))) (samedir (string= default-directory dir))) (return buffer))))) ;; we really have to create a new buffer: @@ -887,7 +887,7 @@ (eq (cvs-fileinfo->type last-fi) 'DIRCHANGE) (not (when first-dir (setq first-dir nil) t)) (or (eq rm-dirs 'all) - (not (cvs-string-prefix-p + (not (string-prefix-p (cvs-fileinfo->dir last-fi) (cvs-fileinfo->dir fi))) (and (eq type 'DIRCHANGE) (eq rm-dirs 'empty)) @@ -1839,7 +1839,7 @@ (setq buffer-file-name (expand-file-name buffer-file-name)) (let (ret) (dolist (fi (or fis (list (cvs-create-fileinfo 'DIRCHANGE "" "." "")))) - (when (cvs-string-prefix-p + (when (string-prefix-p (expand-file-name (cvs-fileinfo->full-name fi) dir) buffer-file-name) (setq ret t))) @@ -2261,7 +2261,7 @@ (defun cvs-dir-member-p (fileinfo dir) "Return true if FILEINFO represents a file in directory DIR." (and (not (eq (cvs-fileinfo->type fileinfo) 'DIRCHANGE)) - (cvs-string-prefix-p dir (cvs-fileinfo->dir fileinfo)))) + (string-prefix-p dir (cvs-fileinfo->dir fileinfo)))) (defun cvs-execute-single-file (fi extractor program constant-args) "Internal function for `cvs-execute-single-file-list'." @@ -2392,7 +2392,7 @@ (set-buffer cvs-buf) ;; look for a corresponding pcl-cvs buffer (when (and (eq major-mode 'cvs-mode) - (cvs-string-prefix-p default-directory dir)) + (string-prefix-p default-directory dir)) (let ((subdir (substring dir (length default-directory)))) (set-buffer buffer) (set (make-local-variable 'cvs-buffer) cvs-buf) @@ -2423,7 +2423,7 @@ (set-buffer cvs-buf) ;; look for a corresponding pcl-cvs buffer (when (and (eq major-mode 'cvs-mode) - (cvs-string-prefix-p default-directory file)) + (string-prefix-p default-directory file)) (let* ((file (substring file (length default-directory))) (fi (cvs-create-fileinfo (if (string= "0" version) === modified file 'lisp/vc/vc-dir.el' --- lisp/vc/vc-dir.el 2012-01-19 07:21:25 +0000 +++ lisp/vc/vc-dir.el 2012-04-16 23:57:09 +0000 @@ -1,6 +1,6 @@ ;;; vc-dir.el --- Directory status display under VC -;; Copyright (C) 2007-2012 Free Software Foundation, Inc. +;; Copyright (C) 2007-2012 Free Software Foundation, Inc. ;; Author: Dan Nicolaescu ;; Keywords: vc tools @@ -556,7 +556,7 @@ (let ((data (ewoc-data crt)) (dir (vc-dir-node-directory crt))) (and (vc-dir-fileinfo->directory data) - (vc-string-prefix-p dir argdir) + (string-prefix-p dir argdir) (vc-dir-fileinfo->marked data) (setq found data)))) found)) @@ -818,7 +818,7 @@ data) (while (and (setq crt (ewoc-next vc-ewoc crt)) - (vc-string-prefix-p dir + (string-prefix-p dir (progn (setq data (ewoc-data crt)) (vc-dir-node-directory crt)))) @@ -846,7 +846,7 @@ data) (while (and (setq crt (ewoc-next vc-ewoc crt)) - (vc-string-prefix-p dir (progn + (string-prefix-p dir (progn (setq data (ewoc-data crt)) (vc-dir-node-directory crt)))) (unless (vc-dir-fileinfo->directory data) @@ -878,10 +878,10 @@ children dname) ;; Find DIR - (while (and crt (not (vc-string-prefix-p + (while (and crt (not (string-prefix-p dirname (vc-dir-node-directory crt)))) (setq crt (ewoc-next vc-ewoc crt))) - (while (and crt (vc-string-prefix-p + (while (and crt (string-prefix-p dirname (setq dname (vc-dir-node-directory crt)))) (let ((data (ewoc-data crt))) @@ -915,7 +915,7 @@ (if (not (derived-mode-p 'vc-dir-mode)) (push status-buf drop) (let ((ddir default-directory)) - (when (vc-string-prefix-p ddir file) + (when (string-prefix-p ddir file) (if (file-directory-p file) (progn (vc-dir-resync-directory-files file) === modified file 'lisp/vc/vc-dispatcher.el' --- lisp/vc/vc-dispatcher.el 2012-01-19 07:21:25 +0000 +++ lisp/vc/vc-dispatcher.el 2012-04-16 23:57:09 +0000 @@ -537,13 +537,12 @@ (kill-buffer (current-buffer))))) (declare-function vc-dir-resynch-file "vc-dir" (&optional fname)) -(declare-function vc-string-prefix-p "vc" (prefix string)) (defun vc-resynch-buffers-in-directory (directory &optional keep noquery reset-vc-info) "Resync all buffers that visit files in DIRECTORY." (dolist (buffer (buffer-list)) (let ((fname (buffer-file-name buffer))) - (when (and fname (vc-string-prefix-p directory fname)) + (when (and fname (string-prefix-p directory fname)) (with-current-buffer buffer (vc-resynch-buffer fname keep noquery reset-vc-info)))))) === modified file 'lisp/vc/vc.el' --- lisp/vc/vc.el 2012-03-24 13:23:23 +0000 +++ lisp/vc/vc.el 2012-04-16 23:57:09 +0000 @@ -1,6 +1,6 @@ ;;; vc.el --- drive a version-control system from within Emacs -;; Copyright (C) 1992-1998, 2000-2012 Free Software Foundation, Inc. +;; Copyright (C) 1992-1998, 2000-2012 Free Software Foundation, Inc. ;; Author: FSF (see below for full credits) ;; Maintainer: Andre Spiegel @@ -847,7 +847,7 @@ (if (file-directory-p file) (dolist (buffer (buffer-list)) (let ((fname (buffer-file-name buffer))) - (when (and fname (vc-string-prefix-p file fname)) + (when (and fname (string-prefix-p file fname)) (push fname flist)))) (push file flist))) ,form @@ -900,7 +900,7 @@ (lambda (arg) (message "arg %s" arg) (and (file-directory-p arg) - (vc-string-prefix-p (expand-file-name arg) def-dir))))))) + (string-prefix-p (expand-file-name arg) def-dir))))))) (let ((default-directory repo-dir)) (vc-call-backend bk 'create-repo)) (throw 'found bk)))) @@ -2809,11 +2809,7 @@ ;; These things should probably be generally available - -(defun vc-string-prefix-p (prefix string) - (let ((lpref (length prefix))) - (and (>= (length string) lpref) - (eq t (compare-strings prefix nil nil string nil lpref))))) +(define-obsolete-function-alias 'vc-string-prefix-p 'string-prefix-p "24.2") (defun vc-file-tree-walk (dirname func &rest args) "Walk recursively through DIRNAME. ------------------------------------------------------------ revno: 107943 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 19:07:19 -0400 message: Fix thinko in previous yow.el change diff: === modified file 'lisp/play/yow.el' --- lisp/play/yow.el 2012-04-16 19:02:59 +0000 +++ lisp/play/yow.el 2012-04-16 23:07:19 +0000 @@ -34,7 +34,7 @@ :prefix "yow-" :group 'games) -(defcustom yow-file (expand-file-name data-directory "yow.lines") +(defcustom yow-file (expand-file-name "yow.lines" data-directory) "File containing pertinent pinhead phrases." :type 'file :group 'yow) ------------------------------------------------------------ revno: 107942 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 16:13:38 -0400 message: two-column.el small cleanup * lisp/textmodes/two-column.el: Move custom options to the start. (frame-width): Remove compat definition. (2C-associate-buffer, 2C-dissociate): Use with-current-buffer rather than save-excursion. (2C-dissociate): Force a mode-line update. (2C-autoscroll): Use ignore-errors. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-16 19:28:57 +0000 +++ lisp/ChangeLog 2012-04-16 20:13:38 +0000 @@ -4,6 +4,13 @@ 2012-04-16 Glenn Morris + * textmodes/two-column.el: Move custom options to the start. + (frame-width): Remove compat definition. + (2C-associate-buffer, 2C-dissociate): + Use with-current-buffer rather than save-excursion. + (2C-dissociate): Force a mode-line update. + (2C-autoscroll): Use ignore-errors. + * emacs-lisp/eieio-opt.el (describe-class, describe-generic): Autoload trivia. === modified file 'lisp/textmodes/two-column.el' --- lisp/textmodes/two-column.el 2012-01-19 07:21:25 +0000 +++ lisp/textmodes/two-column.el 2012-04-16 20:13:38 +0000 @@ -124,15 +124,51 @@ ;;; Code: +(defgroup two-column nil + "Minor mode for editing of two-column text." + :prefix "2C-" + :group 'frames) + +(defcustom 2C-mode-line-format + '("-%*- %15b --" (-3 . "%p") "--%[(" mode-name + minor-mode-alist "%n" mode-line-process ")%]%-") + "Value of `mode-line-format' for a buffer in two-column minor mode." + :type 'sexp + :group 'two-column) + +(defcustom 2C-other-buffer-hook 'text-mode + "Hook run in new buffer when it is associated with current one." + :type 'function + :group 'two-column) + +(defcustom 2C-separator "" + "A string inserted between the two columns when merging. +This gets set locally by \\[2C-split]." + :type 'string + :group 'two-column) +(put '2C-separator 'permanent-local t) + +(defcustom 2C-window-width 40 + "The width of the first column. (Must be at least `window-min-width'.) +This value is local for every buffer that sets it." + :type 'integer + :group 'two-column) +(make-variable-buffer-local '2C-window-width) +(put '2C-window-width 'permanent-local t) + +(defcustom 2C-beyond-fill-column 4 + "Base for calculating `fill-column' for a buffer in two-column minor mode. +The value of `fill-column' becomes `2C-window-width' for this buffer +minus this value." + :type 'integer + :group 'two-column) + +(defcustom 2C-autoscroll t + "If non-nil, Emacs attempts to keep the two column's buffers aligned." + :type 'boolean + :group 'two-column) + - -;; Lucid patch -(or (fboundp 'frame-width) - (fset 'frame-width 'screen-width)) - - -;;;;; Set up keymap ;;;;; - (defvar 2C-mode-map (let ((map (make-sparse-keymap))) (define-key map "2" '2C-two-columns) @@ -142,8 +178,6 @@ map) "Keymap for commands for setting up two-column mode.") - - ;;;###autoload (autoload '2C-command "two-column" () t 'keymap) (fset '2C-command 2C-mode-map) @@ -154,7 +188,6 @@ ;;;###autoload (global-set-key [f2] '2C-command) - (defvar 2C-minor-mode-map (let ((map (make-sparse-keymap))) (define-key map "1" '2C-merge) @@ -167,7 +200,6 @@ map) "Keymap for commands for use in two-column mode.") - (setq minor-mode-map-alist (cons (cons '2C-mode (let ((map (make-sparse-keymap))) @@ -181,15 +213,8 @@ map (current-global-map)) map)) minor-mode-map-alist)) + -;;;;; variable declarations ;;;;; - -(defgroup two-column nil - "Minor mode for editing of two-column text." - :prefix "2C-" - :group 'frames) - - ;; Markers seem to be the only buffer-id not affected by renaming a buffer. ;; This nevertheless loses when a buffer is killed. The variable-name is ;; required by `describe-mode'. @@ -198,62 +223,8 @@ (make-variable-buffer-local '2C-mode) (put '2C-mode 'permanent-local t) - - (setq minor-mode-alist (cons '(2C-mode " 2C") minor-mode-alist)) - - -;; rearranged, so that the pertinent info will show in 40 columns -(defcustom 2C-mode-line-format - '("-%*- %15b --" (-3 . "%p") "--%[(" mode-name - minor-mode-alist "%n" mode-line-process ")%]%-") - "Value of `mode-line-format' for a buffer in two-column minor mode." - :type 'sexp - :group 'two-column) - - -(defcustom 2C-other-buffer-hook 'text-mode - "Hook run in new buffer when it is associated with current one." - :type 'function - :group 'two-column) - - -(defcustom 2C-separator "" - "A string inserted between the two columns when merging. -This gets set locally by \\[2C-split]." - :type 'string - :group 'two-column) -(put '2C-separator 'permanent-local t) - - - -(defcustom 2C-window-width 40 - "The width of the first column. (Must be at least `window-min-width') -This value is local for every buffer that sets it." - :type 'integer - :group 'two-column) -(make-variable-buffer-local '2C-window-width) -(put '2C-window-width 'permanent-local t) - - - -(defcustom 2C-beyond-fill-column 4 - "Base for calculating `fill-column' for a buffer in two-column minor mode. -The value of `fill-column' becomes `2C-window-width' for this buffer -minus this value." - :type 'integer - :group 'two-column) - - - -(defcustom 2C-autoscroll t - "If non-nil, Emacs attempts to keep the two column's buffers aligned." - :type 'boolean - :group 'two-column) - - - (defvar 2C-autoscroll-start nil) (make-variable-buffer-local '2C-autoscroll-start) @@ -276,7 +247,6 @@ (if req (error "You must first set two-column minor mode")))) - ;; function for setting up two-column minor mode in a buffer associated ;; with the buffer pointed to by the marker other. (defun 2C-mode (other) @@ -320,7 +290,6 @@ (run-hooks '2C-mode-hook)) - ;;;###autoload (defun 2C-two-columns (&optional buffer) "Split current window vertically for two-column editing. @@ -356,7 +325,6 @@ (other-window -1))))) - ;;;###autoload (defun 2C-associate-buffer () "Associate another buffer with this one in two-column minor mode. @@ -368,9 +336,8 @@ (let ((b1 (current-buffer)) (b2 (or (2C-other) (read-buffer "Associate buffer: " (other-buffer))))) - (save-excursion - (setq 2C-mode nil) - (set-buffer b2) + (setq 2C-mode nil) + (with-current-buffer b2 (and (2C-other) (not (eq b1 (2C-other))) (error "Buffer already associated with buffer `%s'" @@ -382,7 +349,6 @@ (2C-two-columns b2))) - ;;;###autoload (defun 2C-split (arg) "Split a two-column text at point, into two buffers in two-column minor mode. @@ -454,32 +420,28 @@ (move-to-column column))))) - - (defun 2C-dissociate () "Turn off two-column minor mode in current and associated buffer. If the associated buffer is unmodified and empty, it is killed." (interactive) - (let ((buffer (current-buffer))) - (save-excursion - (and (2C-other) - (set-buffer (2C-other)) - (or (not (2C-other)) - (eq buffer (2C-other))) - (if (and (not (buffer-modified-p)) - (eobp) (bobp)) - (kill-buffer nil) - (kill-local-variable '2C-mode) - (kill-local-variable '2C-window-width) - (kill-local-variable '2C-separator) - (kill-local-variable 'mode-line-format) - (kill-local-variable 'fill-column)))) - (kill-local-variable '2C-mode) - (kill-local-variable '2C-window-width) - (kill-local-variable '2C-separator) - (kill-local-variable 'mode-line-format) - (kill-local-variable 'fill-column))) - + (let ((buffer (current-buffer)) + (other (2C-other))) + (if other + (with-current-buffer other + (when (or (not (2C-other)) (eq buffer (2C-other))) + (if (and (not (buffer-modified-p)) (zerop (buffer-size))) + (kill-buffer) + (kill-local-variable '2C-mode) + (kill-local-variable '2C-window-width) + (kill-local-variable '2C-separator) + (kill-local-variable 'mode-line-format) + (kill-local-variable 'fill-column)))))) + (kill-local-variable '2C-mode) + (kill-local-variable '2C-window-width) + (kill-local-variable '2C-separator) + (kill-local-variable 'mode-line-format) + (kill-local-variable 'fill-column) + (force-mode-line-update)) ;; this doesn't use yank-rectangle, so that the first column can @@ -578,7 +540,6 @@ (message "Autoscrolling is off."))) - (defun 2C-autoscroll () (if 2C-autoscroll ;; catch a mouse scroll on non-selected scrollbar @@ -590,27 +551,25 @@ (select-window (car (car (cdr last-command-event))))) ;; In some cases scrolling causes an error, but post-command-hook ;; shouldn't, and should always stay in the original window - (condition-case () - (and (or 2C-autoscroll-start (2C-toggle-autoscroll t) nil) - (/= (window-start) 2C-autoscroll-start) - (2C-other) - (get-buffer-window (2C-other)) - (let ((lines (count-lines (window-start) - 2C-autoscroll-start))) - (if (< (window-start) 2C-autoscroll-start) - (setq lines (- lines))) - (setq 2C-autoscroll-start (window-start)) - (select-window (get-buffer-window (2C-other))) - ;; make sure that other buffer has enough lines - (save-excursion - (insert-char - ?\n (- lines (count-lines (window-start) - (goto-char (point-max))) - -1))) - (scroll-up lines) - (setq 2C-autoscroll-start (window-start)))) - (error)))))) - + (ignore-errors + (and (or 2C-autoscroll-start (2C-toggle-autoscroll t) nil) + (/= (window-start) 2C-autoscroll-start) + (2C-other) + (get-buffer-window (2C-other)) + (let ((lines (count-lines (window-start) + 2C-autoscroll-start))) + (if (< (window-start) 2C-autoscroll-start) + (setq lines (- lines))) + (setq 2C-autoscroll-start (window-start)) + (select-window (get-buffer-window (2C-other))) + ;; make sure that other buffer has enough lines + (save-excursion + (insert-char + ?\n (- lines (count-lines (window-start) + (goto-char (point-max))) + -1))) + (scroll-up lines) + (setq 2C-autoscroll-start (window-start))))))))) (defun 2C-enlarge-window-horizontally (arg) @@ -628,7 +587,6 @@ (2C-enlarge-window-horizontally (- arg))) - (provide 'two-column) ;;; two-column.el ends here ------------------------------------------------------------ revno: 107941 committer: Leo Liu branch nick: trunk timestamp: Tue 2012-04-17 03:28:57 +0800 message: * lisp/progmodes/python.el: Trivial cleanup. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-16 19:25:59 +0000 +++ lisp/ChangeLog 2012-04-16 19:28:57 +0000 @@ -1,3 +1,7 @@ +2012-04-16 Leo Liu + + * progmodes/python.el: Trivial cleanup. + 2012-04-16 Glenn Morris * emacs-lisp/eieio-opt.el (describe-class, describe-generic): === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-04-10 11:27:44 +0000 +++ lisp/progmodes/python.el 2012-04-16 19:28:57 +0000 @@ -69,11 +69,7 @@ (require 'comint) (require 'ansi-color) -(eval-when-compile - (require 'compile) - (require 'hippie-exp)) - -(autoload 'comint-mode "comint") +(eval-when-compile (require 'compile)) (defgroup python nil "Silly walks in the Python language." @@ -1488,8 +1484,6 @@ res) (t (concat res s))))) -(autoload 'comint-check-proc "comint") - (defvar python-version-checked nil) (defun python-check-version (cmd) "Check that CMD runs a suitable version of Python." @@ -1684,8 +1678,6 @@ "Caches (directory . file) pair used in the last `python-load-file' command. Used for determining the default in the next one.") -(autoload 'comint-get-source "comint") - (defun python-load-file (file-name) "Load a Python file FILE-NAME into the inferior Python process. If the file has extension `.py' import or reload it as a module. ------------------------------------------------------------ revno: 107940 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 15:25:59 -0400 message: * eieio-opt.el (describe-class, describe-generic): Autoload trivia. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-16 19:22:32 +0000 +++ lisp/ChangeLog 2012-04-16 19:25:59 +0000 @@ -1,5 +1,8 @@ 2012-04-16 Glenn Morris + * emacs-lisp/eieio-opt.el (describe-class, describe-generic): + Autoload trivia. + * emacs-lisp/cl-extra.el (*random-state*): Remove unnecessary declaration. === modified file 'lisp/emacs-lisp/eieio-opt.el' --- lisp/emacs-lisp/eieio-opt.el 2012-01-19 07:21:25 +0000 +++ lisp/emacs-lisp/eieio-opt.el 2012-04-16 19:25:59 +0000 @@ -72,8 +72,7 @@ ;;; CLASS COMPLETION / DOCUMENTATION -;;;###autoload -(defalias 'describe-class 'eieio-describe-class) +;;;###autoload(defalias 'describe-class 'eieio-describe-class) ;;;###autoload (defun eieio-describe-class (class &optional headerfcn) @@ -305,8 +304,7 @@ ;;; METHOD COMPLETION / DOC (defalias 'describe-method 'eieio-describe-generic) -;;;###autoload -(defalias 'describe-generic 'eieio-describe-generic) +;;;###autoload(defalias 'describe-generic 'eieio-describe-generic) (defalias 'eieio-describe-method 'eieio-describe-generic) ;;;###autoload ------------------------------------------------------------ revno: 107939 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 15:22:32 -0400 message: ChangeLog fix diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-16 19:20:42 +0000 +++ lisp/ChangeLog 2012-04-16 19:22:32 +0000 @@ -1345,10 +1345,6 @@ 2012-02-24 Thierry Volpiatto - * files.el (file-subdir-of-p): Fix typo. - -2012-02-24 Thierry Volpiatto - * files.el (files-equal-p, file-subdir-of-p): New functions. (copy-directory): Error when trying to copy a directory on itself. Add missing copy-contents arg to tramp handler. ------------------------------------------------------------ revno: 107938 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 15:21:32 -0400 message: Header comment trivial fix diff: === modified file 'lisp/emacs-lisp/ert-x.el' --- lisp/emacs-lisp/ert-x.el 2012-02-04 21:18:46 +0000 +++ lisp/emacs-lisp/ert-x.el 2012-04-16 19:21:32 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2008, 2010-2012 Free Software Foundation, Inc. ;; Author: Lennart Borgman (lennart O borgman A gmail O com) -;; Author: Christian Ohler +;; Christian Ohler ;; This file is part of GNU Emacs. ------------------------------------------------------------ revno: 107937 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 15:20:42 -0400 message: * lisp/emacs-lisp/cl-extra.el (*random-state*): Remove unnecessary declaration. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-16 19:18:36 +0000 +++ lisp/ChangeLog 2012-04-16 19:20:42 +0000 @@ -1,5 +1,8 @@ 2012-04-16 Glenn Morris + * emacs-lisp/cl-extra.el (*random-state*): + Remove unnecessary declaration. + * calendar/cal-tex.el (cal-tex-end-document): Trivial clarification. * play/cookie1.el (cookie-snarf): === modified file 'lisp/emacs-lisp/cl-extra.el' --- lisp/emacs-lisp/cl-extra.el 2012-01-19 07:21:25 +0000 +++ lisp/emacs-lisp/cl-extra.el 2012-04-16 19:20:42 +0000 @@ -1,6 +1,6 @@ ;;; cl-extra.el --- Common Lisp features, part 2 -;; Copyright (C) 1993, 2000-2012 Free Software Foundation, Inc. +;; Copyright (C) 1993, 2000-2012 Free Software Foundation, Inc. ;; Author: Dave Gillespie ;; Keywords: extensions @@ -430,7 +430,6 @@ ;; Random numbers. -(defvar *random-state*) ;;;###autoload (defun random* (lim &optional state) "Return a random nonnegative number less than LIM, an integer or float. ------------------------------------------------------------ revno: 107936 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 15:18:36 -0400 message: * lisp/calendar/cal-tex.el (cal-tex-end-document): Trivial clarification. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-16 19:04:27 +0000 +++ lisp/ChangeLog 2012-04-16 19:18:36 +0000 @@ -1,5 +1,7 @@ 2012-04-16 Glenn Morris + * calendar/cal-tex.el (cal-tex-end-document): Trivial clarification. + * play/cookie1.el (cookie-snarf): Give an explicit error if input file cannot be read. === modified file 'lisp/calendar/cal-tex.el' --- lisp/calendar/cal-tex.el 2012-01-19 07:21:25 +0000 +++ lisp/calendar/cal-tex.el 2012-04-16 19:18:36 +0000 @@ -1,6 +1,6 @@ ;;; cal-tex.el --- calendar functions for printing calendars with LaTeX -;; Copyright (C) 1995, 2001-2012 Free Software Foundation, Inc. +;; Copyright (C) 1995, 2001-2012 Free Software Foundation, Inc. ;; Author: Steve Fisk ;; Edward M. Reingold @@ -1588,8 +1588,7 @@ (cal-tex-e-document) (or (and cal-tex-preamble-extra (string-match "inputenc" cal-tex-preamble-extra)) - (not (re-search-backward "[^[:ascii:]]" nil 'move)) - (progn + (when (re-search-backward "[^[:ascii:]]" nil 'move) (goto-char (point-min)) (when (search-forward "documentclass" nil t) (forward-line 1) ------------------------------------------------------------ revno: 107935 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 15:13:44 -0400 message: * configure.in (NS_HAVE_NSINTEGER): Remove unnecessary variable. diff: === modified file 'ChangeLog' --- ChangeLog 2012-04-16 18:32:59 +0000 +++ ChangeLog 2012-04-16 19:13:44 +0000 @@ -1,5 +1,7 @@ 2012-04-16 Glenn Morris + * configure.in (NS_HAVE_NSINTEGER): Remove unnecessary variable. + * configure.in: Remove X libs workaround for old autoconf. 2012-04-12 Ken Brown === modified file 'configure.in' --- configure.in 2012-04-16 18:32:59 +0000 +++ configure.in 2012-04-16 19:13:44 +0000 @@ -1541,13 +1541,12 @@ AC_CHECK_HEADER([AppKit/AppKit.h], [HAVE_NS=yes], [AC_MSG_ERROR([`--with-ns' was specified, but the include files are missing or cannot be compiled.])]) - NS_HAVE_NSINTEGER=yes AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], [NSInteger i;])], ns_have_nsinteger=yes, ns_have_nsinteger=no) - if test $ns_have_nsinteger = no; then - NS_HAVE_NSINTEGER=no + if test $ns_have_nsinteger = yes; then + AC_DEFINE(NS_HAVE_NSINTEGER, 1, [Define to 1 if `NSInteger' is defined.]) fi fi AC_SUBST(TEMACS_LDFLAGS2) @@ -2595,9 +2594,6 @@ ## Extra CFLAGS applied to src/*.m files. GNU_OBJC_CFLAGS="$GNU_OBJC_CFLAGS -fgnu-runtime -Wno-import -fconstant-string-class=NSConstantString -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGSWARN -DGSDIAGNOSE" fi - if test "${NS_HAVE_NSINTEGER}" = "yes"; then - AC_DEFINE(NS_HAVE_NSINTEGER, 1, [Define to 1 if `NSInteger' is defined.]) - fi # We also have mouse menus. HAVE_MENUS=yes OTHER_FILES=ns-app ------------------------------------------------------------ revno: 107934 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 15:09:19 -0400 message: * lisp/gnus/nndraft.el (nndraft-request-list): Fix declaration. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-04-14 01:46:06 +0000 +++ lisp/gnus/ChangeLog 2012-04-16 19:09:19 +0000 @@ -1,3 +1,7 @@ +2012-04-16 Glenn Morris + + * nndraft.el (nndraft-request-list): Fix declaration. + 2012-04-14 Lars Magne Ingebrigtsen * gnus-msg.el (gnus-inews-insert-gcc): Don't do the alist stuff when we === modified file 'lisp/gnus/nndraft.el' --- lisp/gnus/nndraft.el 2012-01-19 07:21:25 +0000 +++ lisp/gnus/nndraft.el 2012-04-16 19:09:19 +0000 @@ -37,7 +37,8 @@ (require 'mm-util) (eval-when-compile (require 'cl)) -(declare-function nndraft-request-list "nnmh" (&rest args)) +;; The nnoo-import at the end, I think. +(declare-function nndraft-request-list "nndraft" (&rest args) t) (nnoo-declare nndraft nnmh) ------------------------------------------------------------ revno: 107933 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 15:06:02 -0400 message: Fix comment typo diff: === modified file 'lisp/mail/feedmail.el' --- lisp/mail/feedmail.el 2012-04-09 13:05:48 +0000 +++ lisp/mail/feedmail.el 2012-04-16 19:06:02 +0000 @@ -1586,7 +1586,7 @@ ;; feedmail-buffer-to-binmail, feedmail-buffer-to-sendmail, and -;; feedmail-buffer-to-smptmail are the only things provided for values +;; feedmail-buffer-to-smtpmail are the only things provided for values ;; for the variable feedmail-buffer-eating-function. It's pretty easy ;; to write your own, though. (defun feedmail-buffer-to-binmail (prepped errors-to addr-listoid) ------------------------------------------------------------ revno: 107932 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 15:04:27 -0400 message: * cookie1.el (cookie-snarf): Explicit error if input file cannot be read. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-16 19:02:59 +0000 +++ lisp/ChangeLog 2012-04-16 19:04:27 +0000 @@ -1,5 +1,8 @@ 2012-04-16 Glenn Morris + * play/cookie1.el (cookie-snarf): + Give an explicit error if input file cannot be read. + * play/yow.el (yow-file): Use expand-file-name rather than concat. * progmodes/perl-mode.el (c-macro-expand): === modified file 'lisp/play/cookie1.el' --- lisp/play/cookie1.el 2012-01-19 07:21:25 +0000 +++ lisp/play/cookie1.el 2012-04-16 19:04:27 +0000 @@ -96,6 +96,8 @@ "Reads in the PHRASE-FILE, returns it as a vector of strings. Emit STARTMSG and ENDMSG before and after. Caches the result; second and subsequent calls on the same file won't go to disk." + (or (file-readable-p phrase-file) + (error "Cannot read file `%s'" phrase-file)) (let ((sym (intern-soft phrase-file cookie-cache))) (and sym (not (equal (symbol-function sym) (nth 5 (file-attributes phrase-file)))) ------------------------------------------------------------ revno: 107931 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 15:02:59 -0400 message: * lisp/play/yow.el (yow-file): Use expand-file-name rather than concat. Remove old comment. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-16 19:01:30 +0000 +++ lisp/ChangeLog 2012-04-16 19:02:59 +0000 @@ -1,5 +1,7 @@ 2012-04-16 Glenn Morris + * play/yow.el (yow-file): Use expand-file-name rather than concat. + * progmodes/perl-mode.el (c-macro-expand): Remove unnecessary autoload (it is in loaddefs.el). === modified file 'lisp/play/yow.el' --- lisp/play/yow.el 2012-01-19 07:21:25 +0000 +++ lisp/play/yow.el 2012-04-16 19:02:59 +0000 @@ -1,6 +1,6 @@ ;;; yow.el --- quote random zippyisms -;; Copyright (C) 1993-1995, 2000-2012 Free Software Foundation, Inc. +;; Copyright (C) 1993-1995, 2000-2012 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Author: Richard Mlynarik @@ -24,10 +24,6 @@ ;;; Commentary: ;; Important pinheadery for GNU Emacs. -;; -;; See cookie1.el for implementation. Note --- the `n' argument of yow -;; from the 18.xx implementation is no longer; we only support *random* -;; random access now. ;;; Code: @@ -38,7 +34,7 @@ :prefix "yow-" :group 'games) -(defcustom yow-file (concat data-directory "yow.lines") +(defcustom yow-file (expand-file-name data-directory "yow.lines") "File containing pertinent pinhead phrases." :type 'file :group 'yow) ------------------------------------------------------------ revno: 107930 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 15:01:30 -0400 message: * lisp/progmodes/perl-mode.el (c-macro-expand): Remove unnecessary autoload (it is in loaddefs.el). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-16 18:53:06 +0000 +++ lisp/ChangeLog 2012-04-16 19:01:30 +0000 @@ -1,5 +1,8 @@ 2012-04-16 Glenn Morris + * progmodes/perl-mode.el (c-macro-expand): + Remove unnecessary autoload (it is in loaddefs.el). + * textmodes/picture.el (picture-desired-column) (picture-update-desired-column): Convert comments to doc-strings. (picture-substitute): Remove function. === modified file 'lisp/progmodes/perl-mode.el' --- lisp/progmodes/perl-mode.el 2012-04-09 13:05:48 +0000 +++ lisp/progmodes/perl-mode.el 2012-04-16 19:01:30 +0000 @@ -1,6 +1,6 @@ ;;; perl-mode.el --- Perl code editing commands for GNU Emacs -;; Copyright (C) 1990, 1994, 2001-2012 Free Software Foundation, Inc. +;; Copyright (C) 1990, 1994, 2001-2012 Free Software Foundation, Inc. ;; Author: William F. Mann ;; Maintainer: FSF @@ -133,11 +133,6 @@ map) "Keymap used in Perl mode.") -(autoload 'c-macro-expand "cmacexp" - "Display the result of expanding all C macros occurring in the region. -The expansion is entirely correct because it uses the C preprocessor." - t) - (defvar perl-mode-syntax-table (let ((st (make-syntax-table (standard-syntax-table)))) (modify-syntax-entry ?\n ">" st) ------------------------------------------------------------ revno: 107929 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 14:53:06 -0400 message: picture.el small cleanup * lisp/textmodes/picture.el (picture-desired-column) (picture-update-desired-column): Convert comments to doc-strings. (picture-substitute): Remove function. (picture-mode-map): Initialize in the defvar. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-16 18:46:46 +0000 +++ lisp/ChangeLog 2012-04-16 18:53:06 +0000 @@ -1,5 +1,10 @@ 2012-04-16 Glenn Morris + * textmodes/picture.el (picture-desired-column) + (picture-update-desired-column): Convert comments to doc-strings. + (picture-substitute): Remove function. + (picture-mode-map): Initialize in the defvar. + * woman.el: Remove eval-after-load for tar-mode. * tar-mode.el (tar-mode-map): Add woman binding and menu entry. (woman-tar-extract-file): Autoload it. === modified file 'lisp/textmodes/picture.el' --- lisp/textmodes/picture.el 2012-02-21 17:09:19 +0000 +++ lisp/textmodes/picture.el 2012-04-16 18:53:06 +0000 @@ -63,15 +63,17 @@ ;; Picture Movement Commands -;; When a cursor is on a wide-column character (e.g. Chinese, -;; Japanese, Korean), this variable tells the desired current column -;; which may be different from (current-column). -(defvar picture-desired-column 0) - -;; If the value of picture-desired-column is far from the current -;; column, or if the arg ADJUST-TO-CURRENT is non-nil, set it to the -;; current column. Return the current column. +(defvar picture-desired-column 0 + "Desired current column for Picture mode. +When a cursor is on a wide-column character (e.g. Chinese, +Japanese, Korean), this may may be different from `current-column'.") + + (defun picture-update-desired-column (adjust-to-current) + "Maybe update `picture-desired-column'. +If the value of `picture-desired-column' is more than one column +from `current-column', or if the argument ADJUST-TO-CURRENT is +non-nil, set it to the current column. Return `current-column'." (let ((current-column (current-column))) (if (or adjust-to-current (< picture-desired-column (1- current-column)) @@ -606,64 +608,61 @@ (defalias 'picture-delete-char 'delete-char) -(defvar picture-mode-map nil) - -(defun picture-substitute (oldfun newfun) - (define-key picture-mode-map (vector 'remap oldfun) newfun)) - -(if (not picture-mode-map) - (progn - (setq picture-mode-map (make-keymap)) - (picture-substitute 'self-insert-command 'picture-self-insert) - (picture-substitute 'completion-separator-self-insert-command - 'picture-self-insert) - (picture-substitute 'completion-separator-self-insert-autofilling - 'picture-self-insert) - (picture-substitute 'forward-char 'picture-forward-column) - (picture-substitute 'backward-char 'picture-backward-column) - (picture-substitute 'delete-char 'picture-clear-column) - ;; There are two possibilities for what is normally on DEL. - (picture-substitute 'backward-delete-char-untabify 'picture-backward-clear-column) - (picture-substitute 'delete-backward-char 'picture-backward-clear-column) - (picture-substitute 'kill-line 'picture-clear-line) - (picture-substitute 'open-line 'picture-open-line) - (picture-substitute 'newline 'picture-newline) - (picture-substitute 'newline-and-indent 'picture-duplicate-line) - (picture-substitute 'next-line 'picture-move-down) - (picture-substitute 'previous-line 'picture-move-up) - (picture-substitute 'move-beginning-of-line 'picture-beginning-of-line) - (picture-substitute 'move-end-of-line 'picture-end-of-line) - (picture-substitute 'mouse-set-point 'picture-mouse-set-point) - - (define-key picture-mode-map "\C-c\C-d" 'picture-delete-char) - (define-key picture-mode-map "\e\t" 'picture-toggle-tab-state) - (define-key picture-mode-map "\t" 'picture-tab) - (define-key picture-mode-map "\e\t" 'picture-tab-search) - (define-key picture-mode-map "\C-c\t" 'picture-set-tab-stops) - (define-key picture-mode-map "\C-c\C-k" 'picture-clear-rectangle) - (define-key picture-mode-map "\C-c\C-w" 'picture-clear-rectangle-to-register) - (define-key picture-mode-map "\C-c\C-y" 'picture-yank-rectangle) - (define-key picture-mode-map "\C-c\C-x" 'picture-yank-rectangle-from-register) - (define-key picture-mode-map "\C-c\C-r" 'picture-draw-rectangle) - (define-key picture-mode-map "\C-c\C-c" 'picture-mode-exit) - (define-key picture-mode-map "\C-c\C-f" 'picture-motion) - (define-key picture-mode-map "\C-c\C-b" 'picture-motion-reverse) - (define-key picture-mode-map "\C-c<" 'picture-movement-left) - (define-key picture-mode-map "\C-c>" 'picture-movement-right) - (define-key picture-mode-map "\C-c^" 'picture-movement-up) - (define-key picture-mode-map "\C-c." 'picture-movement-down) - (define-key picture-mode-map "\C-c`" 'picture-movement-nw) - (define-key picture-mode-map "\C-c'" 'picture-movement-ne) - (define-key picture-mode-map "\C-c/" 'picture-movement-sw) - (define-key picture-mode-map "\C-c\\" 'picture-movement-se) - (define-key picture-mode-map [(control ?c) left] 'picture-movement-left) - (define-key picture-mode-map [(control ?c) right] 'picture-movement-right) - (define-key picture-mode-map [(control ?c) up] 'picture-movement-up) - (define-key picture-mode-map [(control ?c) down] 'picture-movement-down) - (define-key picture-mode-map [(control ?c) home] 'picture-movement-nw) - (define-key picture-mode-map [(control ?c) prior] 'picture-movement-ne) - (define-key picture-mode-map [(control ?c) end] 'picture-movement-sw) - (define-key picture-mode-map [(control ?c) next] 'picture-movement-se))) +(defvar picture-mode-map + (let ((map (make-keymap))) + (define-key map [remap self-insert-command] 'picture-self-insert) + (define-key map [remap self-insert-command] 'picture-self-insert) + (define-key map [remap completion-separator-self-insert-command] + 'picture-self-insert) + (define-key map [remap completion-separator-self-insert-autofilling] + 'picture-self-insert) + (define-key map [remap forward-char] 'picture-forward-column) + (define-key map [remap backward-char] 'picture-backward-column) + (define-key map [remap delete-char] 'picture-clear-column) + ;; There are two possibilities for what is normally on DEL. + (define-key map [remap backward-delete-char-untabify] + 'picture-backward-clear-column) + (define-key map [remap delete-backward-char] 'picture-backward-clear-column) + (define-key map [remap kill-line] 'picture-clear-line) + (define-key map [remap open-line] 'picture-open-line) + (define-key map [remap newline] 'picture-newline) + (define-key map [remap newline-and-indent] 'picture-duplicate-line) + (define-key map [remap next-line] 'picture-move-down) + (define-key map [remap previous-line] 'picture-move-up) + (define-key map [remap move-beginning-of-line] 'picture-beginning-of-line) + (define-key map [remap move-end-of-line] 'picture-end-of-line) + (define-key map [remap mouse-set-point] 'picture-mouse-set-point) + (define-key map "\C-c\C-d" 'picture-delete-char) + (define-key map "\e\t" 'picture-toggle-tab-state) + (define-key map "\t" 'picture-tab) + (define-key map "\e\t" 'picture-tab-search) + (define-key map "\C-c\t" 'picture-set-tab-stops) + (define-key map "\C-c\C-k" 'picture-clear-rectangle) + (define-key map "\C-c\C-w" 'picture-clear-rectangle-to-register) + (define-key map "\C-c\C-y" 'picture-yank-rectangle) + (define-key map "\C-c\C-x" 'picture-yank-rectangle-from-register) + (define-key map "\C-c\C-r" 'picture-draw-rectangle) + (define-key map "\C-c\C-c" 'picture-mode-exit) + (define-key map "\C-c\C-f" 'picture-motion) + (define-key map "\C-c\C-b" 'picture-motion-reverse) + (define-key map "\C-c<" 'picture-movement-left) + (define-key map "\C-c>" 'picture-movement-right) + (define-key map "\C-c^" 'picture-movement-up) + (define-key map "\C-c." 'picture-movement-down) + (define-key map "\C-c`" 'picture-movement-nw) + (define-key map "\C-c'" 'picture-movement-ne) + (define-key map "\C-c/" 'picture-movement-sw) + (define-key map "\C-c\\" 'picture-movement-se) + (define-key map [(control ?c) left] 'picture-movement-left) + (define-key map [(control ?c) right] 'picture-movement-right) + (define-key map [(control ?c) up] 'picture-movement-up) + (define-key map [(control ?c) down] 'picture-movement-down) + (define-key map [(control ?c) home] 'picture-movement-nw) + (define-key map [(control ?c) prior] 'picture-movement-ne) + (define-key map [(control ?c) end] 'picture-movement-sw) + (define-key map [(control ?c) next] 'picture-movement-se) + map) + "Keymap used in `picture-mode'.") (defcustom picture-mode-hook nil "If non-nil, its value is called on entry to Picture mode. ------------------------------------------------------------ revno: 107928 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 14:48:46 -0400 message: Set lisp/vc/vc-hg.el maintainer to FSF. Ref: http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-03/msg00325.html diff: === modified file 'lisp/vc/vc-hg.el' --- lisp/vc/vc-hg.el 2012-03-13 10:40:29 +0000 +++ lisp/vc/vc-hg.el 2012-04-16 18:48:46 +0000 @@ -3,6 +3,7 @@ ;; Copyright (C) 2006-2012 Free Software Foundation, Inc. ;; Author: Ivan Kanis +;; Maintainer: FSF ;; Keywords: vc tools ;; Package: vc ------------------------------------------------------------ revno: 107927 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 14:46:46 -0400 message: Replace a use of eval-after-load * lisp/woman.el: Remove eval-after-load for tar-mode. * lisp/tar-mode.el (tar-mode-map): Add woman binding and menu entry. (woman-tar-extract-file): Autoload it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-16 18:41:38 +0000 +++ lisp/ChangeLog 2012-04-16 18:46:46 +0000 @@ -1,5 +1,9 @@ 2012-04-16 Glenn Morris + * woman.el: Remove eval-after-load for tar-mode. + * tar-mode.el (tar-mode-map): Add woman binding and menu entry. + (woman-tar-extract-file): Autoload it. + * frame.el (automatic-hscrolling): Make this alias obsolete. 2012-04-12 Agustín Martín Domingo === modified file 'lisp/tar-mode.el' --- lisp/tar-mode.el 2012-03-16 07:21:23 +0000 +++ lisp/tar-mode.el 2012-04-16 18:46:46 +0000 @@ -549,6 +549,7 @@ (define-key map "R" 'tar-rename-entry) (define-key map "u" 'tar-unflag) (define-key map "v" 'tar-view) + (define-key map "w" 'woman-tar-extract-file) (define-key map "x" 'tar-expunge) (define-key map "\177" 'tar-unflag-backwards) (define-key map "E" 'tar-extract-other-window) @@ -566,6 +567,8 @@ (define-key map [menu-bar immediate] (cons "Immediate" (make-sparse-keymap "Immediate"))) + (define-key map [menu-bar immediate woman] + '("Read Man Page (WoMan)" . woman-tar-extract-file)) (define-key map [menu-bar immediate view] '("View This File" . tar-view)) (define-key map [menu-bar immediate display] @@ -677,6 +680,8 @@ (fundamental-mode) (signal (car err) (cdr err))))) +(autoload 'woman-tar-extract-file "woman" + "In tar mode, run the WoMan man-page browser on this file." t) (define-minor-mode tar-subfile-mode "Minor mode for editing an element of a tar-file. === modified file 'lisp/woman.el' --- lisp/woman.el 2012-04-09 12:36:01 +0000 +++ lisp/woman.el 2012-04-16 18:46:46 +0000 @@ -1,6 +1,6 @@ ;;; woman.el --- browse UN*X manual pages `wo (without) man' -;; Copyright (C) 2000-2012 Free Software Foundation, Inc. +;; Copyright (C) 2000-2012 Free Software Foundation, Inc. ;; Author: Francis J. Wright ;; Maintainer: FSF @@ -1595,14 +1595,6 @@ (woman-process-buffer) (goto-char (point-min))))) -;; There is currently no `tar-mode-hook' so use ... -(eval-after-load "tar-mode" - '(progn - (define-key tar-mode-map "w" 'woman-tar-extract-file) - (define-key-after (lookup-key tar-mode-map [menu-bar immediate]) - [woman] '("Read Man Page (WoMan)" . woman-tar-extract-file) 'view))) - - (defvar woman-last-file-name nil "The full pathname of the last file formatted by WoMan.") ------------------------------------------------------------ revno: 107926 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 14:41:38 -0400 message: * lisp/frame.el (automatic-hscrolling): Make this alias obsolete. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-16 17:32:02 +0000 +++ lisp/ChangeLog 2012-04-16 18:41:38 +0000 @@ -1,3 +1,7 @@ +2012-04-16 Glenn Morris + + * frame.el (automatic-hscrolling): Make this alias obsolete. + 2012-04-12 Agustín Martín Domingo * ispell.el (ispell-set-spellchecker-params): Post-process === modified file 'lisp/frame.el' --- lisp/frame.el 2012-04-15 15:15:00 +0000 +++ lisp/frame.el 2012-04-16 18:41:38 +0000 @@ -1651,7 +1651,8 @@ ;; Misc. -(defvaralias 'automatic-hscrolling 'auto-hscroll-mode) +;; Only marked as obsolete in 24.2. +(define-obsolete-variable-alias 'automatic-hscrolling 'auto-hscroll-mode "22.1") (make-variable-buffer-local 'show-trailing-whitespace) ------------------------------------------------------------ revno: 107925 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-04-16 14:32:59 -0400 message: * configure.in: Remove X libs workaround for old autoconf. diff: === modified file 'ChangeLog' --- ChangeLog 2012-04-15 02:59:30 +0000 +++ ChangeLog 2012-04-16 18:32:59 +0000 @@ -1,3 +1,7 @@ +2012-04-16 Glenn Morris + + * configure.in: Remove X libs workaround for old autoconf. + 2012-04-12 Ken Brown * configure.in: Warn that Cygwin 1.5 is unsupported. (Bug#10398) === modified file 'configure.in' --- configure.in 2012-04-12 12:17:20 +0000 +++ configure.in 2012-04-16 18:32:59 +0000 @@ -1421,15 +1421,6 @@ window_system=x11 fi -## Workaround for bug in autoconf <= 2.62. -## http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg01551.html -## No need to do anything special for these standard directories. -if test -n "${x_libraries}" && test x"${x_libraries}" != xNONE; then - - x_libraries=`echo :${x_libraries}: | sed -e 's|:/usr/lib64:|:|g' -e 's|:/lib64:|:|g' -e 's|^:||' -e 's|:$||'` - -fi - LD_SWITCH_X_SITE_AUX= LD_SWITCH_X_SITE_AUX_RPATH= if test "${x_libraries}" != NONE; then ------------------------------------------------------------ revno: 107924 committer: Agustin Martin branch nick: trunk timestamp: Mon 2012-04-16 19:32:02 +0200 message: (ispell-dictionary-base-alist): Revert to original XEmacs friendly default value. Having [:alpha:] here is no longer needed. If possible [:alpha:] will be set in `ispell-set-spellchecker-params' (and will always be for Emacs). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-16 17:06:58 +0000 +++ lisp/ChangeLog 2012-04-16 17:32:02 +0000 @@ -2,6 +2,9 @@ * ispell.el (ispell-set-spellchecker-params): Post-process `ispell-dictionary-alist' to use [:alpha:] and utf-8 if possible. + (ispell-dictionary-base-alist): Revert to original XEmacs + friendly version for default. [:alpha:] will be added in + `ispell-set-spellchecker-params' if needed 2012-04-16 Chong Yidong === modified file 'lisp/textmodes/ispell.el' --- lisp/textmodes/ispell.el 2012-04-16 09:49:51 +0000 +++ lisp/textmodes/ispell.el 2012-04-16 17:32:02 +0000 @@ -574,12 +574,12 @@ (defvar ispell-dictionary-base-alist - '((nil + '((nil ; default ;; The default dictionary. It may be English.aff, or any other ;; dictionary depending on locale and such things. We should probably ;; ask ispell what dictionary it's using, but until we do that, let's - ;; just use an approximate regexp. - "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil iso-8859-1) + ;; just use a minimal regexp. [:alpha:] will later be set if possible. + "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1) ("american" ; Yankee English "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1) ("brasileiro" ; Brazilian mode ------------------------------------------------------------ revno: 107923 committer: Agustin Martin branch nick: trunk timestamp: Mon 2012-04-16 19:06:58 +0200 message: ispell.el: Fix last Changelog entry. utf-8 will be enabled if possible. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-16 09:49:51 +0000 +++ lisp/ChangeLog 2012-04-16 17:06:58 +0000 @@ -1,7 +1,7 @@ 2012-04-12 Agustín Martín Domingo * ispell.el (ispell-set-spellchecker-params): Post-process - `ispell-dictionary-alist' to use [:alpha:] if possible. + `ispell-dictionary-alist' to use [:alpha:] and utf-8 if possible. 2012-04-16 Chong Yidong ------------------------------------------------------------ revno: 107922 fixes bug(s): http://debbugs.gnu.org/11200 committer: Agustin Martin branch nick: trunk timestamp: Mon 2012-04-16 11:49:51 +0200 message: ispell.el (ispell-set-spellchecker-params): Make dicts use [:alpha:] if possible. If Emacs flavour supports [:alpha:] regexps, use it for Casechars and Not-Casechars. This currently means use it unless flavour is XEmacs. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-16 03:47:43 +0000 +++ lisp/ChangeLog 2012-04-16 09:49:51 +0000 @@ -1,3 +1,8 @@ +2012-04-12 Agustín Martín Domingo + + * ispell.el (ispell-set-spellchecker-params): Post-process + `ispell-dictionary-alist' to use [:alpha:] if possible. + 2012-04-16 Chong Yidong * image.el (imagemagick--extension-regexp): New variable. === modified file 'lisp/textmodes/ispell.el' --- lisp/textmodes/ispell.el 2012-04-14 01:46:06 +0000 +++ lisp/textmodes/ispell.el 2012-04-16 09:49:51 +0000 @@ -767,6 +767,12 @@ (make-obsolete-variable 'ispell-aspell-supports-utf8 'ispell-encoding8-command "23.1") +(defvar ispell-emacs-alpha-regexp + (if (string-match "^[[:alpha:]]+$" "abcde") + "[[:alpha:]]" + nil) + "[[:alpha:]] if Emacs supports [:alpha:] regexp, nil +otherwise (current XEmacs does not support it).") ;;; ********************************************************************** ;;; The following are used by ispell, and should not be changed. @@ -1092,8 +1098,7 @@ (error nil)) ispell-really-aspell ispell-encoding8-command - ;; XEmacs does not like [:alpha:] regexps. - (string-match "^[[:alpha:]]+$" "abcde")) + ispell-emacs-alpha-regexp) (unless ispell-aspell-dictionary-alist (ispell-find-aspell-dictionaries))) @@ -1117,8 +1122,27 @@ ispell-dictionary-base-alist)) (unless (assoc (car dict) all-dicts-alist) (add-to-list 'all-dicts-alist dict))) - (setq ispell-dictionary-alist all-dicts-alist)))) + (setq ispell-dictionary-alist all-dicts-alist)) + ;; If Emacs flavor supports [:alpha:] use it for global dicts. If + ;; spellchecker also supports UTF-8 via command-line option use it + ;; in communication. This does not affect definitions in ~/.emacs. + (if ispell-emacs-alpha-regexp + (let (tmp-dicts-alist) + (dolist (adict ispell-dictionary-alist) + (add-to-list 'tmp-dicts-alist + (list + (nth 0 adict) ; dict name + "[[:alpha:]]" ; casechars + "[^[:alpha:]]" ; not-casechars + (nth 3 adict) ; otherchars + (nth 4 adict) ; many-otherchars-p + (nth 5 adict) ; ispell-args + (nth 6 adict) ; extended-character-mode + (if ispell-encoding8-command + 'utf-8 + (nth 7 adict))))) + (setq ispell-dictionary-alist tmp-dicts-alist))))) (defun ispell-valid-dictionary-list () "Return a list of valid dictionaries. ------------------------------------------------------------ revno: 107921 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-04-15 23:39:21 -0700 message: * alloc.c: Remove one incorrect comment and fix another. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-04-16 03:38:40 +0000 +++ src/ChangeLog 2012-04-16 06:39:21 +0000 @@ -8,6 +8,7 @@ GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used. (NEED_MEM_INSERT): New macro. (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused. + Remove one incorrect comment and fix another. Fix minor ralloc.c problems found by static checking. See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html === modified file 'src/alloc.c' --- src/alloc.c 2012-04-16 03:38:40 +0000 +++ src/alloc.c 2012-04-16 06:39:21 +0000 @@ -948,9 +948,6 @@ /* The entry point is lisp_align_malloc which returns blocks of at most BLOCK_BYTES and guarantees they are aligned on a BLOCK_ALIGN boundary. */ -/* Use posix_memalloc if the system has it and we're using the system's - malloc (because our gmalloc.c routines don't have posix_memalign although - its memalloc could be used). */ #if defined (HAVE_POSIX_MEMALIGN) && defined (SYSTEM_MALLOC) #define USE_POSIX_MEMALIGN 1 #endif @@ -1007,7 +1004,7 @@ struct ablock blocks[ABLOCKS_SIZE]; }; -/* Size of the block requested from malloc or memalign. */ +/* Size of the block requested from malloc or posix_memalign. */ #define ABLOCKS_BYTES (sizeof (struct ablocks) - BLOCK_PADDING) #define ABLOCK_ABASE(block) \ ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.