Now on revision 111607. ------------------------------------------------------------ revno: 111607 committer: Alan Mackenzie branch nick: trunk timestamp: Fri 2013-01-25 18:18:14 +0000 message: AWK Mode: Fix indentation bug at top level. Bug #12274. progmodes/cc-engine.el (c-guess-basic-syntax): Move CASE 5P to just before CASE 5D. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-25 15:48:35 +0000 +++ lisp/ChangeLog 2013-01-25 18:18:14 +0000 @@ -1,3 +1,10 @@ +2013-01-25 Alan Mackenzie + + AWK Mode: Fix indentation bug at top level. Bug #12274. + + * progmodes/cc-engine.el (c-guess-basic-syntax): Move CASE 5P to + just before CASE 5D. + 2013-01-25 Dmitry Antipov * net/socks.el (socks-nslookup-host): Use string-to-number. === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2013-01-23 18:58:11 +0000 +++ lisp/progmodes/cc-engine.el 2013-01-25 18:18:14 +0000 @@ -9842,6 +9842,18 @@ ;; contains any class offset ))) + ;; CASE 5P: AWK pattern or function or continuation + ;; thereof. + ((c-major-mode-is 'awk-mode) + (setq placeholder (point)) + (c-add-stmt-syntax + (if (and (eq (c-beginning-of-statement-1) 'same) + (/= (point) placeholder)) + 'topmost-intro-cont + 'topmost-intro) + nil nil + containing-sexp paren-state)) + ;; CASE 5D: this could be a top-level initialization, a ;; member init list continuation, or a template argument ;; list continuation. @@ -10001,18 +10013,6 @@ (goto-char (point-min))) (c-add-syntax 'objc-method-intro (c-point 'boi))) - ;; CASE 5P: AWK pattern or function or continuation - ;; thereof. - ((c-major-mode-is 'awk-mode) - (setq placeholder (point)) - (c-add-stmt-syntax - (if (and (eq (c-beginning-of-statement-1) 'same) - (/= (point) placeholder)) - 'topmost-intro-cont - 'topmost-intro) - nil nil - containing-sexp paren-state)) - ;; CASE 5N: At a variable declaration that follows a class ;; definition or some other block declaration that doesn't ;; end at the closing '}'. C.f. case 5D.5. ------------------------------------------------------------ revno: 111606 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2013-01-25 21:13:31 +0400 message: * insdel.c (insert_1): Remove. * lisp.h (insert_1): Remove prototype. * xdisp.c (message_dolog): Adjust users to call insert_1_both. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-01-25 14:38:21 +0000 +++ src/ChangeLog 2013-01-25 17:13:31 +0000 @@ -6,6 +6,9 @@ * font.c (num_fonts): Remove the leftover from old debugging code. Adjust comment style here and there. + * insdel.c (insert_1): Remove. + * lisp.h (insert_1): Remove prototype. + * xdisp.c (message_dolog): Adjust users to call insert_1_both. 2013-01-25 Eli Zaretskii === modified file 'src/insdel.c' --- src/insdel.c 2013-01-24 03:34:20 +0000 +++ src/insdel.c 2013-01-25 17:13:31 +0000 @@ -658,17 +658,6 @@ } } -/* Subroutine used by the insert functions above. */ - -void -insert_1 (const char *string, ptrdiff_t nbytes, - bool inherit, bool prepare, bool before_markers) -{ - insert_1_both (string, chars_in_text ((unsigned char *) string, nbytes), - nbytes, inherit, prepare, before_markers); -} - - #ifdef BYTE_COMBINING_DEBUG /* See if the bytes before POS/POS_BYTE combine with bytes === modified file 'src/lisp.h' --- src/lisp.h 2013-01-23 20:07:28 +0000 +++ src/lisp.h 2013-01-25 17:13:31 +0000 @@ -2874,7 +2874,6 @@ ptrdiff_t, ptrdiff_t, ptrdiff_t); extern void insert (const char *, ptrdiff_t); extern void insert_and_inherit (const char *, ptrdiff_t); -extern void insert_1 (const char *, ptrdiff_t, bool, bool, bool); extern void insert_1_both (const char *, ptrdiff_t, ptrdiff_t, bool, bool, bool); extern void insert_from_gap (ptrdiff_t, ptrdiff_t); === modified file 'src/xdisp.c' --- src/xdisp.c 2013-01-24 05:41:28 +0000 +++ src/xdisp.c 2013-01-25 17:13:31 +0000 @@ -9462,13 +9462,14 @@ } } else if (nbytes) - insert_1 (m, nbytes, 1, 0, 0); + insert_1_both (m, chars_in_text (msg, nbytes), nbytes, 1, 0, 0); if (nlflag) { ptrdiff_t this_bol, this_bol_byte, prev_bol, prev_bol_byte; printmax_t dups; - insert_1 ("\n", 1, 1, 0, 0); + + insert_1_both ("\n", 1, 1, 1, 0, 0); scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, 0); this_bol = PT; @@ -9497,7 +9498,7 @@ change message_log_check_duplicate. */ int duplen = sprintf (dupstr, " [%"pMd" times]", dups); TEMP_SET_PT_BOTH (Z - 1, Z_BYTE - 1); - insert_1 (dupstr, duplen, 1, 0, 1); + insert_1_both (dupstr, duplen, duplen, 1, 0, 1); } } } ------------------------------------------------------------ revno: 111605 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2013-01-25 19:48:35 +0400 message: * net/socks.el (socks-nslookup-host): Use string-to-number. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-25 13:15:22 +0000 +++ lisp/ChangeLog 2013-01-25 15:48:35 +0000 @@ -1,3 +1,7 @@ +2013-01-25 Dmitry Antipov + + * net/socks.el (socks-nslookup-host): Use string-to-number. + 2013-01-25 Michael Albinus * autorevert.el (auto-revert-remote-files) === modified file 'lisp/net/socks.el' --- lisp/net/socks.el 2013-01-01 09:11:05 +0000 +++ lisp/net/socks.el 2013-01-25 15:48:35 +0000 @@ -648,7 +648,7 @@ (progn (setq res (buffer-substring (match-beginning 2) (match-end 2)) - res (mapcar 'string-to-int (split-string res "\\."))))) + res (mapcar 'string-to-number (split-string res "\\."))))) (kill-buffer (current-buffer))) res) host)) ------------------------------------------------------------ revno: 111604 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2013-01-25 16:38:21 +0200 message: Revert revision 111602. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-01-25 10:27:16 +0000 +++ src/ChangeLog 2013-01-25 14:38:21 +0000 @@ -1,7 +1,5 @@ 2013-01-25 Eli Zaretskii - * w32.c (readlink): Support DBCS codepages. - * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540) 2013-01-25 Dmitry Antipov === modified file 'src/w32.c' --- src/w32.c 2013-01-25 10:27:16 +0000 +++ src/w32.c 2013-01-25 14:38:21 +0000 @@ -4639,34 +4639,18 @@ else { size_t size_to_copy = buf_size; - BYTE *p = lname, *p2; + BYTE *p = lname; BYTE *pend = p + lname_len; - int dbcs_p = max_filename_mbslen () > 1; /* Normalize like dostounix_filename does, but we don't want to assume that lname is null-terminated. */ - if (dbcs_p) - p2 = CharNextExA (file_name_codepage, p, 0); - else - p2 = p + 1; - if (*p && *p2 == ':' && *p >= 'A' && *p <= 'Z') - { - *p += 'a' - 'A'; - p += 2; - } + if (*p && p[1] == ':' && *p >= 'A' && *p <= 'Z') + *p += 'a' - 'A'; while (p <= pend) { if (*p == '\\') *p = '/'; - if (dbcs_p) - { - p = CharNextExA (file_name_codepage, p, 0); - /* CharNextExA doesn't advance at null character. */ - if (!*p) - break; - } - else - ++p; + ++p; } /* Testing for null-terminated LNAME is paranoia: WideCharToMultiByte should always return a ------------------------------------------------------------ revno: 111603 committer: Michael Albinus + + * autorevert.el (auto-revert-remote-files) + (auto-revert-notify-exclude-dir-regexp): New defcustoms. + (auto-revert-notify-enabled, auto-revert-use-notify) + (auto-revert-notify-watch-descriptor-hash-list) + (auto-revert-notify-modified-p, auto-revert-notify-event-p) + (auto-revert-notify-event-descriptor) + (auto-revert-notify-event-action) + (auto-revert-notify-event-file-name): Doc fix. + (global-auto-revert-mode): Reorder checks. + (auto-revert-notify-rm-watch): Respect changed values of + `auto-revert-notify-watch-descriptor-hash-list'. + (auto-revert-notify-add-watch): Check for + `auto-revert-notify-exclude-dir-regexp'. Adapt filters for + `inotify-add-watch'. Watch `default-directory' instead of + `buffer-file-name'. `auto-revert-notify-watch-descriptor-hash-list' + has a changed meaning now. (Bug#13540) + (auto-revert-notify-handler): Change implementation wrt events + returning from a directory. + (auto-revert-handler): Reorder implementation for checks of remote + files. + (auto-revert-buffers): Fix parentheses error. + 2013-01-25 Fabián Ezequiel Gallina * progmodes/python.el: Enhancements to header documentation about === modified file 'lisp/autorevert.el' --- lisp/autorevert.el 2013-01-17 19:12:40 +0000 +++ lisp/autorevert.el 2013-01-25 13:15:22 +0000 @@ -39,8 +39,11 @@ ;; Auto-Revert Mode applies to all file buffers. (If the user option ;; `global-auto-revert-non-file-buffers' is non-nil, it also applies ;; to some non-file buffers. This option is disabled by default.) -;; Since checking a remote file is too slow, these modes do not check -;; or revert remote files. +;; +;; Since checking a remote file is slow, these modes check or revert +;; remote files only if the user option `auto-revert-remote-files' is +;; non-nil. It is recommended to disable version control for remote +;; files. ;; ;; Both modes operate by checking the time stamp of all files at ;; intervals of `auto-revert-interval'. The default is every five @@ -48,10 +51,12 @@ ;; Emacs. You should never even notice that this package is active ;; (except that your buffers will be reverted, of course). ;; -;; If Emacs is compiled with file watch support, notifications are -;; used instead of checking the time stamp of the files. You can +;; If Emacs is compiled with file notification support, notifications +;; are used instead of checking the time stamp of the files. You can ;; disable this by setting the user option `auto-revert-use-notify' to -;; nil. +;; nil. Alternatively, a regular expression of directories to be +;; excluded from file notifications can be specified by +;; `auto-revert-notify-exclude-dir-regexp'. ;; ;; After reverting a file buffer, Auto Revert Mode normally puts point ;; at the same position that a regular manual revert would. However, @@ -70,7 +75,6 @@ ;; change by growing at the end. It only appends the new output, ;; instead of reverting the entire buffer. It does so even if the ;; buffer contains unsaved changes. (Because they will not be lost.) -;; Auto Revert Tail Mode works also for remote files. ;; Usage: ;; @@ -260,15 +264,21 @@ This variable becomes buffer local when set in any fashion.") (make-variable-buffer-local 'global-auto-revert-ignore-buffer) +(defcustom auto-revert-remote-files nil + "If non-nil remote files are also reverted." + :group 'auto-revert + :type 'boolean + :version "24.4") + (defconst auto-revert-notify-enabled (or (featurep 'inotify) (featurep 'w32notify)) - "Non-nil when Emacs has been compiled with file watch support.") + "Non-nil when Emacs has been compiled with file notification support.") (defcustom auto-revert-use-notify auto-revert-notify-enabled - "If non-nil Auto Revert Mode uses file watch functions. -This requires Emacs being compiled with file watch support (see -`auto-revert-notify-enabled'). You should set this variable -through Custom only." + "If non-nil Auto Revert Mode uses file notification functions. +This requires Emacs being compiled with file notification +support (see `auto-revert-notify-enabled'). You should set this +variable through Custom only." :group 'auto-revert :type 'boolean :set (lambda (variable value) @@ -281,6 +291,17 @@ (auto-revert-notify-rm-watch))))))) :version "24.4") +(defcustom auto-revert-notify-exclude-dir-regexp + (concat + ;; No mounted file systems. + "^" (regexp-opt '("/afs/" "/media/" "/mnt" "/net/" "/tmp_mnt/")) + ;; No remote files. + (unless auto-revert-remote-files "\\|^/[^/|:][^/|]+:")) + "Regular expression of directories to be excluded from file notifications." + :group 'auto-revert + :type 'regexp + :version "24.4") + ;; Internal variables: (defvar auto-revert-buffer-list () @@ -306,7 +327,9 @@ (defvar auto-revert-notify-watch-descriptor-hash-list (make-hash-table :test 'equal) "A hash table collecting all file watch descriptors. -Hash key is a watch descriptor, hash value is the corresponding buffer.") +Hash key is a watch descriptor, hash value is a list of buffers +which are related to files being watched and carrying the same +default directory.") (defvar auto-revert-notify-watch-descriptor nil "The file watch descriptor active for the current buffer.") @@ -315,7 +338,7 @@ (defvar auto-revert-notify-modified-p nil "Non-nil when file has been modified on the file system. -This has been reported by a file watch event.") +This has been reported by a file notification event.") (make-variable-buffer-local 'auto-revert-notify-modified-p) ;; Functions: @@ -444,9 +467,9 @@ (auto-revert-set-timer) (if global-auto-revert-mode (auto-revert-buffers) - (when auto-revert-use-notify - (dolist (buf (buffer-list)) - (with-current-buffer buf + (dolist (buf (buffer-list)) + (with-current-buffer buf + (when auto-revert-use-notify (auto-revert-notify-rm-watch)))))) (defun auto-revert-set-timer () @@ -465,85 +488,106 @@ 'auto-revert-buffers)))) (defun auto-revert-notify-rm-watch () - "Disable file watch for current buffer's associated file." + "Disable file notification for current buffer's associated file." (when auto-revert-notify-watch-descriptor - (ignore-errors - (funcall (if (fboundp 'inotify-rm-watch) - 'inotify-rm-watch 'w32notify-rm-watch) - auto-revert-notify-watch-descriptor)) - (remhash auto-revert-notify-watch-descriptor - auto-revert-notify-watch-descriptor-hash-list) + (maphash + (lambda (key value) + (when (equal key auto-revert-notify-watch-descriptor) + (setq value (delete (current-buffer) value)) + (if value + (puthash key value auto-revert-notify-watch-descriptor-hash-list) + (remhash key auto-revert-notify-watch-descriptor-hash-list) + (ignore-errors + (funcall (if (fboundp 'inotify-rm-watch) + 'inotify-rm-watch 'w32notify-rm-watch) + auto-revert-notify-watch-descriptor))))) + auto-revert-notify-watch-descriptor-hash-list) (remove-hook 'kill-buffer-hook 'auto-revert-notify-rm-watch)) (setq auto-revert-notify-watch-descriptor nil auto-revert-notify-modified-p nil)) (defun auto-revert-notify-add-watch () - "Enable file watch for current buffer's associated file." + "Enable file notification for current buffer's associated file." + (when (string-match auto-revert-notify-exclude-dir-regexp + (expand-file-name default-directory)) + ;; Fallback to file checks. + (set (make-local-variable 'auto-revert-use-notify) nil)) + (when (and buffer-file-name auto-revert-use-notify (not auto-revert-notify-watch-descriptor)) (let ((func (if (fboundp 'inotify-add-watch) 'inotify-add-watch 'w32notify-add-watch)) (aspect (if (fboundp 'inotify-add-watch) - '(modify) '(size last-write-time)))) + '(create modify moved-to) '(size last-write-time)))) (setq auto-revert-notify-watch-descriptor (ignore-errors (funcall - func buffer-file-name aspect 'auto-revert-notify-handler))) + func (directory-file-name (expand-file-name default-directory)) + aspect 'auto-revert-notify-handler))) (if auto-revert-notify-watch-descriptor (progn - (puthash auto-revert-notify-watch-descriptor - (current-buffer) - auto-revert-notify-watch-descriptor-hash-list) + (puthash + auto-revert-notify-watch-descriptor + (cons (current-buffer) + (gethash auto-revert-notify-watch-descriptor + auto-revert-notify-watch-descriptor-hash-list)) + auto-revert-notify-watch-descriptor-hash-list) (add-hook (make-local-variable 'kill-buffer-hook) 'auto-revert-notify-rm-watch)) ;; Fallback to file checks. (set (make-local-variable 'auto-revert-use-notify) nil))))) (defun auto-revert-notify-event-p (event) - "Check that event is a file watch event." + "Check that event is a file notification event." (cond ((featurep 'inotify) (and (listp event) (= (length event) 4))) ((featurep 'w32notify) (and (listp event) (= (length event) 3) (stringp (nth 2 event)))))) (defun auto-revert-notify-event-descriptor (event) - "Return watch descriptor of notification event, or nil." + "Return watch descriptor of file notification event, or nil." (and (auto-revert-notify-event-p event) (car event))) (defun auto-revert-notify-event-action (event) - "Return action of notification event, or nil." + "Return action of file notification event, or nil." (and (auto-revert-notify-event-p event) (nth 1 event))) (defun auto-revert-notify-event-file-name (event) - "Return file name of notification event, or nil." + "Return file name of file notification event, or nil." (and (auto-revert-notify-event-p event) (cond ((featurep 'inotify) (nth 3 event)) ((featurep 'w32notify) (nth 2 event))))) (defun auto-revert-notify-handler (event) - "Handle an event returned from file watch." + "Handle an event returned from file notification." (when (auto-revert-notify-event-p event) (let* ((descriptor (auto-revert-notify-event-descriptor event)) (action (auto-revert-notify-event-action event)) (file (auto-revert-notify-event-file-name event)) - (buffer (gethash descriptor - auto-revert-notify-watch-descriptor-hash-list))) + (buffers (gethash descriptor + auto-revert-notify-watch-descriptor-hash-list))) (ignore-errors ;; Check, that event is meant for us. ;; TODO: Filter events which stop watching, like `move' or `removed'. (cl-assert descriptor) - (when (featurep 'inotify) (cl-assert (memq 'modify action))) + (when (featurep 'inotify) + (cl-assert (or (memq 'create action) + (memq 'modify action) + (memq 'moved-to action)))) (when (featurep 'w32notify) (cl-assert (eq 'modified action))) - (cl-assert (bufferp buffer)) - (with-current-buffer buffer - (when (and (stringp file) (stringp buffer-file-name)) - ;; w32notify returns the basename of the file without its - ;; leading directories; inotify returns its full absolute - ;; file name. - (cl-assert (file-equal-p file buffer-file-name))) - - ;; Mark buffer modified. - (setq auto-revert-notify-modified-p t)))))) + ;; Since we watch a directory, a file name must be returned. + (cl-assert (stringp file)) + (dolist (buffer buffers) + (when (buffer-live-p buffer) + (with-current-buffer buffer + (when (and (stringp buffer-file-name) + (string-equal + (file-name-nondirectory file) + (file-name-nondirectory buffer-file-name))) + ;; Mark buffer modified. + (setq auto-revert-notify-modified-p t) + ;; No need to check other buffers. + (cl-return))))))))) (defun auto-revert-active-p () "Check if auto-revert is active (in current buffer or globally)." @@ -560,23 +604,29 @@ This is an internal function used by Auto-Revert Mode." (when (or auto-revert-tail-mode (not (buffer-modified-p))) (let* ((buffer (current-buffer)) size + ;; Tramp caches the file attributes. Setting + ;; `remote-file-name-inhibit-cache' forces Tramp to reread + ;; the values. + (remote-file-name-inhibit-cache t) (revert (or (and buffer-file-name - (or (not auto-revert-use-notify) - auto-revert-notify-modified-p) + (or auto-revert-remote-files + (not (file-remote-p buffer-file-name))) (if auto-revert-tail-mode - ;; Tramp caches the file attributes. Setting - ;; `remote-file-name-inhibit-cache' forces Tramp - ;; to reread the values. - (let ((remote-file-name-inhibit-cache t)) - (and (file-readable-p buffer-file-name) - (/= auto-revert-tail-pos - (setq size - (nth 7 (file-attributes - buffer-file-name)))))) - (and (not (file-remote-p buffer-file-name)) - (file-readable-p buffer-file-name) - (not (verify-visited-file-modtime buffer))))) + (and (or (not auto-revert-use-notify) + auto-revert-notify-modified-p) + (file-readable-p buffer-file-name) + (/= auto-revert-tail-pos + (setq size + (nth 7 (file-attributes + buffer-file-name))))) + ;; When `auto-revert-use-notify' is set, we do + ;; not apply further checks for performance + ;; reasons. + (if auto-revert-use-notify + auto-revert-notify-modified-p + (and (file-readable-p buffer-file-name) + (not (verify-visited-file-modtime buffer)))))) (and (or auto-revert-mode global-auto-revert-non-file-buffers) revert-buffer-function @@ -692,10 +742,10 @@ (setq auto-revert-buffer-list (delq buf auto-revert-buffer-list))) (when (auto-revert-active-p) - ;; Enable file watches. + ;; Enable file notification. (when (and auto-revert-use-notify buffer-file-name - (not auto-revert-notify-watch-descriptor) - (auto-revert-notify-add-watch))) + (not auto-revert-notify-watch-descriptor)) + (auto-revert-notify-add-watch)) (auto-revert-handler))) ;; Remove dead buffer from `auto-revert-buffer-list'. (setq auto-revert-buffer-list ------------------------------------------------------------ revno: 111602 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2013-01-25 12:27:16 +0200 message: w32.c (readlink): Support DBCS codepages. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-01-25 09:39:47 +0000 +++ src/ChangeLog 2013-01-25 10:27:16 +0000 @@ -1,5 +1,7 @@ 2013-01-25 Eli Zaretskii + * w32.c (readlink): Support DBCS codepages. + * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540) 2013-01-25 Dmitry Antipov === modified file 'src/w32.c' --- src/w32.c 2013-01-25 04:41:39 +0000 +++ src/w32.c 2013-01-25 10:27:16 +0000 @@ -4639,18 +4639,34 @@ else { size_t size_to_copy = buf_size; - BYTE *p = lname; + BYTE *p = lname, *p2; BYTE *pend = p + lname_len; + int dbcs_p = max_filename_mbslen () > 1; /* Normalize like dostounix_filename does, but we don't want to assume that lname is null-terminated. */ - if (*p && p[1] == ':' && *p >= 'A' && *p <= 'Z') - *p += 'a' - 'A'; + if (dbcs_p) + p2 = CharNextExA (file_name_codepage, p, 0); + else + p2 = p + 1; + if (*p && *p2 == ':' && *p >= 'A' && *p <= 'Z') + { + *p += 'a' - 'A'; + p += 2; + } while (p <= pend) { if (*p == '\\') *p = '/'; - ++p; + if (dbcs_p) + { + p = CharNextExA (file_name_codepage, p, 0); + /* CharNextExA doesn't advance at null character. */ + if (!*p) + break; + } + else + ++p; } /* Testing for null-terminated LNAME is paranoia: WideCharToMultiByte should always return a ------------------------------------------------------------ revno: 111601 fixes bug: http://debbugs.gnu.org/13540 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2013-01-25 11:39:47 +0200 message: Update doc string of w32notify-add-watch per discussions in bug #13540. src/w32notify.c (Fw32notify_add_watch): Doc fix. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-01-25 06:31:41 +0000 +++ src/ChangeLog 2013-01-25 09:39:47 +0000 @@ -1,3 +1,7 @@ +2013-01-25 Eli Zaretskii + + * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540) + 2013-01-25 Dmitry Antipov * font.c (num_fonts): Remove the leftover from old === modified file 'src/w32notify.c' --- src/w32notify.c 2013-01-02 16:30:50 +0000 +++ src/w32notify.c 2013-01-25 09:39:47 +0000 @@ -442,8 +442,8 @@ This arranges for filesystem events pertaining to FILE to be reported to Emacs. Use `w32notify-rm-watch' to cancel the watch. -Value is a descriptor for the added watch, or nil if the file -cannot be watched. +Value is a descriptor for the added watch. If the file cannot be +watched for some reason, this function signals a `file-error' error. FILTER is a list of conditions for reporting an event. It can include the following symbols: @@ -476,7 +476,13 @@ 'renamed-from' -- a file was renamed whose old name was FILE 'renamed-to' -- a file was renamed and its new name is FILE -FILE is the name of the file whose event is being reported. */) +FILE is the name of the file whose event is being reported. + +Note that some networked filesystems, such as Samba-mounted Unix +volumes, might not send notifications about file changes. In these +cases, this function will return a valid descriptor, but notifications +will never come in. Volumes shared from remote Windows machines do +generate notifications correctly, though. */) (Lisp_Object file, Lisp_Object filter, Lisp_Object callback) { Lisp_Object encoded_file, watch_object, watch_descriptor; ------------------------------------------------------------ revno: 111600 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2013-01-25 10:31:41 +0400 message: * font.c (num_fonts): Remove the leftover from old debugging code. Adjust comment style here and there. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-01-25 04:41:39 +0000 +++ src/ChangeLog 2013-01-25 06:31:41 +0000 @@ -1,3 +1,8 @@ +2013-01-25 Dmitry Antipov + + * font.c (num_fonts): Remove the leftover from old + debugging code. Adjust comment style here and there. + 2013-01-25 Eli Zaretskii * w32.c (max_filename_mbslen): New function. @@ -36,7 +41,7 @@ (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT properly. Likewise for obscured. * xterm.c: Ditto. - (handle_one_xevent): Save visible state go generate ICONIFY_EVENT + (handle_one_xevent): Save visible state to generate ICONIFY_EVENT properly. * nsterm.m: Ditto. (windowDidDeminiaturize): Generate DEICONIFY_EVENT. === modified file 'src/font.c' --- src/font.c 2013-01-17 06:29:40 +0000 +++ src/font.c 2013-01-25 06:31:41 +0000 @@ -717,7 +717,7 @@ } -/* Font name parser and unparser */ +/* Font name parser and unparser. */ static int parse_matrix (const char *); static int font_expand_wildcards (Lisp_Object *, int); @@ -1746,7 +1746,7 @@ /* This part (through the next ^L) is still experimental and not tested much. We may drastically change codes. */ -/* OTF handler */ +/* OTF handler. */ #if 0 @@ -2035,7 +2035,7 @@ #endif /* 0 */ -/* Font sorting */ +/* Font sorting. */ static unsigned font_score (Lisp_Object, Lisp_Object *); static int font_compare (const void *, const void *); @@ -2565,7 +2565,6 @@ return val; } -static int num_fonts; static void font_clear_cache (FRAME_PTR f, Lisp_Object cache, struct font_driver *driver) @@ -2598,7 +2597,6 @@ { eassert (font && driver == font->driver); driver->close (f, font); - num_fonts--; } } if (driver->free_entity) @@ -2856,7 +2854,6 @@ return Qnil; ASET (entity, FONT_OBJLIST_INDEX, Fcons (font_object, AREF (entity, FONT_OBJLIST_INDEX))); - num_fonts++; font = XFONT_OBJECT (font_object); min_width = (font->min_width ? font->min_width @@ -2901,7 +2898,6 @@ eassert (FRAME_X_DISPLAY_INFO (f)->n_fonts); FRAME_X_DISPLAY_INFO (f)->n_fonts--; #endif - num_fonts--; } @@ -3578,7 +3574,7 @@ Lisp_Object it; int i; - /* Set boolean values to Qt or Qnil */ + /* Set boolean values to Qt or Qnil. */ for (i = 0; boolean_properties[i] != NULL; ++i) for (it = alist; ! NILP (it); it = XCDR (it)) { @@ -3757,7 +3753,7 @@ #endif -/* Lisp API */ +/* Lisp API. */ DEFUN ("fontp", Ffontp, Sfontp, 1, 2, 0, doc: /* Return t if OBJECT is a font-spec, font-entity, or font-object.