Now on revision 112401. ------------------------------------------------------------ revno: 112401 committer: Bastien Guerry branch nick: trunk timestamp: Sat 2013-04-27 08:38:41 +0200 message: lisp/ChangeLog: Tiny ChangeLog formatting fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-26 23:55:06 +0000 +++ lisp/ChangeLog 2013-04-27 06:38:41 +0000 @@ -1,7 +1,7 @@ 2013-04-26 Reuben Thomas - * textmodes/remember.el (remember-store-in-files): document that - the file name format is fed through format-time-string. + * textmodes/remember.el (remember-store-in-files): Document that + the file name format is passed to `format-time-string'. 2013-04-26 Leo Liu ------------------------------------------------------------ revno: 112400 committer: Reuben Thomas branch nick: emacs timestamp: Sat 2013-04-27 00:55:06 +0100 message: Fix docstring buglet in remember.el diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-26 16:44:38 +0000 +++ lisp/ChangeLog 2013-04-26 23:55:06 +0000 @@ -1,3 +1,8 @@ +2013-04-26 Reuben Thomas + + * textmodes/remember.el (remember-store-in-files): document that + the file name format is fed through format-time-string. + 2013-04-26 Leo Liu * progmodes/octave.el (octave-sync-function-file-names): New function. === modified file 'lisp/textmodes/remember.el' --- lisp/textmodes/remember.el 2013-04-25 17:39:44 +0000 +++ lisp/textmodes/remember.el 2013-04-26 23:55:06 +0000 @@ -444,7 +444,8 @@ (defun remember-store-in-files () "Store remember data in a file in `remember-data-directory'. -The file is named after `remember-directory-file-name-format'." +The file is named after `remember-directory-file-name-format' fed through +`format-time-string'." (let ((name (format-time-string remember-directory-file-name-format (current-time))) (text (buffer-string))) ------------------------------------------------------------ revno: 112399 fixes bug: http://debbugs.gnu.org/14258 committer: Paul Eggert branch nick: trunk timestamp: Fri 2013-04-26 12:31:09 -0700 message: Port better to AIX. * configure.ac (CFLAGS): Append -O if the user did not specify CFLAGS, we did not already infer an optimization option, and -O works. AIX xlc needs -O, otherwise garbage collection doesn't work. * src/lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too, to pacify AIX xlc. diff: === modified file 'ChangeLog' --- ChangeLog 2013-04-22 05:08:36 +0000 +++ ChangeLog 2013-04-26 19:31:09 +0000 @@ -1,3 +1,10 @@ +2013-04-26 Paul Eggert + + Port better to AIX (Bug#14258). + * configure.ac (CFLAGS): Append -O if the user did not specify CFLAGS, + we did not already infer an optimization option, and -O works. + AIX xlc needs -O, otherwise garbage collection doesn't work. + 2013-04-22 Paul Eggert * make-dist: Do not distribute admin/unidata/Makefile. === modified file 'configure.ac' --- configure.ac 2013-04-18 17:12:21 +0000 +++ configure.ac 2013-04-26 19:31:09 +0000 @@ -613,10 +613,10 @@ dnl Amongst other things, this sets AR and ARFLAGS. gl_EARLY -# It's helpful to have C macros available to GDB, so prefer -g3 to -g -# if -g3 works and the user does not specify CFLAGS. -# This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains. if test "$ac_test_CFLAGS" != set; then + # It's helpful to have C macros available to GDB, so prefer -g3 to -g + # if -g3 works and the user does not specify CFLAGS. + # This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains. case $CFLAGS in '-g') emacs_g3_CFLAGS='-g3';; @@ -632,13 +632,29 @@ [emacs_cv_prog_cc_g3], [AC_LINK_IFELSE([AC_LANG_PROGRAM()], [emacs_cv_prog_cc_g3=yes], - [emacs_cv_prog_cc_g3=no])]) - if test $emacs_cv_prog_cc_g3 = yes; then - CFLAGS=$emacs_g3_CFLAGS - else + [emacs_cv_prog_cc_g3=no])]) + if test $emacs_cv_prog_cc_g3 != yes; then CFLAGS=$emacs_save_CFLAGS fi fi + + case $CFLAGS in + *-O*) ;; + *) + # No optimization flag was inferred for this non-GCC compiler. + # Try -O. This is needed for xlc on AIX; see Bug#14258. + emacs_save_CFLAGS=$CFLAGS + test -z "$CFLAGS" || CFLAGS="$CFLAGS " + CFLAGS=${CFLAGS}-O + AC_CACHE_CHECK([whether $CC accepts -O], + [emacs_cv_prog_cc_o], + [AC_LINK_IFELSE([AC_LANG_PROGRAM()], + [emacs_cv_prog_cc_o=yes], + [emacs_cv_prog_cc_o=no])]) + if test $emacs_cv_prog_cc_o != yes; then + CFLAGS=$emacs_save_CFLAGS + fi ;; + esac fi AC_ARG_ENABLE([gcc-warnings], === modified file 'src/ChangeLog' --- src/ChangeLog 2013-04-24 15:09:49 +0000 +++ src/ChangeLog 2013-04-26 19:31:09 +0000 @@ -1,3 +1,9 @@ +2013-04-26 Paul Eggert + + Port better to AIX (Bug#14258). + * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too, + to pacify AIX xlc. + 2013-04-24 Kenichi Handa * coding.c (decode_coding_iso_2022): When an invalid escape === modified file 'src/lisp.h' --- src/lisp.h 2013-04-07 04:41:19 +0000 +++ src/lisp.h 2013-04-26 19:31:09 +0000 @@ -231,9 +231,9 @@ #define case_Lisp_Int case Lisp_Int0: case Lisp_Int1 #define LISP_INT_TAG_P(x) (((x) & ~Lisp_Int1) == 0) -/* Stolen from GDB. The only known compiler that doesn't support - enums in bitfields is MSVC. */ -#ifdef _MSC_VER +/* Idea stolen from GDB. MSVC doesn't support enums in bitfields, + and xlc complains vociferously about them. */ +#if defined _MSC_VER || defined __IBMC__ #define ENUM_BF(TYPE) unsigned int #else #define ENUM_BF(TYPE) enum TYPE ------------------------------------------------------------ revno: 112398 committer: Leo Liu branch nick: trunk timestamp: Sat 2013-04-27 01:11:04 +0800 message: * progmodes/octave.el (octave-sync-function-file-names): Fix last change. diff: === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-04-26 16:44:38 +0000 +++ lisp/progmodes/octave.el 2013-04-26 17:11:04 +0000 @@ -1024,7 +1024,8 @@ (file-name-nondirectory buffer-file-name))) (func (and (re-search-forward octave-function-header-regexp nil t) (match-string 3)))) - (when (and (not (equal file func)) + (when (and func + (not (equal file func)) (yes-or-no-p "Function name different from file name. Fix? ")) (replace-match file nil nil nil 3)))))) ------------------------------------------------------------ revno: 112397 committer: Leo Liu branch nick: trunk timestamp: Sat 2013-04-27 00:44:38 +0800 message: * progmodes/octave.el (octave-sync-function-file-names): New function. (octave-mode): Use it in before-save-hook. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-26 14:47:07 +0000 +++ lisp/ChangeLog 2013-04-26 16:44:38 +0000 @@ -1,3 +1,8 @@ +2013-04-26 Leo Liu + + * progmodes/octave.el (octave-sync-function-file-names): New function. + (octave-mode): Use it in before-save-hook. + 2013-04-26 Stefan Monnier * emacs-lisp/tabulated-list.el (tabulated-list-mode): Disable undo === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-04-26 14:34:26 +0000 +++ lisp/progmodes/octave.el 2013-04-26 16:44:38 +0000 @@ -626,6 +626,7 @@ (add-hook 'completion-at-point-functions 'octave-completion-at-point-function nil t) + (add-hook 'before-save-hook 'octave-sync-function-file-names nil t) (setq-local beginning-of-defun-function 'octave-beginning-of-defun) (easy-menu-add octave-mode-menu)) @@ -1008,6 +1009,26 @@ nil (delete-horizontal-space) (insert (concat " " octave-continuation-string)))) + +(defun octave-sync-function-file-names () + "Ensure function name agree with function file name. +See Info node `(octave)Function Files'." + (interactive) + (save-excursion + (when (and buffer-file-name + (prog2 + (goto-char (point-min)) + (equal (funcall smie-forward-token-function) "function") + (forward-word -1))) + (let ((file (file-name-sans-extension + (file-name-nondirectory buffer-file-name))) + (func (and (re-search-forward octave-function-header-regexp nil t) + (match-string 3)))) + (when (and (not (equal file func)) + (yes-or-no-p + "Function name different from file name. Fix? ")) + (replace-match file nil nil nil 3)))))) + ;;; Indentation ------------------------------------------------------------ revno: 112396 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14274 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2013-04-26 10:47:07 -0400 message: * lisp/emacs-lisp/tabulated-list.el (tabulated-list-mode): Disable undo. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-26 14:34:26 +0000 +++ lisp/ChangeLog 2013-04-26 14:47:07 +0000 @@ -1,5 +1,8 @@ 2013-04-26 Stefan Monnier + * emacs-lisp/tabulated-list.el (tabulated-list-mode): Disable undo + (bug#14274). + * progmodes/octave.el (octave-smie-forward-token): Properly skip \n and comment, even if it's not an implicit ; (bug#14218). === modified file 'lisp/emacs-lisp/tabulated-list.el' --- lisp/emacs-lisp/tabulated-list.el 2013-02-16 02:50:44 +0000 +++ lisp/emacs-lisp/tabulated-list.el 2013-04-26 14:47:07 +0000 @@ -519,12 +519,11 @@ data in an ewoc may instead specify a printer function (e.g., one that calls `ewoc-enter-last'), with `tabulated-list-print-entry' as the ewoc pretty-printer." - (setq truncate-lines t) - (setq buffer-read-only t) - (set (make-local-variable 'revert-buffer-function) - 'tabulated-list-revert) - (set (make-local-variable 'glyphless-char-display) - tabulated-list-glyphless-char-display)) + (setq-local truncate-lines t) + (setq-local buffer-read-only t) + (setq-local buffer-undo-list t) + (setq-local revert-buffer-function #'tabulated-list-revert) + (setq-local glyphless-char-display tabulated-list-glyphless-char-display)) (put 'tabulated-list-mode 'mode-class 'special) ------------------------------------------------------------ revno: 112395 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14218 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2013-04-26 10:34:26 -0400 message: * lisp/progmodes/octave.el (octave-smie-forward-token): Properly skip \n and comment, even if it's not an implicit ;. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-26 07:34:54 +0000 +++ lisp/ChangeLog 2013-04-26 14:34:26 +0000 @@ -1,3 +1,8 @@ +2013-04-26 Stefan Monnier + + * progmodes/octave.el (octave-smie-forward-token): Properly skip + \n and comment, even if it's not an implicit ; (bug#14218). + 2013-04-26 Glenn Morris * subr.el (read-number): Once more use `read' rather than @@ -20,7 +25,7 @@ * progmodes/octave.el (octave-submit-bug-report): Obsolete. (octave-mode, inferior-octave-mode): Use setq-local. - (octave-not-in-string-or-comment-p): Renamed to + (octave-not-in-string-or-comment-p): Rename to octave-in-string-or-comment-p. (octave-in-comment-p, octave-in-string-p) (octave-in-string-or-comment-p): Replace defsubst with defun. @@ -36,8 +41,8 @@ 2013-04-25 Leo Liu - * progmodes/octave.el (octave-completion-at-point-function): Make - use of inferior octave process. + * progmodes/octave.el (octave-completion-at-point-function): + Make use of inferior octave process. (octave-initialize-completions): Remove. (inferior-octave-completion-table): New function. (inferior-octave-completion-at-point): Use it. === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-04-26 04:16:37 +0000 +++ lisp/progmodes/octave.el 2013-04-26 14:34:26 +0000 @@ -461,11 +461,12 @@ (forward-comment 1)) (cond ((and (looking-at "$\\|[%#]") - (not (smie-rule-bolp)) - ;; Ignore it if it's within parentheses. - (prog1 (let ((ppss (syntax-ppss))) - (not (and (nth 1 ppss) - (eq ?\( (char-after (nth 1 ppss)))))) + ;; Ignore it if it's within parentheses or if the newline does not end + ;; some preceding text. + (prog1 (and (not (smie-rule-bolp)) + (let ((ppss (syntax-ppss))) + (not (and (nth 1 ppss) + (eq ?\( (char-after (nth 1 ppss))))))) (forward-comment (point-max)))) ;; Why bother distinguishing \n and ;? ";") ;;"\n" ------------------------------------------------------------ revno: 112394 committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2013-04-26 13:56:37 +0000 message: lisp/gnus/mail-source.el (mail-source-fetch-pop, mail-source-check-pop): Fix again diff: === modified file 'lisp/gnus/mail-source.el' --- lisp/gnus/mail-source.el 2013-04-26 10:36:36 +0000 +++ lisp/gnus/mail-source.el 2013-04-26 13:56:37 +0000 @@ -810,8 +810,8 @@ (let ((from (format "%s:%s:%s" server user port)) (mail-source-string (format "pop:%s@%s" user server)) (process-environment (if server - (append (list (concat "MAILHOST=" server)) - process-environment) + (cons (concat "MAILHOST=" server) + process-environment) process-environment)) result) (when (eq authentication 'password) @@ -880,8 +880,8 @@ (let ((from (format "%s:%s:%s" server user port)) (mail-source-string (format "pop:%s@%s" user server)) (process-environment (if server - (append (list (concat "MAILHOST=" server)) - process-environment) + (cons (concat "MAILHOST=" server) + process-environment) process-environment)) result) (when (eq authentication 'password) ------------------------------------------------------------ revno: 112393 committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2013-04-26 10:36:36 +0000 message: lisp/gnus/mail-source.el (mail-source-fetch-pop, mail-source-check-pop): Fix last change diff: === modified file 'lisp/gnus/mail-source.el' --- lisp/gnus/mail-source.el 2013-04-26 10:22:07 +0000 +++ lisp/gnus/mail-source.el 2013-04-26 10:36:36 +0000 @@ -809,8 +809,10 @@ prescript-delay) (let ((from (format "%s:%s:%s" server user port)) (mail-source-string (format "pop:%s@%s" user server)) - (process-environment (append (list (concat "MAILHOST=" server)) - process-environment)) + (process-environment (if server + (append (list (concat "MAILHOST=" server)) + process-environment) + process-environment)) result) (when (eq authentication 'password) (setq password @@ -877,8 +879,10 @@ (mail-source-bind (pop source) (let ((from (format "%s:%s:%s" server user port)) (mail-source-string (format "pop:%s@%s" user server)) - (process-environment (append (list (concat "MAILHOST=" server)) - process-environment)) + (process-environment (if server + (append (list (concat "MAILHOST=" server)) + process-environment) + process-environment)) result) (when (eq authentication 'password) (setq password ------------------------------------------------------------ revno: 112392 committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2013-04-26 10:22:07 +0000 message: lisp/gnus/mail-source.el (mail-source-fetch-pop, mail-source-check-pop): Don't set the MAILHOST environment variable permanently (Bug#14271) diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-04-26 07:59:32 +0000 +++ lisp/gnus/ChangeLog 2013-04-26 10:22:07 +0000 @@ -1,3 +1,8 @@ +2013-04-26 Katsumi Yamaoka + + * mail-source.el (mail-source-fetch-pop, mail-source-check-pop): + Don't set the MAILHOST environment variable permanently (Bug#14271). + 2013-04-26 Glenn Morris * message.el (message-bury): Revert 2013-03-18 change. (Bug#14117) === modified file 'lisp/gnus/mail-source.el' --- lisp/gnus/mail-source.el 2013-01-02 16:13:04 +0000 +++ lisp/gnus/mail-source.el 2013-04-26 10:22:07 +0000 @@ -809,6 +809,8 @@ prescript-delay) (let ((from (format "%s:%s:%s" server user port)) (mail-source-string (format "pop:%s@%s" user server)) + (process-environment (append (list (concat "MAILHOST=" server)) + process-environment)) result) (when (eq authentication 'password) (setq password @@ -816,8 +818,6 @@ (cdr (assoc from mail-source-password-cache)) (read-passwd (format "Password for %s at %s: " user server))))) - (when server - (setenv "MAILHOST" server)) (setq result (cond (program @@ -877,6 +877,8 @@ (mail-source-bind (pop source) (let ((from (format "%s:%s:%s" server user port)) (mail-source-string (format "pop:%s@%s" user server)) + (process-environment (append (list (concat "MAILHOST=" server)) + process-environment)) result) (when (eq authentication 'password) (setq password @@ -886,8 +888,6 @@ (format "Password for %s at %s: " user server)))) (unless (assoc from mail-source-password-cache) (push (cons from password) mail-source-password-cache))) - (when server - (setenv "MAILHOST" server)) (setq result (cond ;; No easy way to check whether mail is waiting for these. ------------------------------------------------------------ revno: 112391 fixes bug: http://debbugs.gnu.org/14117 committer: Glenn Morris branch nick: trunk timestamp: Fri 2013-04-26 00:59:32 -0700 message: * lisp/gnus/message.el (message-bury): Revert 2013-03-18 change. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-04-26 02:08:43 +0000 +++ lisp/gnus/ChangeLog 2013-04-26 07:59:32 +0000 @@ -1,3 +1,7 @@ +2013-04-26 Glenn Morris + + * message.el (message-bury): Revert 2013-03-18 change. (Bug#14117) + 2013-04-25 Andrew Cohen * gnus-msg.el (gnus-inews-insert-gcc): Re-order conditional to work for === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2013-03-18 17:25:15 +0000 +++ lisp/gnus/message.el 2013-04-26 07:59:32 +0000 @@ -4097,9 +4097,11 @@ (defun message-bury (buffer) "Bury this mail BUFFER." - (bury-buffer buffer) - (when message-return-action - (apply (car message-return-action) (cdr message-return-action)))) + (if message-return-action + (progn + (bury-buffer buffer) + (apply (car message-return-action) (cdr message-return-action))) + (with-current-buffer buffer (bury-buffer)))) (defun message-send (&optional arg) "Send the message in the current buffer. ------------------------------------------------------------ revno: 112390 [merge] committer: Glenn Morris branch nick: trunk timestamp: Fri 2013-04-26 00:34:54 -0700 message: Merge from emacs-24; up to r111345 diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-26 07:25:45 +0000 +++ lisp/ChangeLog 2013-04-26 07:34:54 +0000 @@ -1,5 +1,16 @@ 2013-04-26 Glenn Morris + * subr.el (read-number): Once more use `read' rather than + `string-to-number', to trap non-numeric input. (Bug#14254) + +2013-04-26 Erik Charlebois + + * emacs-lisp/syntax.el (syntax-propertize-multiline): + Use `syntax-multiline' text property consistently instead of + `font-lock-multiline'. (bug#14237). + +2013-04-26 Glenn Morris + * emacs-lisp/shadow.el (list-load-path-shadows): No longer necessary to check for duplicate simple.el, since 2012-07-07 change to init_lread to not include installation lisp === modified file 'lisp/emacs-lisp/syntax.el' --- lisp/emacs-lisp/syntax.el 2013-01-01 09:11:05 +0000 +++ lisp/emacs-lisp/syntax.el 2013-04-22 14:11:37 +0000 @@ -99,7 +99,7 @@ (setq beg (or (previous-single-property-change beg 'syntax-multiline) (point-min)))) ;; - (when (get-text-property end 'font-lock-multiline) + (when (get-text-property end 'syntax-multiline) (setq end (or (text-property-any end (point-max) 'syntax-multiline nil) (point-max)))) === modified file 'lisp/subr.el' --- lisp/subr.el 2013-04-18 00:12:33 +0000 +++ lisp/subr.el 2013-04-26 07:34:54 +0000 @@ -2225,7 +2225,7 @@ (condition-case nil (setq n (cond ((zerop (length str)) default1) - ((stringp str) (string-to-number str)))) + ((stringp str) (read str)))) (error nil))) (unless (numberp n) (message "Please enter a number.") ------------------------------------------------------------ revno: 112389 committer: Glenn Morris branch nick: trunk timestamp: Fri 2013-04-26 00:31:27 -0700 message: Add missing reftex-label-ignored-macros-and-environments :version tag diff: === modified file 'lisp/textmodes/reftex-vars.el' --- lisp/textmodes/reftex-vars.el 2013-04-25 12:01:09 +0000 +++ lisp/textmodes/reftex-vars.el 2013-04-26 07:31:27 +0000 @@ -901,6 +901,7 @@ `LaTeX-current-environment' are bound. Also note that this feature might slow down the reftex parsing process for large TeX files." + :version "24.4" :group 'reftex-defining-label-environments :type '(repeat string)) ------------------------------------------------------------ revno: 112388 fixes bug: http://debbugs.gnu.org/14270 committer: Glenn Morris branch nick: trunk timestamp: Fri 2013-04-26 00:25:45 -0700 message: list-load-path-shadows simplification * lisp/emacs-lisp/shadow.el (list-load-path-shadows): No longer necessary to check for duplicate simple.el, since 2012-07-07 change to init_lread to not include installation lisp directories in load-path when running uninstalled. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-26 04:16:37 +0000 +++ lisp/ChangeLog 2013-04-26 07:25:45 +0000 @@ -1,3 +1,10 @@ +2013-04-26 Glenn Morris + + * emacs-lisp/shadow.el (list-load-path-shadows): + No longer necessary to check for duplicate simple.el, since + 2012-07-07 change to init_lread to not include installation lisp + directories in load-path when running uninstalled. (Bug#14270) + 2013-04-26 Leo Liu * progmodes/octave.el (octave-submit-bug-report): Obsolete. === modified file 'lisp/emacs-lisp/shadow.el' --- lisp/emacs-lisp/shadow.el 2013-01-01 09:11:05 +0000 +++ lisp/emacs-lisp/shadow.el 2013-04-26 07:25:45 +0000 @@ -207,101 +207,79 @@ For example, suppose `load-path' is set to -\(\"/usr/gnu/emacs/site-lisp\" \"/usr/gnu/emacs/share/emacs/19.30/lisp\"\) +\(\"/usr/share/emacs/site-lisp\" \"/usr/share/emacs/24.3/lisp\") and that each of these directories contains a file called XXX.el. Then XXX.el in the site-lisp directory is referred to by all of: -\(require 'XXX\), \(autoload .... \"XXX\"\), \(load-library \"XXX\"\) etc. +\(require 'XXX), (autoload .... \"XXX\"), (load-library \"XXX\") etc. -The first XXX.el file prevents Emacs from seeing the second \(unless -the second is loaded explicitly via `load-file'\). +The first XXX.el file prevents Emacs from seeing the second (unless +the second is loaded explicitly via `load-file'). When not intended, such shadowings can be the source of subtle problems. For example, the above situation may have arisen because the XXX package was not distributed with versions of Emacs prior to -19.30. An Emacs maintainer downloaded XXX from elsewhere and installed +24.3. A system administrator downloaded XXX from elsewhere and installed it. Later, XXX was updated and included in the Emacs distribution. -Unless the Emacs maintainer checks for this, the new version of XXX -will be hidden behind the old \(which may no longer work with the new -Emacs version\). +Unless the system administrator checks for this, the new version of XXX +will be hidden behind the old (which may no longer work with the new +Emacs version). This function performs these checks and flags all possible shadowings. Because a .el file may exist without a corresponding .elc -\(or vice-versa\), these suffixes are essentially ignored. A file -XXX.elc in an early directory \(that does not contain XXX.el\) is +\(or vice-versa), these suffixes are essentially ignored. A file +XXX.elc in an early directory (that does not contain XXX.el) is considered to shadow a later file XXX.el, and vice-versa. Shadowings are located by calling the (non-interactive) companion function, `load-path-shadows-find'." (interactive) - (let* ((path (copy-sequence load-path)) - (tem path) - toplevs) - ;; If we can find simple.el in two places, - (dolist (tt tem) - (if (or (file-exists-p (expand-file-name "simple.el" tt)) - (file-exists-p (expand-file-name "simple.el.gz" tt))) - (setq toplevs (cons tt toplevs)))) - (if (> (length toplevs) 1) - ;; Cut off our copy of load-path right before - ;; the last directory which has simple.el in it. - ;; This avoids loads of duplications between the source dir - ;; and the dir where these files were copied by installation. - (let ((break (car toplevs))) - (setq tem path) - (while tem - (if (eq (nth 1 tem) break) - (progn - (setcdr tem nil) - (setq tem nil))) - (setq tem (cdr tem))))) - - (let* ((shadows (load-path-shadows-find path)) - (n (/ (length shadows) 2)) - (msg (format "%s Emacs Lisp load-path shadowing%s found" - (if (zerop n) "No" (concat "\n" (number-to-string n))) - (if (= n 1) " was" "s were")))) - (with-temp-buffer - (while shadows - (insert (format "%s hides %s\n" (car shadows) - (car (cdr shadows)))) - (setq shadows (cdr (cdr shadows)))) - (if stringp - (buffer-string) - (if (called-interactively-p 'interactive) - ;; We are interactive. - ;; Create the *Shadows* buffer and display shadowings there. - (let ((string (buffer-string))) - (with-current-buffer (get-buffer-create "*Shadows*") - (display-buffer (current-buffer)) - (load-path-shadows-mode) ; run after-change-major-mode-hook - (let ((inhibit-read-only t)) - (erase-buffer) - (insert string) - (insert msg "\n") - (while (re-search-backward "\\(^.*\\) hides \\(.*$\\)" - nil t) - (dotimes (i 2) - (make-button (match-beginning (1+ i)) - (match-end (1+ i)) - 'type 'load-path-shadows-find-file - 'shadow-file - (match-string (1+ i))))) - (goto-char (point-max))))) - ;; We are non-interactive, print shadows via message. - (unless (zerop n) - (message "This site has duplicate Lisp libraries with the same name. + (let* ((shadows (load-path-shadows-find load-path)) + (n (/ (length shadows) 2)) + (msg (format "%s Emacs Lisp load-path shadowing%s found" + (if (zerop n) "No" (concat "\n" (number-to-string n))) + (if (= n 1) " was" "s were")))) + (with-temp-buffer + (while shadows + (insert (format "%s hides %s\n" (car shadows) + (car (cdr shadows)))) + (setq shadows (cdr (cdr shadows)))) + (if stringp + (buffer-string) + (if (called-interactively-p 'interactive) + ;; We are interactive. + ;; Create the *Shadows* buffer and display shadowings there. + (let ((string (buffer-string))) + (with-current-buffer (get-buffer-create "*Shadows*") + (display-buffer (current-buffer)) + (load-path-shadows-mode) ; run after-change-major-mode-hook + (let ((inhibit-read-only t)) + (erase-buffer) + (insert string) + (insert msg "\n") + (while (re-search-backward "\\(^.*\\) hides \\(.*$\\)" + nil t) + (dotimes (i 2) + (make-button (match-beginning (1+ i)) + (match-end (1+ i)) + 'type 'load-path-shadows-find-file + 'shadow-file + (match-string (1+ i))))) + (goto-char (point-max))))) + ;; We are non-interactive, print shadows via message. + (unless (zerop n) + (message "This site has duplicate Lisp libraries with the same name. If a locally-installed Lisp library overrides a library in the Emacs release, that can cause trouble, and you should probably remove the locally-installed version unless you know what you are doing.\n") - (goto-char (point-min)) - ;; Mimic the previous behavior of using lots of messages. - ;; I think one single message would look better... - (while (not (eobp)) - (message "%s" (buffer-substring (line-beginning-position) - (line-end-position))) - (forward-line 1)) - (message "%s" msg)))))))) + (goto-char (point-min)) + ;; Mimic the previous behavior of using lots of messages. + ;; I think one single message would look better... + (while (not (eobp)) + (message "%s" (buffer-substring (line-beginning-position) + (line-end-position))) + (forward-line 1)) + (message "%s" msg))))))) (provide 'shadow) ------------------------------------------------------------ revno: 112387 committer: Leo Liu branch nick: trunk timestamp: Fri 2013-04-26 12:16:37 +0800 message: * progmodes/octave.el (octave-submit-bug-report): Obsolete. (octave-mode, inferior-octave-mode): Use setq-local. (octave-not-in-string-or-comment-p): Renamed to octave-in-string-or-comment-p. (octave-in-comment-p, octave-in-string-p) (octave-in-string-or-comment-p): Replace defsubst with defun. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-25 21:20:17 +0000 +++ lisp/ChangeLog 2013-04-26 04:16:37 +0000 @@ -1,3 +1,12 @@ +2013-04-26 Leo Liu + + * progmodes/octave.el (octave-submit-bug-report): Obsolete. + (octave-mode, inferior-octave-mode): Use setq-local. + (octave-not-in-string-or-comment-p): Renamed to + octave-in-string-or-comment-p. + (octave-in-comment-p, octave-in-string-p) + (octave-in-string-or-comment-p): Replace defsubst with defun. + 2013-04-25 Paul Eggert * Makefile.in (distclean): Remove $(lisp)/loaddefs.el~. === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-04-25 16:23:56 +0000 +++ lisp/progmodes/octave.el 2013-04-26 04:16:37 +0000 @@ -1,4 +1,4 @@ -;;; octave.el --- editing octave source files under emacs +;;; octave.el --- editing octave source files under emacs -*- lexical-binding: t; -*- ;; Copyright (C) 1997, 2001-2013 Free Software Foundation, Inc. @@ -39,9 +39,8 @@ :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) :group 'languages) -(defconst octave-maintainer-address - "Kurt Hornik , bug-gnu-emacs@gnu.org" - "Current maintainer of the Emacs Octave package.") +(define-obsolete-function-alias 'octave-submit-bug-report + 'report-emacs-bug "24.4") (define-abbrev-table 'octave-abbrev-table (mapcar (lambda (e) (append e '(nil 0 t))) @@ -585,53 +584,48 @@ (smie-setup octave-smie-grammar #'octave-smie-rules :forward-token #'octave-smie-forward-token :backward-token #'octave-smie-backward-token) - (set (make-local-variable 'smie-indent-basic) 'octave-block-offset) + (setq-local smie-indent-basic 'octave-block-offset) - (set (make-local-variable 'smie-blink-matching-triggers) - (cons ?\; smie-blink-matching-triggers)) + (setq-local smie-blink-matching-triggers + (cons ?\; smie-blink-matching-triggers)) (unless octave-blink-matching-block (remove-hook 'post-self-insert-hook #'smie-blink-matching-open 'local)) - (set (make-local-variable 'electric-indent-chars) - (cons ?\; electric-indent-chars)) + (setq-local electric-indent-chars + (cons ?\; electric-indent-chars)) ;; IIUC matlab-mode takes the opposite approach: it makes RET insert ;; a ";" at those places where it's correct (i.e. outside of parens). - (set (make-local-variable 'electric-layout-rules) '((?\; . after))) + (setq-local electric-layout-rules '((?\; . after))) - (set (make-local-variable 'comment-start) octave-comment-start) - (set (make-local-variable 'comment-end) "") + (setq-local comment-start octave-comment-start) + (setq-local comment-end "") ;; Don't set it here: it's not really a property of the language, ;; just a personal preference of the author. - ;; (set (make-local-variable 'comment-column) 32) - (set (make-local-variable 'comment-start-skip) "\\s<+\\s-*") - (set (make-local-variable 'comment-add) 1) + ;; (setq-local comment-column 32) + (setq-local comment-start-skip "\\s<+\\s-*") + (setq-local comment-add 1) - (set (make-local-variable 'parse-sexp-ignore-comments) t) - (set (make-local-variable 'paragraph-start) - (concat "\\s-*$\\|" page-delimiter)) - (set (make-local-variable 'paragraph-separate) paragraph-start) - (set (make-local-variable 'paragraph-ignore-fill-prefix) t) - (set (make-local-variable 'fill-paragraph-function) 'octave-fill-paragraph) + (setq-local parse-sexp-ignore-comments t) + (setq-local paragraph-start (concat "\\s-*$\\|" page-delimiter)) + (setq-local paragraph-separate paragraph-start) + (setq-local paragraph-ignore-fill-prefix t) + (setq-local fill-paragraph-function 'octave-fill-paragraph) ;; FIXME: Why disable it? - ;; (set (make-local-variable 'adaptive-fill-regexp) nil) + ;; (setq-local adaptive-fill-regexp nil) ;; Again, this is not a property of the language, don't set it here. - ;; (set (make-local-variable 'fill-column) 72) - (set (make-local-variable 'normal-auto-fill-function) 'octave-auto-fill) - - (set (make-local-variable 'font-lock-defaults) - '(octave-font-lock-keywords)) - - (set (make-local-variable 'syntax-propertize-function) - #'octave-syntax-propertize-function) - - (set (make-local-variable 'imenu-generic-expression) - octave-mode-imenu-generic-expression) - (set (make-local-variable 'imenu-case-fold-search) nil) + ;; (setq fill-column 72) + (setq-local normal-auto-fill-function 'octave-auto-fill) + + (setq font-lock-defaults '(octave-font-lock-keywords)) + + (setq-local syntax-propertize-function #'octave-syntax-propertize-function) + + (setq imenu-generic-expression octave-mode-imenu-generic-expression) + (setq imenu-case-fold-search nil) (add-hook 'completion-at-point-functions 'octave-completion-at-point-function nil t) - (set (make-local-variable 'beginning-of-defun-function) - 'octave-beginning-of-defun) + (setq-local beginning-of-defun-function 'octave-beginning-of-defun) (easy-menu-add octave-mode-menu)) @@ -738,21 +732,20 @@ mode-line-process '(":%s") local-abbrev-table octave-abbrev-table) - (set (make-local-variable 'comment-start) octave-comment-start) - (set (make-local-variable 'comment-end) "") - (set (make-local-variable 'comment-column) 32) - (set (make-local-variable 'comment-start-skip) octave-comment-start-skip) - - (set (make-local-variable 'font-lock-defaults) - '(inferior-octave-font-lock-keywords nil nil)) - - (set (make-local-variable 'info-lookup-mode) 'octave-mode) + (setq-local comment-start octave-comment-start) + (setq-local comment-end "") + (setq comment-column 32) + (setq-local comment-start-skip octave-comment-start-skip) + + (setq font-lock-defaults '(inferior-octave-font-lock-keywords nil nil)) + + (setq info-lookup-mode 'octave-mode) (setq comint-input-ring-file-name (or (getenv "OCTAVE_HISTFILE") "~/.octave_hist") comint-input-ring-size (or (getenv "OCTAVE_HISTSIZE") 1024)) - (set (make-local-variable 'comint-dynamic-complete-functions) - inferior-octave-dynamic-complete-functions) + (setq-local comint-dynamic-complete-functions + inferior-octave-dynamic-complete-functions) (add-hook 'comint-input-filter-functions 'inferior-octave-directory-tracker nil t) (comint-read-input-ring t)) @@ -989,19 +982,17 @@ ;;; Miscellaneous useful functions -(defsubst octave-in-comment-p () - "Return t if point is inside an Octave comment." +(defun octave-in-comment-p () + "Return non-nil if point is inside an Octave comment." (nth 4 (syntax-ppss))) -(defsubst octave-in-string-p () - "Return t if point is inside an Octave string." +(defun octave-in-string-p () + "Return non-nil if point is inside an Octave string." (nth 3 (syntax-ppss))) -(defsubst octave-not-in-string-or-comment-p () - "Return t if point is not inside an Octave string or comment." - (let ((pps (syntax-ppss))) - (not (or (nth 3 pps) (nth 4 pps))))) - +(defun octave-in-string-or-comment-p () + "Return non-nil if point is inside an Octave string or comment." + (nth 8 (syntax-ppss))) (defun octave-looking-at-kw (regexp) "Like `looking-at', but sets `case-fold-search' nil." @@ -1149,8 +1140,8 @@ (while (and (/= arg 0) (setq found (re-search-backward "\\_" inc))) - (if (octave-not-in-string-or-comment-p) - (setq arg (- arg inc)))) + (unless (octave-in-string-or-comment-p) + (setq arg (- arg inc)))) (if found (progn (and (< inc 0) (goto-char (match-beginning 0))) @@ -1330,7 +1321,7 @@ "Insert an Octave function skeleton. Prompt for the function's name, arguments and return values (to be entered without parens)." - (let* ((defname (substring (buffer-name) 0 -2)) + (let* ((defname (file-name-sans-extension (buffer-name))) (name (read-string (format "Function name (default %s): " defname) nil nil defname)) (args (read-string "Arguments: ")) @@ -1450,26 +1441,7 @@ "\n"))) (mapconcat 'identity inferior-octave-output-list "\n"))) (terpri))) - -;;; Bug reporting -(defun octave-submit-bug-report () - "Submit a bug report on the Emacs Octave package via mail." - (interactive) - (require 'reporter) - (and - (y-or-n-p "Do you want to submit a bug report? ") - (reporter-submit-bug-report - octave-maintainer-address - (concat "Emacs version " emacs-version) - (list - 'octave-blink-matching-block - 'octave-block-offset - 'octave-comment-char - 'octave-continuation-offset - 'octave-continuation-string - 'octave-send-echo-input - 'octave-send-line-auto-forward - 'octave-send-show-buffer)))) + (provide 'octave) ;;; octave.el ends here ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.