aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2013-04-28 08:30:52 +0200
committerJoakim Verona2013-04-28 08:30:52 +0200
commit4e3a566de7bac86c5badfe6afe91bac95829993d (patch)
treeeefff8fe9b9d8c08b9ab800b0e42ae5fad35c9aa
parent06f6571ea6d9f795859cbd2591b1ea5bdfe8abe0 (diff)
parent4afd650a586bdf3bb393b4b3aef042c7e2a5c8a4 (diff)
downloademacs-4e3a566de7bac86c5badfe6afe91bac95829993d.tar.gz
emacs-4e3a566de7bac86c5badfe6afe91bac95829993d.zip
auto upstream
-rw-r--r--ChangeLog5
-rwxr-xr-xautogen/configure49
-rw-r--r--etc/NEWS5
-rw-r--r--lib/intprops.h2
-rw-r--r--lisp/ChangeLog66
-rw-r--r--lisp/cedet/ChangeLog8
-rw-r--r--lisp/cedet/semantic/complete.el7
-rw-r--r--lisp/desktop.el69
-rw-r--r--lisp/emacs-lisp/package.el6
-rw-r--r--lisp/faces.el57
-rw-r--r--lisp/files.el3
-rw-r--r--lisp/gnus/ChangeLog10
-rw-r--r--lisp/gnus/gnus.el7
-rw-r--r--lisp/gnus/sieve-manage.el5
-rw-r--r--lisp/isearch.el5
-rw-r--r--lisp/ls-lisp.el7
-rw-r--r--lisp/progmodes/octave.el212
-rw-r--r--lisp/subr.el4
-rw-r--r--lisp/vc/log-view.el4
-rw-r--r--src/ChangeLog16
-rw-r--r--src/callint.c26
-rw-r--r--src/font.c21
-rw-r--r--src/systime.h2
23 files changed, 406 insertions, 190 deletions
diff --git a/ChangeLog b/ChangeLog
index cf1d4f0d54e..a6dfed3dc56 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
12013-04-27 Paul Eggert <eggert@cs.ucla.edu>
2
3 Merge from gnulib, incorporating:
4 2013-04-27 alignof, intprops, malloca: port better to IBM's C compiler
5
12013-04-26 Paul Eggert <eggert@cs.ucla.edu> 62013-04-26 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 Port better to AIX (Bug#14258). 8 Port better to AIX (Bug#14258).
diff --git a/autogen/configure b/autogen/configure
index 7ddac01fb10..bd900b5afef 100755
--- a/autogen/configure
+++ b/autogen/configure
@@ -7271,10 +7271,10 @@ esac
7271 # Code from module xalloc-oversized: 7271 # Code from module xalloc-oversized:
7272 7272
7273 7273
7274# It's helpful to have C macros available to GDB, so prefer -g3 to -g
7275# if -g3 works and the user does not specify CFLAGS.
7276# This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains.
7277if test "$ac_test_CFLAGS" != set; then 7274if test "$ac_test_CFLAGS" != set; then
7275 # It's helpful to have C macros available to GDB, so prefer -g3 to -g
7276 # if -g3 works and the user does not specify CFLAGS.
7277 # This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains.
7278 case $CFLAGS in 7278 case $CFLAGS in
7279 '-g') 7279 '-g')
7280 emacs_g3_CFLAGS='-g3';; 7280 emacs_g3_CFLAGS='-g3';;
@@ -7312,12 +7312,49 @@ rm -f core conftest.err conftest.$ac_objext \
7312fi 7312fi
7313{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_prog_cc_g3" >&5 7313{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_prog_cc_g3" >&5
7314$as_echo "$emacs_cv_prog_cc_g3" >&6; } 7314$as_echo "$emacs_cv_prog_cc_g3" >&6; }
7315 if test $emacs_cv_prog_cc_g3 = yes; then 7315 if test $emacs_cv_prog_cc_g3 != yes; then
7316 CFLAGS=$emacs_g3_CFLAGS
7317 else
7318 CFLAGS=$emacs_save_CFLAGS 7316 CFLAGS=$emacs_save_CFLAGS
7319 fi 7317 fi
7320 fi 7318 fi
7319
7320 case $CFLAGS in
7321 *-O*) ;;
7322 *)
7323 # No optimization flag was inferred for this non-GCC compiler.
7324 # Try -O. This is needed for xlc on AIX; see Bug#14258.
7325 emacs_save_CFLAGS=$CFLAGS
7326 test -z "$CFLAGS" || CFLAGS="$CFLAGS "
7327 CFLAGS=${CFLAGS}-O
7328 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -O" >&5
7329$as_echo_n "checking whether $CC accepts -O... " >&6; }
7330if test "${emacs_cv_prog_cc_o+set}" = set; then :
7331 $as_echo_n "(cached) " >&6
7332else
7333 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7334/* end confdefs.h. */
7335
7336int
7337main ()
7338{
7339
7340 ;
7341 return 0;
7342}
7343_ACEOF
7344if ac_fn_c_try_link "$LINENO"; then :
7345 emacs_cv_prog_cc_o=yes
7346else
7347 emacs_cv_prog_cc_o=no
7348fi
7349rm -f core conftest.err conftest.$ac_objext \
7350 conftest$ac_exeext conftest.$ac_ext
7351fi
7352{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_prog_cc_o" >&5
7353$as_echo "$emacs_cv_prog_cc_o" >&6; }
7354 if test $emacs_cv_prog_cc_o != yes; then
7355 CFLAGS=$emacs_save_CFLAGS
7356 fi ;;
7357 esac
7321fi 7358fi
7322 7359
7323# Check whether --enable-gcc-warnings was given. 7360# Check whether --enable-gcc-warnings was given.
diff --git a/etc/NEWS b/etc/NEWS
index f6335d314eb..0a8cf2c0325 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -169,6 +169,11 @@ on the given date.
169 169
170*** Support for ISO 8601 dates. 170*** Support for ISO 8601 dates.
171 171
172** Desktop
173
174*** `desktop-auto-save-timeout' defines the number of seconds between
175auto-saves of the desktop.
176
172** Dired 177** Dired
173 178
174*** New minor mode `dired-hide-details-mode' hides details. 179*** New minor mode `dired-hide-details-mode' hides details.
diff --git a/lib/intprops.h b/lib/intprops.h
index b473052d114..f57f9b4ddab 100644
--- a/lib/intprops.h
+++ b/lib/intprops.h
@@ -89,7 +89,7 @@
89 89
90/* Return 1 if the __typeof__ keyword works. This could be done by 90/* Return 1 if the __typeof__ keyword works. This could be done by
91 'configure', but for now it's easier to do it by hand. */ 91 'configure', but for now it's easier to do it by hand. */
92#if 2 <= __GNUC__ || 0x5110 <= __SUNPRO_C 92#if 2 <= __GNUC__ || defined __IBM__TYPEOF__ || 0x5110 <= __SUNPRO_C
93# define _GL_HAVE___TYPEOF__ 1 93# define _GL_HAVE___TYPEOF__ 1
94#else 94#else
95# define _GL_HAVE___TYPEOF__ 0 95# define _GL_HAVE___TYPEOF__ 0
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c88cf1103bc..163f2495849 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,67 @@
12013-04-27 Darren Hoo <darren.hoo@gmail.com> (tiny change)
2
3 * isearch.el (isearch-fail-pos): Check for empty `cmds'. (Bug#14268)
4
52013-04-27 Glenn Morris <rgm@gnu.org>
6
7 * vc/log-view.el (log-view-current-entry):
8 Treat "---" separator lines as part of the following rev. (Bug#14169)
9
102013-04-27 Juri Linkov <juri@jurta.org>
11
12 * subr.el (read-number): Doc fix about using it by interactive
13 code letter `n'. (Bug#14254)
14
152013-04-27 Juri Linkov <juri@jurta.org>
16
17 * desktop.el (desktop-auto-save-timeout): New option.
18 (desktop-file-checksum): New variable.
19 (desktop-save): Add optional arg `auto-save' and don't auto-save
20 if nothing changed.
21 (desktop-auto-save-timer): New variable.
22 (desktop-auto-save, desktop-auto-save-set-timer): New functions.
23 (after-init-hook): Call `desktop-auto-save-set-timer'.
24 Suggested by Reuben Thomas <rrt@sc3d.org> in
25 <http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00327.html>.
26
272013-04-27 Leo Liu <sdl.web@gmail.com>
28
29 * progmodes/octave.el (octave-function-file-p)
30 (octave-skip-comment-forward, octave-function-file-comment)
31 (octave-update-function-file-comment): New functions.
32 (octave-mode-map): Bind C-c ; to
33 octave-update-function-file-comment.
34 (octave-mode-menu): Add octave-update-function-file-comment.
35 (octave-mode, inferior-octave-mode): Fix doc-string.
36 (octave-insert-defun): Conform to Octave's coding convention.
37 (Bug#14285)
38
39 * files.el (basic-save-buffer): Don't let errors in
40 before-save-hook prevent saving buffer.
41
422013-04-20 Roland Winkler <winkler@gnu.org>
43
44 * faces.el (read-face-name): Use completing-read if arg multiple
45 is nil.
46
472013-04-27 Ingo Lohmar <i.lohmar@gmail.com> (tiny change)
48
49 * ls-lisp.el (ls-lisp-insert-directory): If no files are
50 displayed, move point to after the totals line. See
51 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00677.html
52 for the details.
53
542013-04-27 Stefan Monnier <monnier@iro.umontreal.ca>
55
56 * emacs-lisp/package.el (package-autoload-ensure-default-file):
57 Add current dir to the load-path.
58 (package-generate-autoloads): Don't rely on
59 autoload-ensure-default-file.
60
12013-04-26 Reuben Thomas <rrt@sc3d.org> 612013-04-26 Reuben Thomas <rrt@sc3d.org>
2 62
3 * textmodes/remember.el (remember-store-in-files): document that 63 * textmodes/remember.el (remember-store-in-files): Document that
4 the file name format is fed through format-time-string. 64 the file name format is passed to `format-time-string'.
5 65
62013-04-26 Leo Liu <sdl.web@gmail.com> 662013-04-26 Leo Liu <sdl.web@gmail.com>
7 67
@@ -126,7 +186,7 @@
126 (opascal-parse-next-literal, opascal-debug-unparse-buffer): 186 (opascal-parse-next-literal, opascal-debug-unparse-buffer):
127 Adjust callers. 187 Adjust callers.
128 188
1292013-04-24 Reuben Thomas <rrt@sc3d.org> 1892013-04-24 Reuben Thomas <rrt@sc3d.org>
130 190
131 * textmodes/remember.el (remember-handler-functions): Add an 191 * textmodes/remember.el (remember-handler-functions): Add an
132 option for a new handler `remember-store-in-files'. 192 option for a new handler `remember-store-in-files'.
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index 8b914e8843e..944a9e1a02a 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,3 +1,11 @@
12013-04-27 David Engster <deng@randomsample.de>
2
3 * semantic/complete.el
4 (semantic-collector-calculate-completions-raw): If
5 `completionslist' is not set, refresh the cache if necessary and
6 use it for completions. This fixes the
7 `semantic-collector-buffer-deep' collector (bug#14265).
8
12013-03-26 Leo Liu <sdl.web@gmail.com> 92013-03-26 Leo Liu <sdl.web@gmail.com>
2 10
3 * semantic/senator.el (senator-copy-tag-to-register): Move 11 * semantic/senator.el (senator-copy-tag-to-register): Move
diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el
index 1c2ddf45c9d..6c2b97a677a 100644
--- a/lisp/cedet/semantic/complete.el
+++ b/lisp/cedet/semantic/complete.el
@@ -988,14 +988,17 @@ Calculate the cache if there isn't one."
988 "Calculate the completions for prefix from completionlist. 988 "Calculate the completions for prefix from completionlist.
989Output must be in semanticdb Find result format." 989Output must be in semanticdb Find result format."
990 ;; Must output in semanticdb format 990 ;; Must output in semanticdb format
991 (unless completionlist
992 (setq completionlist
993 (or (oref obj cache)
994 (semantic-collector-calculate-cache obj))))
991 (let ((table (with-current-buffer (oref obj buffer) 995 (let ((table (with-current-buffer (oref obj buffer)
992 semanticdb-current-table)) 996 semanticdb-current-table))
993 (result (semantic-find-tags-for-completion 997 (result (semantic-find-tags-for-completion
994 prefix 998 prefix
995 ;; To do this kind of search with a pre-built completion 999 ;; To do this kind of search with a pre-built completion
996 ;; list, we need to strip it first. 1000 ;; list, we need to strip it first.
997 (semanticdb-strip-find-results completionlist))) 1001 (semanticdb-strip-find-results completionlist))))
998 )
999 (if result 1002 (if result
1000 (list (cons table result))))) 1003 (list (cons table result)))))
1001 1004
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 9c95f597fff..e9a839c4cf7 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -189,6 +189,19 @@ determine where the desktop is saved."
189 :group 'desktop 189 :group 'desktop
190 :version "22.1") 190 :version "22.1")
191 191
192(defcustom desktop-auto-save-timeout nil
193 "Number of seconds between auto-saves of the desktop.
194Zero or nil means disable timer-based auto-saving."
195 :type '(choice (const :tag "Off" nil)
196 (integer :tag "Seconds"))
197 :set (lambda (symbol value)
198 (set-default symbol value)
199 (condition-case nil
200 (desktop-auto-save-set-timer)
201 (error nil)))
202 :group 'desktop
203 :version "24.4")
204
192(defcustom desktop-load-locked-desktop 'ask 205(defcustom desktop-load-locked-desktop 'ask
193 "Specifies whether the desktop should be loaded if locked. 206 "Specifies whether the desktop should be loaded if locked.
194Possible values are: 207Possible values are:
@@ -539,6 +552,10 @@ DIRNAME omitted or nil means use `desktop-dirname'."
539(defvar desktop-delay-hook nil 552(defvar desktop-delay-hook nil
540 "Hooks run after all buffers are loaded; intended for internal use.") 553 "Hooks run after all buffers are loaded; intended for internal use.")
541 554
555(defvar desktop-file-checksum nil
556 "Checksum of the last auto-saved contents of the desktop file.
557Used to avoid writing contents unchanged between auto-saves.")
558
542;; ---------------------------------------------------------------------------- 559;; ----------------------------------------------------------------------------
543;; Desktop file conflict detection 560;; Desktop file conflict detection
544(defvar desktop-file-modtime nil 561(defvar desktop-file-modtime nil
@@ -842,11 +859,12 @@ DIRNAME must be the directory in which the desktop file will be saved."
842 859
843;; ---------------------------------------------------------------------------- 860;; ----------------------------------------------------------------------------
844;;;###autoload 861;;;###autoload
845(defun desktop-save (dirname &optional release) 862(defun desktop-save (dirname &optional release auto-save)
846 "Save the desktop in a desktop file. 863 "Save the desktop in a desktop file.
847Parameter DIRNAME specifies where to save the desktop file. 864Parameter DIRNAME specifies where to save the desktop file.
848Optional parameter RELEASE says whether we're done with this desktop. 865Optional parameter RELEASE says whether we're done with this desktop.
849See also `desktop-base-file-name'." 866If AUTO-SAVE is non-nil, compare the saved contents to the one last saved,
867and don't save the buffer if they are the same."
850 (interactive "DDirectory to save desktop file in: ") 868 (interactive "DDirectory to save desktop file in: ")
851 (setq desktop-dirname (file-name-as-directory (expand-file-name dirname))) 869 (setq desktop-dirname (file-name-as-directory (expand-file-name dirname)))
852 (save-excursion 870 (save-excursion
@@ -906,10 +924,17 @@ See also `desktop-base-file-name'."
906 (insert ")\n\n")))) 924 (insert ")\n\n"))))
907 925
908 (setq default-directory desktop-dirname) 926 (setq default-directory desktop-dirname)
909 (let ((coding-system-for-write 'emacs-mule)) 927 ;; If auto-saving, avoid writing if nothing has changed since the last write.
910 (write-region (point-min) (point-max) (desktop-full-file-name) nil 'nomessage)) 928 ;; Don't check 300 characters of the header that contains the timestamp.
911 ;; We remember when it was modified (which is presumably just now). 929 (let ((checksum (and auto-save (md5 (current-buffer)
912 (setq desktop-file-modtime (nth 5 (file-attributes (desktop-full-file-name))))))))) 930 (+ (point-min) 300) (point-max)
931 'emacs-mule))))
932 (unless (and auto-save (equal checksum desktop-file-checksum))
933 (let ((coding-system-for-write 'emacs-mule))
934 (write-region (point-min) (point-max) (desktop-full-file-name) nil 'nomessage))
935 (setq desktop-file-checksum checksum)
936 ;; We remember when it was modified (which is presumably just now).
937 (setq desktop-file-modtime (nth 5 (file-attributes (desktop-full-file-name)))))))))))
913 938
914;; ---------------------------------------------------------------------------- 939;; ----------------------------------------------------------------------------
915;;;###autoload 940;;;###autoload
@@ -1063,6 +1088,37 @@ directory DIRNAME."
1063 (message "Desktop saved in %s" (abbreviate-file-name desktop-dirname))) 1088 (message "Desktop saved in %s" (abbreviate-file-name desktop-dirname)))
1064 1089
1065;; ---------------------------------------------------------------------------- 1090;; ----------------------------------------------------------------------------
1091;; Auto-Saving.
1092(defvar desktop-auto-save-timer nil)
1093
1094(defun desktop-auto-save ()
1095 "Save the desktop periodically.
1096Called by the timer created in `desktop-auto-save-set-timer'."
1097 (when (and desktop-save-mode
1098 (integerp desktop-auto-save-timeout)
1099 (> desktop-auto-save-timeout 0)
1100 ;; Avoid desktop saving during lazy loading.
1101 (not desktop-lazy-timer)
1102 ;; Save only to own desktop file.
1103 (eq (emacs-pid) (desktop-owner))
1104 desktop-dirname)
1105 (desktop-save desktop-dirname nil t))
1106 (desktop-auto-save-set-timer))
1107
1108(defun desktop-auto-save-set-timer ()
1109 "Reset the auto-save timer.
1110Cancel any previous timer. When `desktop-auto-save-timeout' is a positive
1111integer, start a new timer to call `desktop-auto-save' in that many seconds."
1112 (when desktop-auto-save-timer
1113 (cancel-timer desktop-auto-save-timer)
1114 (setq desktop-auto-save-timer nil))
1115 (when (and (integerp desktop-auto-save-timeout)
1116 (> desktop-auto-save-timeout 0))
1117 (setq desktop-auto-save-timer
1118 (run-with-timer desktop-auto-save-timeout nil
1119 'desktop-auto-save))))
1120
1121;; ----------------------------------------------------------------------------
1066;;;###autoload 1122;;;###autoload
1067(defun desktop-revert () 1123(defun desktop-revert ()
1068 "Revert to the last loaded desktop." 1124 "Revert to the last loaded desktop."
@@ -1315,6 +1371,7 @@ If there are no buffers left to create, kill the timer."
1315 (setq desktop-save-mode nil))) 1371 (setq desktop-save-mode nil)))
1316 (when desktop-save-mode 1372 (when desktop-save-mode
1317 (desktop-read) 1373 (desktop-read)
1374 (desktop-auto-save-set-timer)
1318 (setq inhibit-startup-screen t)))) 1375 (setq inhibit-startup-screen t))))
1319 1376
1320(provide 'desktop) 1377(provide 'desktop)
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 605d1cf375c..c80b8d970dc 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -588,7 +588,8 @@ EXTRA-PROPERTIES is currently unused."
588 (concat ";;; " (file-name-nondirectory file) 588 (concat ";;; " (file-name-nondirectory file)
589 " --- automatically extracted autoloads\n" 589 " --- automatically extracted autoloads\n"
590 ";;\n" 590 ";;\n"
591 ";;; Code:\n\n" 591 ";;; Code:\n"
592 "(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))\n"
592 " \n;; Local Variables:\n" 593 " \n;; Local Variables:\n"
593 ";; version-control: never\n" 594 ";; version-control: never\n"
594 ";; no-byte-compile: t\n" 595 ";; no-byte-compile: t\n"
@@ -605,8 +606,7 @@ EXTRA-PROPERTIES is currently unused."
605 ;;(ignore-name (concat name "-pkg.el")) 606 ;;(ignore-name (concat name "-pkg.el"))
606 (generated-autoload-file (expand-file-name auto-name pkg-dir)) 607 (generated-autoload-file (expand-file-name auto-name pkg-dir))
607 (version-control 'never)) 608 (version-control 'never))
608 (unless (fboundp 'autoload-ensure-default-file) 609 (package-autoload-ensure-default-file generated-autoload-file)
609 (package-autoload-ensure-default-file generated-autoload-file))
610 (update-directory-autoloads pkg-dir) 610 (update-directory-autoloads pkg-dir)
611 (let ((buf (find-buffer-visiting generated-autoload-file))) 611 (let ((buf (find-buffer-visiting generated-autoload-file)))
612 (when buf (kill-buffer buf))))) 612 (when buf (kill-buffer buf)))))
diff --git a/lisp/faces.el b/lisp/faces.el
index 6179ed7dfa7..80f34d4569a 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -938,19 +938,14 @@ of the default face. Value is FACE."
938PROMPT should not end in a space or a colon. 938PROMPT should not end in a space or a colon.
939 939
940Return DEFAULT if the user enters the empty string. 940Return DEFAULT if the user enters the empty string.
941If DEFAULT is non-nil, it should be a list of face names (symbols or strings). 941If DEFAULT is non-nil, it should be a single face or a list of face names
942In that case, return the `car' of DEFAULT (if MULTIPLE is non-nil), 942\(symbols or strings). In the latter case, return the `car' of DEFAULT
943or DEFAULT (if MULTIPLE is nil). See below for the meaning of MULTIPLE. 943\(if MULTIPLE is nil, see below), or DEFAULT (if MULTIPLE is non-nil).
944DEFAULT can also be a single face. 944
945 945If MULTIPLE is non-nil, this function uses `completing-read-multiple'
946This function uses `completing-read-multiple' with \"[ \\t]*,[ \\t]*\" 946to read multiple faces with \"[ \\t]*,[ \\t]*\" as the separator regexp
947as the separator regexp. Thus, the user may enter multiple face names, 947and it returns a list of face names. Otherwise, it reads and returns
948separated by commas. 948a single face name."
949
950MULTIPLE specifies the form of the return value. If MULTIPLE is non-nil,
951return a list of face names; if the user entered just one face name,
952return a list of one face name. Otherwise, return a single face name;
953if the user entered more than one face name, return only the first one."
954 (if (and default (not (stringp default))) 949 (if (and default (not (stringp default)))
955 (setq default 950 (setq default
956 (cond ((symbolp default) 951 (cond ((symbolp default)
@@ -961,26 +956,36 @@ if the user entered more than one face name, return only the first one."
961 ;; If we only want one, and the default is more than one, 956 ;; If we only want one, and the default is more than one,
962 ;; discard the unwanted ones. 957 ;; discard the unwanted ones.
963 (t (symbol-name (car default)))))) 958 (t (symbol-name (car default))))))
964 959 (if (and default (not multiple))
965 (let (aliasfaces nonaliasfaces faces) 960 ;; For compatibility with `completing-read-multiple' use `crm-separator'
961 ;; to define DEFAULT if MULTIPLE is nil.
962 (setq default (car (split-string default crm-separator t))))
963
964 (let ((prompt (if default
965 (format "%s (default `%s'): " prompt default)
966 (format "%s: " prompt)))
967 aliasfaces nonaliasfaces faces)
966 ;; Build up the completion tables. 968 ;; Build up the completion tables.
967 (mapatoms (lambda (s) 969 (mapatoms (lambda (s)
968 (if (facep s) 970 (if (facep s)
969 (if (get s 'face-alias) 971 (if (get s 'face-alias)
970 (push (symbol-name s) aliasfaces) 972 (push (symbol-name s) aliasfaces)
971 (push (symbol-name s) nonaliasfaces))))) 973 (push (symbol-name s) nonaliasfaces)))))
972 (dolist (face (completing-read-multiple 974 (if multiple
973 (if default 975 (progn
974 (format "%s (default `%s'): " prompt default) 976 (dolist (face (completing-read-multiple
975 (format "%s: " prompt)) 977 prompt
978 (completion-table-in-turn nonaliasfaces aliasfaces)
979 nil t nil 'face-name-history default))
980 ;; Ignore elements that are not faces
981 ;; (for example, because DEFAULT was "all faces")
982 (if (facep face) (push (intern face) faces)))
983 (nreverse faces))
984 (let ((face (completing-read
985 prompt
976 (completion-table-in-turn nonaliasfaces aliasfaces) 986 (completion-table-in-turn nonaliasfaces aliasfaces)
977 nil t nil 'face-name-history default)) 987 nil t nil 'face-name-history default)))
978 ;; Ignore elements that are not faces 988 (if (facep face) (intern face))))))
979 ;; (for example, because DEFAULT was "all faces")
980 (if (facep face) (push (intern face) faces)))
981 ;; Return either a list of faces or just one face.
982 (setq faces (nreverse faces))
983 (if multiple faces (car faces))))
984 989
985;; Not defined without X, but behind window-system test. 990;; Not defined without X, but behind window-system test.
986(defvar x-bitmap-file-path) 991(defvar x-bitmap-file-path)
diff --git a/lisp/files.el b/lisp/files.el
index ae5e5a23161..eebbf15e02e 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4617,7 +4617,8 @@ Before and after saving the buffer, this function runs
4617 (insert ?\n)))) 4617 (insert ?\n))))
4618 ;; Support VC version backups. 4618 ;; Support VC version backups.
4619 (vc-before-save) 4619 (vc-before-save)
4620 (run-hooks 'before-save-hook) 4620 ;; Don't let errors prevent saving the buffer.
4621 (with-demoted-errors (run-hooks 'before-save-hook))
4621 (or (run-hook-with-args-until-success 'write-contents-functions) 4622 (or (run-hook-with-args-until-success 'write-contents-functions)
4622 (run-hook-with-args-until-success 'local-write-file-hooks) 4623 (run-hook-with-args-until-success 'local-write-file-hooks)
4623 (run-hook-with-args-until-success 'write-file-functions) 4624 (run-hook-with-args-until-success 'write-file-functions)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index e10dd1e94c7..b4d3627d711 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,13 @@
12013-04-27 Glenn Morris <rgm@gnu.org>
2
3 * gnus.el (gnus-list-debbugs):
4 Use require rather than autoload. (Bug#14262)
5
62013-04-27 Julien Danjou <julien@danjou.info>
7
8 * sieve-manage.el (sieve-manage-authenticator-alist): Update the sieve
9 port to "sieve" now that it has an official IANA port assigned.
10
12013-04-26 Katsumi Yamaoka <yamaoka@jpl.org> 112013-04-26 Katsumi Yamaoka <yamaoka@jpl.org>
2 12
3 * mail-source.el (mail-source-fetch-pop, mail-source-check-pop): 13 * mail-source.el (mail-source-fetch-pop, mail-source-check-pop):
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index ffb4694f4a8..f6c1327c78c 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -4433,12 +4433,13 @@ prompt the user for the name of an NNTP server to use."
4433 (gnus-1 arg dont-connect slave) 4433 (gnus-1 arg dont-connect slave)
4434 (gnus-final-warning))) 4434 (gnus-final-warning)))
4435 4435
4436(eval-and-compile 4436(declare-function debbugs-gnu "ext:debbugs-gnu"
4437 (unless (fboundp 'debbugs-gnu) 4437 (severities &optional packages archivedp suppress tags))
4438 (autoload 'debbugs-gnu "debbugs-gnu" "List all outstanding Emacs bugs." t))) 4438
4439(defun gnus-list-debbugs () 4439(defun gnus-list-debbugs ()
4440 "List all open Gnus bug reports." 4440 "List all open Gnus bug reports."
4441 (interactive) 4441 (interactive)
4442 (require 'debbugs-gnu)
4442 (debbugs-gnu nil "gnus")) 4443 (debbugs-gnu nil "gnus"))
4443 4444
4444;; Allow redefinition of Gnus functions. 4445;; Allow redefinition of Gnus functions.
diff --git a/lisp/gnus/sieve-manage.el b/lisp/gnus/sieve-manage.el
index 22c1f7036bf..b96261764e5 100644
--- a/lisp/gnus/sieve-manage.el
+++ b/lisp/gnus/sieve-manage.el
@@ -149,9 +149,10 @@ the server support the authenticator and AUTHENTICATE is a function
149for doing the actual authentication." 149for doing the actual authentication."
150 :group 'sieve-manage) 150 :group 'sieve-manage)
151 151
152(defcustom sieve-manage-default-port 2000 152(defcustom sieve-manage-default-port "sieve"
153 "Default port number or service name for managesieve protocol." 153 "Default port number or service name for managesieve protocol."
154 :type 'integer 154 :type '(choice integer string)
155 :version "24.4"
155 :group 'sieve-manage) 156 :group 'sieve-manage)
156 157
157(defcustom sieve-manage-default-stream 'network 158(defcustom sieve-manage-default-stream 'network
diff --git a/lisp/isearch.el b/lisp/isearch.el
index b36b250738a..b38bfc885f7 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1106,8 +1106,9 @@ If MSG is non-nil, use variable `isearch-message', otherwise `isearch-string'."
1106 (curr-msg (if msg isearch-message isearch-string)) 1106 (curr-msg (if msg isearch-message isearch-string))
1107 succ-msg) 1107 succ-msg)
1108 (when (or (not isearch-success) isearch-error) 1108 (when (or (not isearch-success) isearch-error)
1109 (while (or (not (isearch--state-success (car cmds))) 1109 (while (and cmds
1110 (isearch--state-error (car cmds))) 1110 (or (not (isearch--state-success (car cmds)))
1111 (isearch--state-error (car cmds))))
1111 (pop cmds)) 1112 (pop cmds))
1112 (setq succ-msg (and cmds (if msg (isearch--state-message (car cmds)) 1113 (setq succ-msg (and cmds (if msg (isearch--state-message (car cmds))
1113 (isearch--state-string (car cmds))))) 1114 (isearch--state-string (car cmds)))))
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index 70ee4394b88..60d6b7b7ba5 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -404,6 +404,13 @@ not contain `d', so that a full listing is expected."
404 ;; the wildcard; let's say something similar. 404 ;; the wildcard; let's say something similar.
405 (insert "(No match)\n")) 405 (insert "(No match)\n"))
406 (insert (format "total %.0f\n" (fceiling (/ sum 1024.0)))))) 406 (insert (format "total %.0f\n" (fceiling (/ sum 1024.0))))))
407 ;; dired-insert-directory exprects to find point after the
408 ;; text. But if the listinmg is empty, as e.g. in empty
409 ;; directories with -a removed from switches, point will be
410 ;; before the inserted text, and dired-insert-directory will
411 ;; not indent the listing correctly. Going to the end of the
412 ;; buffer fixes that.
413 (unless files (goto-char (point-max)))
407 (if (memq ?R switches) 414 (if (memq ?R switches)
408 ;; List the contents of all directories recursively. 415 ;; List the contents of all directories recursively.
409 ;; cadr of each element of `file-alist' is t for 416 ;; cadr of each element of `file-alist' is t for
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index f8b9e4f6fab..b8fbe6a90a7 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -198,7 +198,6 @@ parenthetical grouping.")
198 (define-key map "`" 'octave-abbrev-start) 198 (define-key map "`" 'octave-abbrev-start)
199 (define-key map "\e\n" 'octave-indent-new-comment-line) 199 (define-key map "\e\n" 'octave-indent-new-comment-line)
200 (define-key map "\M-\C-q" 'octave-indent-defun) 200 (define-key map "\M-\C-q" 'octave-indent-defun)
201 (define-key map "\C-c\C-b" 'octave-submit-bug-report)
202 (define-key map "\C-c\C-p" 'octave-previous-code-line) 201 (define-key map "\C-c\C-p" 'octave-previous-code-line)
203 (define-key map "\C-c\C-n" 'octave-next-code-line) 202 (define-key map "\C-c\C-n" 'octave-next-code-line)
204 (define-key map "\C-c\C-a" 'octave-beginning-of-line) 203 (define-key map "\C-c\C-a" 'octave-beginning-of-line)
@@ -207,6 +206,7 @@ parenthetical grouping.")
207 (define-key map "\C-c\M-\C-h" 'octave-mark-block) 206 (define-key map "\C-c\M-\C-h" 'octave-mark-block)
208 (define-key map "\C-c]" 'smie-close-block) 207 (define-key map "\C-c]" 'smie-close-block)
209 (define-key map "\C-c/" 'smie-close-block) 208 (define-key map "\C-c/" 'smie-close-block)
209 (define-key map "\C-c;" 'octave-update-function-file-comment)
210 (define-key map "\C-c\C-f" 'octave-insert-defun) 210 (define-key map "\C-c\C-f" 'octave-insert-defun)
211 (define-key map "\C-c\C-il" 'octave-send-line) 211 (define-key map "\C-c\C-il" 'octave-send-line)
212 (define-key map "\C-c\C-ib" 'octave-send-block) 212 (define-key map "\C-c\C-ib" 'octave-send-block)
@@ -241,7 +241,8 @@ parenthetical grouping.")
241 ["Close Block" smie-close-block t]) 241 ["Close Block" smie-close-block t])
242 ("Functions" 242 ("Functions"
243 ["Indent Function" octave-indent-defun t] 243 ["Indent Function" octave-indent-defun t]
244 ["Insert Function" octave-insert-defun t]) 244 ["Insert Function" octave-insert-defun t]
245 ["Update function file comment" octave-update-function-file-comment t])
245 "-" 246 "-"
246 ("Debug" 247 ("Debug"
247 ["Send Current Line" octave-send-line t] 248 ["Send Current Line" octave-send-line t]
@@ -260,10 +261,11 @@ parenthetical grouping.")
260 ["Toggle Auto-Fill Mode" auto-fill-mode 261 ["Toggle Auto-Fill Mode" auto-fill-mode
261 :style toggle :selected auto-fill-function] 262 :style toggle :selected auto-fill-function]
262 "-" 263 "-"
263 ["Submit Bug Report" octave-submit-bug-report t]
264 "-"
265 ["Describe Octave Mode" describe-mode t] 264 ["Describe Octave Mode" describe-mode t]
266 ["Lookup Octave Index" info-lookup-symbol t])) 265 ["Lookup Octave Index" info-lookup-symbol t]
266 ["Customize Octave" (customize-group 'octave) t]
267 "-"
268 ["Submit Bug Report" report-emacs-bug t]))
267 269
268(defvar octave-mode-syntax-table 270(defvar octave-mode-syntax-table
269 (let ((table (make-syntax-table))) 271 (let ((table (make-syntax-table)))
@@ -508,78 +510,10 @@ Non-nil means always go to the next Octave code line after sending."
508(define-derived-mode octave-mode prog-mode "Octave" 510(define-derived-mode octave-mode prog-mode "Octave"
509 "Major mode for editing Octave code. 511 "Major mode for editing Octave code.
510 512
511This mode makes it easier to write Octave code by helping with 513Octave is a high-level language, primarily intended for numerical
512indentation, doing some of the typing for you (with Abbrev mode) and by 514computations. It provides a convenient command line interface
513showing keywords, comments, strings, etc. in different faces (with 515for solving linear and nonlinear problems numerically. Function
514Font Lock mode on terminals that support it). 516definitions can also be stored in files and used in batch mode."
515
516Octave itself is a high-level language, primarily intended for numerical
517computations. It provides a convenient command line interface for
518solving linear and nonlinear problems numerically. Function definitions
519can also be stored in files, and it can be used in a batch mode (which
520is why you need this mode!).
521
522The latest released version of Octave is always available via anonymous
523ftp from ftp.octave.org in the directory `/pub/octave'. Complete
524source and binaries for several popular systems are available.
525
526Type \\[list-abbrevs] to display the built-in abbrevs for Octave keywords.
527
528Keybindings
529===========
530
531\\{octave-mode-map}
532
533Variables you can use to customize Octave mode
534==============================================
535
536`octave-blink-matching-block'
537 Non-nil means show matching begin of block when inserting a space,
538 newline or semicolon after an else or end keyword. Default is t.
539
540`octave-block-offset'
541 Extra indentation applied to statements in block structures.
542 Default is 2.
543
544`octave-continuation-offset'
545 Extra indentation applied to Octave continuation lines.
546 Default is 4.
547
548`octave-continuation-string'
549 String used for Octave continuation lines.
550 Default is a backslash.
551
552`octave-send-echo-input'
553 Non-nil means always display `inferior-octave-buffer' after sending a
554 command to the inferior Octave process.
555
556`octave-send-line-auto-forward'
557 Non-nil means always go to the next unsent line of Octave code after
558 sending a line to the inferior Octave process.
559
560`octave-send-echo-input'
561 Non-nil means echo input sent to the inferior Octave process.
562
563Turning on Octave mode runs the hook `octave-mode-hook'.
564
565To begin using this mode for all `.m' files that you edit, add the
566following lines to your init file:
567
568 (add-to-list 'auto-mode-alist '(\"\\\\.m\\\\'\" . octave-mode))
569
570To automatically turn on the abbrev and auto-fill features,
571add the following lines to your init file as well:
572
573 (add-hook 'octave-mode-hook
574 (lambda ()
575 (abbrev-mode 1)
576 (auto-fill-mode 1)))
577
578To submit a problem report, enter \\[octave-submit-bug-report] from \
579an Octave mode buffer.
580This automatically sets up a mail buffer with version information
581already added. You just need to add a description of the problem,
582including a reproducible test case and send the message."
583 (setq local-abbrev-table octave-abbrev-table) 517 (setq local-abbrev-table octave-abbrev-table)
584 518
585 (smie-setup octave-smie-grammar #'octave-smie-rules 519 (smie-setup octave-smie-grammar #'octave-smie-rules
@@ -724,12 +658,7 @@ in the Inferior Octave buffer.")
724(defvar info-lookup-mode) 658(defvar info-lookup-mode)
725 659
726(define-derived-mode inferior-octave-mode comint-mode "Inferior Octave" 660(define-derived-mode inferior-octave-mode comint-mode "Inferior Octave"
727 "Major mode for interacting with an inferior Octave process. 661 "Major mode for interacting with an inferior Octave process."
728Runs Octave as a subprocess of Emacs, with Octave I/O through an Emacs
729buffer.
730
731Entry to this mode successively runs the hooks `comint-mode-hook' and
732`inferior-octave-mode-hook'."
733 (setq comint-prompt-regexp inferior-octave-prompt 662 (setq comint-prompt-regexp inferior-octave-prompt
734 mode-line-process '(":%s") 663 mode-line-process '(":%s")
735 local-abbrev-table octave-abbrev-table) 664 local-abbrev-table octave-abbrev-table)
@@ -1010,25 +939,105 @@ directory and makes this the current buffer's default directory."
1010 (delete-horizontal-space) 939 (delete-horizontal-space)
1011 (insert (concat " " octave-continuation-string)))) 940 (insert (concat " " octave-continuation-string))))
1012 941
942(defun octave-function-file-p ()
943 "Return non-nil if the first token is \"function\".
944The value is (START END NAME-START NAME-END) of the function."
945 (save-excursion
946 (goto-char (point-min))
947 (when (equal (funcall smie-forward-token-function) "function")
948 (forward-word -1)
949 (let* ((start (point))
950 (end (progn (forward-sexp 1) (point)))
951 (name (when (progn
952 (goto-char start)
953 (re-search-forward octave-function-header-regexp
954 end t))
955 (list (match-beginning 3) (match-end 3)))))
956 (cons start (cons end name))))))
957
958;; Like forward-comment but stop at non-comment blank
959(defun octave-skip-comment-forward (limit)
960 (let ((ppss (syntax-ppss)))
961 (if (nth 4 ppss)
962 (goto-char (nth 8 ppss))
963 (goto-char (or (comment-search-forward limit t) (point)))))
964 (while (and (< (point) limit) (looking-at-p "\\s<"))
965 (forward-comment 1)))
966
967;;; First non-copyright comment block
968(defun octave-function-file-comment ()
969 "Beginnning and end positions of the function file comment."
970 (save-excursion
971 (goto-char (point-min))
972 (let ((bound (progn (forward-comment (point-max)) (point))))
973 (goto-char (point-min))
974 ;; Copyright block: octave/libinterp/parse-tree/lex.ll around line 1634
975 (when (save-excursion
976 (comment-search-forward bound t)
977 (when (eq (char-after) ?\{) ; case of block comment
978 (forward-char 1))
979 (skip-syntax-forward "-")
980 (let ((case-fold-search t))
981 (looking-at-p "\\(?:copyright\\|author\\)\\_>")))
982 (octave-skip-comment-forward bound))
983 (let ((beg (comment-search-forward bound t)))
984 (when beg
985 (goto-char beg)
986 (octave-skip-comment-forward bound)
987 (list beg (point)))))))
988
1013(defun octave-sync-function-file-names () 989(defun octave-sync-function-file-names ()
1014 "Ensure function name agree with function file name. 990 "Ensure function name agree with function file name.
1015See Info node `(octave)Function Files'." 991See Info node `(octave)Function Files'."
1016 (interactive) 992 (interactive)
993 (when buffer-file-name
994 (pcase-let ((`(,start ,_end ,name-start ,name-end)
995 (octave-function-file-p)))
996 (when (and start name-start)
997 (let ((func (buffer-substring name-start name-end))
998 (file (file-name-sans-extension
999 (file-name-nondirectory buffer-file-name))))
1000 (save-excursion
1001 (when (and (not (equal file func))
1002 (progn
1003 (goto-char name-start)
1004 (yes-or-no-p
1005 "Function name different from file name. Fix? ")))
1006 (delete-region name-start name-end)
1007 (insert file))))))))
1008
1009(defun octave-update-function-file-comment (beg end)
1010 "Query replace function names in function file comment."
1011 (interactive
1012 (progn
1013 (barf-if-buffer-read-only)
1014 (if (use-region-p)
1015 (list (region-beginning) (region-end))
1016 (or (octave-function-file-comment)
1017 (error "No function file comment found")))))
1017 (save-excursion 1018 (save-excursion
1018 (when (and buffer-file-name 1019 (let* ((bounds (or (octave-function-file-p)
1019 (prog2 1020 (error "Not in a function file buffer")))
1020 (goto-char (point-min)) 1021 (func (if (cddr bounds)
1021 (equal (funcall smie-forward-token-function) "function") 1022 (apply #'buffer-substring (cddr bounds))
1022 (forward-word -1))) 1023 (error "Function name not found")))
1023 (let ((file (file-name-sans-extension 1024 (old-func (progn
1024 (file-name-nondirectory buffer-file-name))) 1025 (goto-char beg)
1025 (func (and (re-search-forward octave-function-header-regexp nil t) 1026 (when (and (re-search-forward
1026 (match-string 3)))) 1027 "usage:\\|@deftypefn" end t)
1027 (when (and func 1028 (re-search-forward
1028 (not (equal file func)) 1029 "[=}]\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>"
1029 (yes-or-no-p 1030 (line-end-position) t))
1030 "Function name different from file name. Fix? ")) 1031 (match-string 1))))
1031 (replace-match file nil nil nil 3)))))) 1032 (old-func (read-string (format (if old-func
1033 "Name to replace (default %s): "
1034 "Name to replace: ")
1035 old-func)
1036 nil nil old-func)))
1037 (if (and func old-func (not (equal func old-func)))
1038 (perform-replace old-func func 'query
1039 nil 'delimited nil nil beg end)
1040 (message "Function names match")))))
1032 1041
1033 1042
1034;;; Indentation 1043;;; Indentation
@@ -1356,10 +1365,11 @@ entered without parens)."
1356 (t (concat vals " = "))) 1365 (t (concat vals " = ")))
1357 name 1366 name
1358 args)) 1367 args))
1359 \n "function " > str \n \n 1368 \n octave-block-comment-start "usage: " str \n
1360 octave-block-comment-start "usage: " str \n 1369 octave-block-comment-start '(delete-horizontal-space) \n
1361 octave-block-comment-start \n octave-block-comment-start 1370 octave-block-comment-start '(delete-horizontal-space) \n
1362 \n _ \n 1371 "function " > str \n
1372 _ \n
1363 "endfunction" > \n) 1373 "endfunction" > \n)
1364 1374
1365;;; Communication with the inferior Octave process 1375;;; Communication with the inferior Octave process
diff --git a/lisp/subr.el b/lisp/subr.el
index 523bec59b29..bb23745df72 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2200,11 +2200,11 @@ by doing (clear-string STRING)."
2200 ;; And of course, don't keep the sensitive data around. 2200 ;; And of course, don't keep the sensitive data around.
2201 (erase-buffer)))))))) 2201 (erase-buffer))))))))
2202 2202
2203;; This should be used by `call-interactively' for `n' specs.
2204(defun read-number (prompt &optional default) 2203(defun read-number (prompt &optional default)
2205 "Read a numeric value in the minibuffer, prompting with PROMPT. 2204 "Read a numeric value in the minibuffer, prompting with PROMPT.
2206DEFAULT specifies a default value to return if the user just types RET. 2205DEFAULT specifies a default value to return if the user just types RET.
2207The value of DEFAULT is inserted into PROMPT." 2206The value of DEFAULT is inserted into PROMPT.
2207This function is used by the `interactive' code letter `n'."
2208 (let ((n nil) 2208 (let ((n nil)
2209 (default1 (if (consp default) (car default) default))) 2209 (default1 (if (consp default) (car default) default)))
2210 (when default1 2210 (when default1
diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el
index b74ff77bc41..b633b7be403 100644
--- a/lisp/vc/log-view.el
+++ b/lisp/vc/log-view.el
@@ -317,7 +317,9 @@ Otherwise, don't move point."
317 result) 317 result)
318 (save-excursion 318 (save-excursion
319 (when pos (goto-char pos)) 319 (when pos (goto-char pos))
320 (forward-line 1) 320 (forward-line 0)
321 ;; Treat "---" separator lines as part of the following revision.
322 (forward-line (if (looking-at "-\\{20,\\}$") 2 1))
321 (while looping 323 (while looping
322 (setq pos (re-search-backward log-view-message-re nil 'move) 324 (setq pos (re-search-backward log-view-message-re nil 'move)
323 looping (and pos (log-view-inside-comment-p (point))))) 325 looping (and pos (log-view-inside-comment-p (point)))))
diff --git a/src/ChangeLog b/src/ChangeLog
index 9ae5c29ab72..c9d458c3479 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,19 @@
12013-04-26 Paul Eggert <eggert@cs.ucla.edu> 12013-04-27 Juri Linkov <juri@jurta.org>
2
3 * callint.c (Fcall_interactively): Call `Qread_number' for
4 interactive code letter `n' instead of using duplicate code.
5 (Bug#14254)
6
72013-04-27 Paul Eggert <eggert@cs.ucla.edu>
8
9 * systime.h (make_timeval): Declare as 'const'.
2 10
112013-04-27 Kenichi Handa <handa@gnu.org>
12
13 * font.c (font_open_entity): Always open a font of manageable
14 size.
15
162013-04-26 Paul Eggert <eggert@cs.ucla.edu>
3 Port better to AIX (Bug#14258). 17 Port better to AIX (Bug#14258).
4 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too, 18 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
5 to pacify AIX xlc. 19 to pacify AIX xlc.
diff --git a/src/callint.c b/src/callint.c
index 212dd2e3d62..940ff3ed249 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -34,6 +34,7 @@ static Lisp_Object Qcommand_debug_status;
34static Lisp_Object Qenable_recursive_minibuffers; 34static Lisp_Object Qenable_recursive_minibuffers;
35 35
36static Lisp_Object Qhandle_shift_selection; 36static Lisp_Object Qhandle_shift_selection;
37static Lisp_Object Qread_number;
37 38
38Lisp_Object Qmouse_leave_buffer_hook; 39Lisp_Object Qmouse_leave_buffer_hook;
39 40
@@ -683,29 +684,7 @@ invoke it. If KEYS is omitted or nil, the return value of
683 if (!NILP (prefix_arg)) 684 if (!NILP (prefix_arg))
684 goto have_prefix_arg; 685 goto have_prefix_arg;
685 case 'n': /* Read number from minibuffer. */ 686 case 'n': /* Read number from minibuffer. */
686 { 687 args[i] = call1 (Qread_number, callint_message);
687 bool first = 1;
688 do
689 {
690 Lisp_Object str;
691 if (! first)
692 {
693 message1 ("Please enter a number.");
694 sit_for (make_number (1), 0, 0);
695 }
696 first = 0;
697
698 str = Fread_from_minibuffer (callint_message,
699 Qnil, Qnil, Qnil, Qnil, Qnil,
700 Qnil);
701 if (! STRINGP (str) || SCHARS (str) == 0)
702 args[i] = Qnil;
703 else
704 args[i] = Fread (str);
705 }
706 while (! NUMBERP (args[i]));
707 }
708 visargs[i] = args[i];
709 break; 688 break;
710 689
711 case 'P': /* Prefix arg in raw form. Does no I/O. */ 690 case 'P': /* Prefix arg in raw form. Does no I/O. */
@@ -903,6 +882,7 @@ syms_of_callint (void)
903 DEFSYM (Qminus, "-"); 882 DEFSYM (Qminus, "-");
904 DEFSYM (Qplus, "+"); 883 DEFSYM (Qplus, "+");
905 DEFSYM (Qhandle_shift_selection, "handle-shift-selection"); 884 DEFSYM (Qhandle_shift_selection, "handle-shift-selection");
885 DEFSYM (Qread_number, "read-number");
906 DEFSYM (Qcall_interactively, "call-interactively"); 886 DEFSYM (Qcall_interactively, "call-interactively");
907 DEFSYM (Qcommand_debug_status, "command-debug-status"); 887 DEFSYM (Qcommand_debug_status, "command-debug-status");
908 DEFSYM (Qenable_recursive_minibuffers, "enable-recursive-minibuffers"); 888 DEFSYM (Qenable_recursive_minibuffers, "enable-recursive-minibuffers");
diff --git a/src/font.c b/src/font.c
index 6247eeca948..ad601177b50 100644
--- a/src/font.c
+++ b/src/font.c
@@ -2819,7 +2819,7 @@ font_open_entity (FRAME_PTR f, Lisp_Object entity, int pixel_size)
2819 struct font_driver_list *driver_list; 2819 struct font_driver_list *driver_list;
2820 Lisp_Object objlist, size, val, font_object; 2820 Lisp_Object objlist, size, val, font_object;
2821 struct font *font; 2821 struct font *font;
2822 int min_width, height; 2822 int min_width, height, psize;
2823 2823
2824 eassert (FONT_ENTITY_P (entity)); 2824 eassert (FONT_ENTITY_P (entity));
2825 size = AREF (entity, FONT_SIZE_INDEX); 2825 size = AREF (entity, FONT_SIZE_INDEX);
@@ -2846,12 +2846,19 @@ font_open_entity (FRAME_PTR f, Lisp_Object entity, int pixel_size)
2846 } 2846 }
2847 } 2847 }
2848 2848
2849 font_object = driver_list->driver->open (f, entity, pixel_size); 2849 /* We always open a font of manageable size; i.e non-zero average
2850 if (!NILP (font_object)) 2850 width and height. */
2851 ASET (font_object, FONT_SIZE_INDEX, make_number (pixel_size)); 2851 for (psize = pixel_size; ; psize++)
2852 {
2853 font_object = driver_list->driver->open (f, entity, psize);
2854 if (NILP (font_object))
2855 return Qnil;
2856 font = XFONT_OBJECT (font_object);
2857 if (font->average_width > 0 && font->height > 0)
2858 break;
2859 }
2860 ASET (font_object, FONT_SIZE_INDEX, make_number (pixel_size));
2852 FONT_ADD_LOG ("open", entity, font_object); 2861 FONT_ADD_LOG ("open", entity, font_object);
2853 if (NILP (font_object))
2854 return Qnil;
2855 ASET (entity, FONT_OBJLIST_INDEX, 2862 ASET (entity, FONT_OBJLIST_INDEX,
2856 Fcons (font_object, AREF (entity, FONT_OBJLIST_INDEX))); 2863 Fcons (font_object, AREF (entity, FONT_OBJLIST_INDEX)));
2857 2864
@@ -3118,6 +3125,8 @@ font_find_for_lface (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec, int c)
3118 double pt = XINT (attrs[LFACE_HEIGHT_INDEX]); 3125 double pt = XINT (attrs[LFACE_HEIGHT_INDEX]);
3119 3126
3120 pixel_size = POINT_TO_PIXEL (pt / 10, FRAME_RES_Y (f)); 3127 pixel_size = POINT_TO_PIXEL (pt / 10, FRAME_RES_Y (f));
3128 if (pixel_size < 1)
3129 pixel_size = 1;
3121 } 3130 }
3122 ASET (work, FONT_SIZE_INDEX, Qnil); 3131 ASET (work, FONT_SIZE_INDEX, Qnil);
3123 foundry[0] = AREF (work, FONT_FOUNDRY_INDEX); 3132 foundry[0] = AREF (work, FONT_FOUNDRY_INDEX);
diff --git a/src/systime.h b/src/systime.h
index da495b9064b..c3bc00c1479 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -143,7 +143,7 @@ EMACS_TIME_TO_DOUBLE (EMACS_TIME t)
143 143
144/* defined in sysdep.c */ 144/* defined in sysdep.c */
145extern int set_file_times (int, const char *, EMACS_TIME, EMACS_TIME); 145extern int set_file_times (int, const char *, EMACS_TIME, EMACS_TIME);
146extern struct timeval make_timeval (EMACS_TIME); 146extern struct timeval make_timeval (EMACS_TIME) ATTRIBUTE_CONST;
147 147
148/* defined in keyboard.c */ 148/* defined in keyboard.c */
149extern void set_waiting_for_input (EMACS_TIME *); 149extern void set_waiting_for_input (EMACS_TIME *);