commit a1cbf94359cbe0e39ff49e4f639f7dd15d17fbcf (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Tue Sep 15 10:22:35 2015 +0300 Make show-paren-match face visible on mono-color displays * lisp/faces.el (show-paren-match): Use the underline face for mono-color displays. (Bug#21481) diff --git a/lisp/faces.el b/lisp/faces.el index 5485d80..cc8c04d 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -2691,10 +2691,12 @@ It is used for characters of no fonts too." :background "turquoise") ; looks OK on tty (becomes cyan) (((class color) (background dark)) :background "steelblue3") ; looks OK on tty (becomes blue) - (((background dark)) + (((background dark) (min-colors 4)) :background "grey50") + (((background light) (min-colors 4)) + :background "gray") (t - :background "gray")) + :inherit underline)) "Face used for a matching paren." :group 'paren-showing-faces) commit b5a3626f316d2c0f1196a9718e51462c09a14568 Author: Paul Eggert Date: Mon Sep 14 14:09:24 2015 -0700 Don’t double-encode non-ASCII mail clipboard * lisp/mail/mailclient.el (mailclient-send-it): Also fix the case when mailclient-place-body-on-clipboard-flag is non-nil. Problem reported by Eli Zaretskii (Bug#21471#37). diff --git a/lisp/mail/mailclient.el b/lisp/mail/mailclient.el index bef2038..2fb944b 100644 --- a/lisp/mail/mailclient.el +++ b/lisp/mail/mailclient.el @@ -175,37 +175,31 @@ The mail client is taken to be the handler of mailto URLs." (mailclient-encode-string-as-url subj)) "")))) ;; body - (concat - (mailclient-url-delim) "body=" - (mailclient-encode-string-as-url - (if mailclient-place-body-on-clipboard-flag - (progn - (clipboard-kill-ring-save - (+ 1 delimline) (point-max)) - (concat - "*** E-Mail body has been placed on clipboard, " - "please paste it here! ***")) - ;; else - (let ((body (buffer-substring (+ 1 delimline) (point-max)))) - (if (null character-coding) - body - ;; mailto: requires UTF-8 and cannot deal with - ;; Content-Transfer-Encoding or Content-Type. - ;; FIXME: There is a lot of code duplication here - ;; with rmail.el. - (erase-buffer) - (set-buffer-multibyte nil) - (insert body) - (cond - ((string= character-coding "quoted-printable") - (mail-unquote-printable-region (point-min) (point-max) - nil nil 'unibyte)) - ((string= character-coding "base64") - (base64-decode-region (point-min) (point-max))) - (t (error "unsupported Content-Transfer-Encoding: %s" - character-coding))) - (decode-coding-region (point-min) (point-max) - coding-system t))))))))))))) + (mailclient-url-delim) "body=" + (progn + (delete-region (point-min) delimline) + (unless (null character-coding) + ;; mailto: and clipboard need UTF-8 and cannot deal with + ;; Content-Transfer-Encoding or Content-Type. + ;; FIXME: There is code duplication here with rmail.el. + (set-buffer-multibyte nil) + (cond + ((string= character-coding "base64") + (base64-decode-region (point-min) (point-max))) + ((string= character-coding "quoted-printable") + (mail-unquote-printable-region (point-min) (point-max) + nil nil t)) + (t (error "unsupported Content-Transfer-Encoding: %s" + character-coding))) + (decode-coding-region (point-min) (point-max) coding-system)) + (mailclient-encode-string-as-url + (if mailclient-place-body-on-clipboard-flag + (progn + (clipboard-kill-ring-save (point-min) (point-max)) + (concat + "*** E-Mail body has been placed on clipboard, " + "please paste it here! ***")) + (buffer-string))))))))))) (provide 'mailclient) commit 67ddc7c55d6b40e3d37b2773e002a50123ae7411 Author: Michael Albinus Date: Mon Sep 14 22:15:20 2015 +0200 Adaot file-notify-tests.el test cases * lisp/filenotify.el (file-notify-rm-watch): Ignore `file-notify-error'. * src/inotify.c (Finotify_valid_p): Adapt docstring. * test/automated/file-notify-tests.el () (file-notify-test03-autorevert) (file-notify-test04-file-validity) (file-notify-test04-file-validity-remote) (file-notify-test05-dir-validity) (file-notify-test05-dir-validity-remote): Adapt docstring. (file-notify-test04-file-validity): Let events arrive before calling final `file-notify-valid-p'. Do not ignore errors. (file-notify-test05-dir-validity): Do not manipulate `temporary-file-directory', it isn't necessary. Let events arrive before calling final `file-notify-valid-p'. Do not ignore errors. diff --git a/lisp/filenotify.el b/lisp/filenotify.el index 002c5a5..1ec4e13 100644 --- a/lisp/filenotify.el +++ b/lisp/filenotify.el @@ -345,17 +345,19 @@ DESCRIPTOR should be an object returned by `file-notify-add-watch'." ;; Call low-level function. (when (null (cdr registered)) - (if handler - ;; A file name handler could exist even if there is no local - ;; file notification support. - (funcall handler 'file-notify-rm-watch desc) - - (funcall - (cond - ((eq file-notify--library 'gfilenotify) 'gfile-rm-watch) - ((eq file-notify--library 'inotify) 'inotify-rm-watch) - ((eq file-notify--library 'w32notify) 'w32notify-rm-watch)) - desc)))))) + (condition-case nil + (if handler + ;; A file name handler could exist even if there is no local + ;; file notification support. + (funcall handler 'file-notify-rm-watch desc) + + (funcall + (cond + ((eq file-notify--library 'gfilenotify) 'gfile-rm-watch) + ((eq file-notify--library 'inotify) 'inotify-rm-watch) + ((eq file-notify--library 'w32notify) 'w32notify-rm-watch)) + desc)) + (file-notify-error nil)))))) ;; Temporary declarations. (defalias 'gfile-valid-p 'identity) diff --git a/src/inotify.c b/src/inotify.c index b73e873..2486563 100644 --- a/src/inotify.c +++ b/src/inotify.c @@ -323,12 +323,12 @@ is managed internally and there is no corresponding inotify_init. Use watch_descriptor = make_watch_descriptor (watchdesc); - /* Delete existing watch object. */ + /* Delete existing watch object. */ watch_object = Fassoc (watch_descriptor, watch_list); if (!NILP (watch_object)) watch_list = Fdelete (watch_object, watch_list); - /* Store watch object in watch list. */ + /* Store watch object in watch list. */ watch_object = Fcons (watch_descriptor, callback); watch_list = Fcons (watch_object, watch_list); @@ -351,12 +351,12 @@ See inotify_rm_watch(2) for more information. xsignal2 (Qfile_notify_error, build_string ("Could not rm watch"), watch_descriptor); - /* Remove watch descriptor from watch list. */ + /* Remove watch descriptor from watch list. */ watch_object = Fassoc (watch_descriptor, watch_list); if (!NILP (watch_object)) watch_list = Fdelete (watch_object, watch_list); - /* Cleanup if no more files are watched. */ + /* Cleanup if no more files are watched. */ if (NILP (watch_list)) { emacs_close (inotifyfd); @@ -370,7 +370,12 @@ See inotify_rm_watch(2) for more information. DEFUN ("inotify-valid-p", Finotify_valid_p, Sinotify_valid_p, 1, 1, 0, doc: /* "Check a watch specified by its WATCH-DESCRIPTOR. -WATCH-DESCRIPTOR should be an object returned by `inotify-add-watch'. */) +WATCH-DESCRIPTOR should be an object returned by `inotify-add-watch'. + +A watch can become invalid if the file or directory it watches is +deleted, or if the watcher thread exits abnormally for any other +reason. Removing the watch by calling `inotify-rm-watch' also makes +it invalid. */) (Lisp_Object watch_descriptor) { Lisp_Object watch_object = Fassoc (watch_descriptor, watch_list); diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el index caf9316..3e92925 100644 --- a/test/automated/file-notify-tests.el +++ b/test/automated/file-notify-tests.el @@ -321,8 +321,7 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered." auto-revert-stop-on-user-input nil) (ert-deftest file-notify-test03-autorevert () - "Check autorevert via file notification. -This test is skipped in batch mode." + "Check autorevert via file notification." (skip-unless (file-notify--test-local-enabled)) ;; `auto-revert-buffers' runs every 5". And we must wait, until the ;; file has been reverted. @@ -373,11 +372,10 @@ This test is skipped in batch mode." (file-notify--test-cleanup)))) (file-notify--deftest-remote file-notify-test03-autorevert - "Check autorevert via file notification for remote files. -This test is skipped in batch mode.") + "Check autorevert via file notification for remote files.") (ert-deftest file-notify-test04-file-validity () - "Check `file-notify-valid-p'." + "Check `file-notify-valid-p' for files." (skip-unless (file-notify--test-local-enabled)) (unwind-protect (let ((temporary-file-directory (make-temp-file @@ -387,7 +385,6 @@ This test is skipped in batch mode.") file-notify--test-tmpfile '(change) #'file-notify--test-event-handler)) - (file-notify--test-with-events 3 3 (lambda (events) (should (equal '(created changed deleted) @@ -396,25 +393,22 @@ This test is skipped in batch mode.") (write-region "any text" nil file-notify--test-tmpfile nil 'no-message) (should (file-notify-valid-p file-notify--test-desc)) - (delete-directory temporary-file-directory t) - ;; After deleting the parent, the descriptor must not be - ;; valid anymore. - (should (not (file-notify-valid-p file-notify--test-desc))))) + (delete-directory temporary-file-directory t)) + ;; After deleting the parent, the descriptor must not be valid + ;; anymore. + (should-not (file-notify-valid-p file-notify--test-desc))) ;; Exit. - (ignore-errors - (file-notify--test-cleanup)))) + (file-notify--test-cleanup))) (file-notify--deftest-remote file-notify-test04-file-validity - "Check `file-notify-valid-p' via file notification for remote -files.") + "Check `file-notify-valid-p' via file notification for remote files.") (ert-deftest file-notify-test05-dir-validity () "Check `file-notify-valid-p' for directories." (skip-unless (file-notify--test-local-enabled)) (unwind-protect - (let ((temporary-file-directory (make-temp-file - "file-notify-test-parent" t))) + (progn (setq file-notify--test-tmpfile (file-name-as-directory (file-notify--test-make-temp-name))) (make-directory file-notify--test-tmpfile) @@ -422,20 +416,18 @@ files.") file-notify--test-tmpfile '(change) #'file-notify--test-event-handler)) - (should (file-notify-valid-p file-notify--test-desc)) - (delete-directory temporary-file-directory t) - ;; After deleting the parent, the descriptor must not be + (delete-directory file-notify--test-tmpfile t) + ;; After deleting the directory, the descriptor must not be ;; valid anymore. - (should (not (file-notify-valid-p file-notify--test-desc)))) + (read-event nil nil 0.1) + (should-not (file-notify-valid-p file-notify--test-desc))) ;; Exit. - (ignore-errors - (file-notify--test-cleanup)))) + (file-notify--test-cleanup))) (file-notify--deftest-remote file-notify-test05-dir-validity - "Check `file-notify-valid-p' via file notification for remote -directories.") + "Check `file-notify-valid-p' via file notification for remote directories.") (defun file-notify-test-all (&optional interactive) "Run all tests for \\[file-notify]." commit 1ee47d477ddb9c567eaf63154f78fad5d5826b78 Author: Paul Eggert Date: Mon Sep 14 09:31:23 2015 -0700 Don’t double-encode non-ASCII for mail client * lisp/mail/mailclient.el (mailclient-encode-string-as-url): Use RFC 6068’s list of unreserved characters. (mailclient-send-it): When encoding the body as a URL, first decode it as per Content-Type: and Content-Transfer-Encoding:, as URLs must use percent-encoded UTF-8 (Bug#21471). * doc/misc/url.texi (mailto): Update RFC number. diff --git a/doc/misc/url.texi b/doc/misc/url.texi index d94b19f..95fe5ea 100644 --- a/doc/misc/url.texi +++ b/doc/misc/url.texi @@ -593,7 +593,7 @@ sending a message to @samp{foo@@bar.com}. The ``retrieval method'' for such URLs is to open a mail composition buffer in which the appropriate content (e.g., the recipient address) has been filled in. - As defined in RFC 2368, a @code{mailto} URL has the form + As defined in RFC 6068, a @code{mailto} URL can have the form @example @samp{mailto:@var{mailbox}[?@var{header}=@var{contents}[&@var{header}=@var{contents}]]} diff --git a/lisp/mail/mailclient.el b/lisp/mail/mailclient.el index 31da6ee..bef2038 100644 --- a/lisp/mail/mailclient.el +++ b/lisp/mail/mailclient.el @@ -62,10 +62,9 @@ supported. Defaults to non-nil on Windows, nil otherwise." (mapcar (lambda (char) (cond - ((eq char ?\x20) "%20") ;; space ((eq char ?\n) "%0D%0A") ;; newline - ((string-match "[-a-zA-Z0-9_:/.@]" (char-to-string char)) - (char-to-string char)) ;; printable + ((string-match "[-a-zA-Z0-9._~]" (char-to-string char)) + (char-to-string char)) ;; unreserved as per RFC 6068 (t ;; everything else (format "%%%02x" char)))) ;; escape ;; Convert string to list of chars @@ -125,6 +124,13 @@ The mail client is taken to be the handler of mailto URLs." (< (point) delimline)) (replace-match "\n")) (let ((case-fold-search t) + (mime-charset-pattern + (concat + "^content-type:[ \t]*text/plain;" + "\\(?:[ \t\n]*\\(?:format\\|delsp\\)=\"?[-a-z0-9]+\"?;\\)*" + "[ \t\n]*charset=\"?\\([^ \t\n\";]+\\)\"?")) + coding-system + character-coding ;; Use the external browser function to send the ;; message. (browse-url-mailto-function nil)) @@ -135,6 +141,15 @@ The mail client is taken to be the handler of mailto URLs." (concat (save-excursion (narrow-to-region (point-min) delimline) + (goto-char (point-min)) + (setq coding-system + (if (re-search-forward mime-charset-pattern nil t) + (coding-system-from-name (match-string 1)) + 'undecided)) + (setq character-coding + (mail-fetch-field "content-transfer-encoding")) + (when character-coding + (setq character-coding (downcase character-coding))) (concat "mailto:" ;; some of the headers according to RFC822 @@ -171,7 +186,26 @@ The mail client is taken to be the handler of mailto URLs." "*** E-Mail body has been placed on clipboard, " "please paste it here! ***")) ;; else - (buffer-substring (+ 1 delimline) (point-max)))))))))))) + (let ((body (buffer-substring (+ 1 delimline) (point-max)))) + (if (null character-coding) + body + ;; mailto: requires UTF-8 and cannot deal with + ;; Content-Transfer-Encoding or Content-Type. + ;; FIXME: There is a lot of code duplication here + ;; with rmail.el. + (erase-buffer) + (set-buffer-multibyte nil) + (insert body) + (cond + ((string= character-coding "quoted-printable") + (mail-unquote-printable-region (point-min) (point-max) + nil nil 'unibyte)) + ((string= character-coding "base64") + (base64-decode-region (point-min) (point-max))) + (t (error "unsupported Content-Transfer-Encoding: %s" + character-coding))) + (decode-coding-region (point-min) (point-max) + coding-system t))))))))))))) (provide 'mailclient) commit 560022a5b670422c133381824a8b79dca72402a5 Author: Stefan Monnier Date: Mon Sep 14 09:26:54 2015 -0400 * lisp/progmodes/cc-langs.el (c-make-init-lang-vars-fun): Use dolist diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index e9c4964..dcd5116 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -3304,10 +3304,9 @@ accomplish that conveniently." (setq source-eval t) (let ((init ',(append (cdr c-emacs-variable-inits) (cdr c-lang-variable-inits)))) - (while init - (setq current-var (caar init)) - (set (caar init) (eval (cadr (car init)))) - (setq init (cdr init))))) + (dolist (var-init init) + (setq current-var (car var-init)) + (set (car var-init) (eval (cadr var-init)))))) (error (if current-var @@ -3333,10 +3332,9 @@ accomplish that conveniently." (c-make-emacs-variables-local) (condition-case err - (while init - (setq current-var (caar init)) - (set (caar init) (eval (cadr (car init)))) - (setq init (cdr init))) + (dolist (var-init init) + (setq current-var (car var-init)) + (set (car var-init) (eval (cadr var-init)))) (error (if current-var commit 498d7fe980250b07a25bcb0a588337484d497100 Author: Alan Mackenzie Date: Mon Sep 14 12:44:09 2015 +0000 Replace `cadar' with `cadr/car', since `cadar' is problematic on Emacs. (c-make-init-lang-vars-fun): Replace two occurrences of `cadar' with `cadr/car'. diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index a1e26b9..e9c4964 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -3306,7 +3306,7 @@ accomplish that conveniently." (cdr c-lang-variable-inits)))) (while init (setq current-var (caar init)) - (set (caar init) (eval (cadar init))) + (set (caar init) (eval (cadr (car init)))) (setq init (cdr init))))) (error @@ -3335,7 +3335,7 @@ accomplish that conveniently." (while init (setq current-var (caar init)) - (set (caar init) (eval (cadar init))) + (set (caar init) (eval (cadr (car init)))) (setq init (cdr init))) (error commit 48f3aa93ae682a17e0dbc1d5ca6fa2fb26821bb9 Author: Eli Zaretskii Date: Mon Sep 14 13:04:12 2015 +0300 Clarify documentation of char-table extra slots * doc/lispref/sequences.texi (Char-Tables): Clarify that extra slot numbers are zero-based. (Bug#21467) diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index d019045..18120da 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi @@ -1276,13 +1276,13 @@ This function sets the parent of @var{char-table} to @var{new-parent}. @end defun @defun char-table-extra-slot char-table n -This function returns the contents of extra slot @var{n} of -@var{char-table}. The number of extra slots in a char-table is +This function returns the contents of extra slot @var{n} (zero based) +of @var{char-table}. The number of extra slots in a char-table is determined by its subtype. @end defun @defun set-char-table-extra-slot char-table n value -This function stores @var{value} in extra slot @var{n} of +This function stores @var{value} in extra slot @var{n} (zero based) of @var{char-table}. @end defun commit e348a668cec6b49030aef5a1c48abd64a373645e Author: Alan Mackenzie Date: Sat Sep 12 08:54:44 2015 +0000 Elisp mode: Make font-lock and imenu handle escaped characters in symbols Fixes debbugs#21449. lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression) (lisp--el-match-keyword, lisp-el-font-lock-keywords-1) (lisp-cl-font-lock-keywords-1, lisp-el-font-lock-keywords-2) (lisp-cl-font-lock-keywords-2, lisp-string-in-doc-position-p): Insert "\\|\\\\." into regexps which match symbols. diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 8aa34c7..7be7cb3 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -110,7 +110,7 @@ ;; CLOS and EIEIO "defgeneric" "defmethod") t)) - "\\s-+\\(\\(\\sw\\|\\s_\\)+\\)")) + "\\s-+\\(\\(\\sw\\|\\s_\\|\\\\.\\)+\\)")) 2) (list (purecopy "Variables") (purecopy (concat "^\\s-*(" @@ -122,11 +122,11 @@ "defconstant" "defparameter" "define-symbol-macro") t)) - "\\s-+\\(\\(\\sw\\|\\s_\\)+\\)")) + "\\s-+\\(\\(\\sw\\|\\s_\\|\\\\.\\)+\\)")) 2) ;; For `defvar', we ignore (defvar FOO) constructs. (list (purecopy "Variables") - (purecopy (concat "^\\s-*(defvar\\s-+\\(\\(\\sw\\|\\s_\\)+\\)" + (purecopy (concat "^\\s-*(defvar\\s-+\\(\\(\\sw\\|\\s_\\|\\\\.\\)+\\)" "[[:space:]\n]+[^)]")) 1) (list (purecopy "Types") @@ -143,7 +143,7 @@ ;; CLOS and EIEIO "defclass") t)) - "\\s-+'?\\(\\(\\sw\\|\\s_\\)+\\)")) + "\\s-+'?\\(\\(\\sw\\|\\s_\\|\\\\.\\)+\\)")) 2)) "Imenu generic expression for Lisp mode. See `imenu-generic-expression'.") @@ -220,7 +220,7 @@ (defun lisp--el-match-keyword (limit) ;; FIXME: Move to elisp-mode.el. (catch 'found - (while (re-search-forward "(\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>" limit t) + (while (re-search-forward "(\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)\\_>" limit t) (let ((sym (intern-soft (match-string 1)))) (when (or (special-form-p sym) (and (macrop sym) @@ -349,7 +349,7 @@ ;; Any whitespace and defined object. "[ \t']*" "\\(([ \t']*\\)?" ;; An opening paren. - "\\(\\(setf\\)[ \t]+\\(?:\\sw\\|\\s_\\)+\\|\\(?:\\sw\\|\\s_\\)+\\)?") + "\\(\\(setf\\)[ \t]+\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\|\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)?") (1 font-lock-keyword-face) (3 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type))) (cond ((eq type 'var) font-lock-variable-name-face) @@ -373,7 +373,7 @@ ;; Any whitespace and defined object. "[ \t']*" "\\(([ \t']*\\)?" ;; An opening paren. - "\\(\\(setf\\)[ \t]+\\(?:\\sw\\|\\s_\\)+\\|\\(?:\\sw\\|\\s_\\)+\\)?") + "\\(\\(setf\\)[ \t]+\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\|\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)?") (1 font-lock-keyword-face) (3 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type))) (cond ((eq type 'var) font-lock-variable-name-face) @@ -395,22 +395,22 @@ (lisp--el-match-keyword . 1) ;; Exit/Feature symbols as constants. (,(concat "(\\(catch\\|throw\\|featurep\\|provide\\|require\\)\\_>" - "[ \t']*\\(\\(?:\\sw\\|\\s_\\)+\\)?") + "[ \t']*\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)?") (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) ;; Erroneous structures. (,(concat "(" el-errs-re "\\_>") (1 font-lock-warning-face)) ;; Words inside \\[] tend to be for `substitute-command-keys'. - ("\\\\\\\\\\[\\(\\(?:\\sw\\|\\s_\\)+\\)\\]" + ("\\\\\\\\\\[\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)\\]" (1 font-lock-constant-face prepend)) ;; Words inside ‘’ and '' and `' tend to be symbol names. - ("['`‘]\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)['’]" + ("['`‘]\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)['’]" (1 font-lock-constant-face prepend)) ;; Constant values. - ("\\_<:\\(?:\\sw\\|\\s_\\)+\\_>" 0 font-lock-builtin-face) + ("\\_<:\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\_>" 0 font-lock-builtin-face) ;; ELisp and CLisp `&' keywords as types. - ("\\_<\\&\\(?:\\sw\\|\\s_\\)+\\_>" . font-lock-type-face) + ("\\_<\\&\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\_>" . font-lock-type-face) ;; ELisp regexp grouping constructs (,(lambda (bound) (catch 'found @@ -447,19 +447,19 @@ (,(concat "(" cl-kws-re "\\_>") . 1) ;; Exit/Feature symbols as constants. (,(concat "(\\(catch\\|throw\\|provide\\|require\\)\\_>" - "[ \t']*\\(\\(?:\\sw\\|\\s_\\)+\\)?") + "[ \t']*\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)?") (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) ;; Erroneous structures. (,(concat "(" cl-errs-re "\\_>") (1 font-lock-warning-face)) ;; Words inside ‘’ and '' and `' tend to be symbol names. - ("['`‘]\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)['’]" + ("['`‘]\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)['’]" (1 font-lock-constant-face prepend)) ;; Constant values. - ("\\_<:\\(?:\\sw\\|\\s_\\)+\\_>" 0 font-lock-builtin-face) + ("\\_<:\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\_>" 0 font-lock-builtin-face) ;; ELisp and CLisp `&' keywords as types. - ("\\_<\\&\\(?:\\sw\\|\\s_\\)+\\_>" . font-lock-type-face) + ("\\_<\\&\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\_>" . font-lock-type-face) ;; This is too general -- rms. ;; A user complained that he has functions whose names start with `do' ;; and that they get the wrong color. @@ -482,7 +482,7 @@ (let* ((firstsym (and listbeg (save-excursion (goto-char listbeg) - (and (looking-at "([ \t\n]*\\(\\(\\sw\\|\\s_\\)+\\)") + (and (looking-at "([ \t\n]*\\(\\(\\sw\\|\\s_\\|\\\\.\\)+\\)") (match-string 1))))) (docelt (and firstsym (function-get (intern-soft firstsym) commit c387f5082380eb8242299d2864600d35ae5d0e8a Author: Eli Zaretskii Date: Mon Sep 14 12:41:51 2015 +0300 Improve the doc string of w32notify-valid-p * src/w32notify.c (Fw32notify_valid_p): Mention in the doc string that removing a watch makes its object invalid. diff --git a/src/w32notify.c b/src/w32notify.c index efd9e56..a6b5c19 100644 --- a/src/w32notify.c +++ b/src/w32notify.c @@ -649,7 +649,8 @@ DEFUN ("w32notify-valid-p", Fw32notify_valid_p, Sw32notify_valid_p, 1, 1, 0, WATCH-DESCRIPTOR should be an object returned by `w32notify-add-watch'. A watch can become invalid if the directory it watches is deleted, or if -the watcher thread exits abnormally for any other reason. */) +the watcher thread exits abnormally for any other reason. Removing the +watch by calling `w32notify-rm-watch' also makes it invalid. */) (Lisp_Object watch_descriptor) { Lisp_Object watch_object = Fassoc (watch_descriptor, watch_list); commit f60fca1aa3256def9192021f95711cde6f65749e Author: Tassilo Horn Date: Mon Sep 14 09:52:31 2015 +0200 Fix tests for file-notify-valid-p. diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el index 3ade998..caf9316 100644 --- a/test/automated/file-notify-tests.el +++ b/test/automated/file-notify-tests.el @@ -68,10 +68,14 @@ (when (and file-notify--test-tmpfile (file-exists-p file-notify--test-tmpfile)) - (delete-file file-notify--test-tmpfile)) + (if (directory-name-p file-notify--test-tmpfile) + (delete-directory file-notify--test-tmpfile) + (delete-file file-notify--test-tmpfile))) (when (and file-notify--test-tmpfile1 (file-exists-p file-notify--test-tmpfile1)) - (delete-file file-notify--test-tmpfile1)) + (if (directory-name-p file-notify--test-tmpfile1) + (delete-directory file-notify--test-tmpfile1) + (delete-file file-notify--test-tmpfile1))) (setq file-notify--test-tmpfile nil) (setq file-notify--test-tmpfile1 nil) @@ -376,7 +380,8 @@ This test is skipped in batch mode.") "Check `file-notify-valid-p'." (skip-unless (file-notify--test-local-enabled)) (unwind-protect - (progn + (let ((temporary-file-directory (make-temp-file + "file-notify-test-parent" t))) (setq file-notify--test-tmpfile (file-notify--test-make-temp-name)) (setq file-notify--test-desc (file-notify-add-watch file-notify--test-tmpfile @@ -391,13 +396,14 @@ This test is skipped in batch mode.") (write-region "any text" nil file-notify--test-tmpfile nil 'no-message) (should (file-notify-valid-p file-notify--test-desc)) - (delete-file file-notify--test-tmpfile) - ;; TODO: Even after deletion, the descriptor stays valid. - ;; Is that intended? - (should (file-notify-valid-p file-notify--test-desc)))) + (delete-directory temporary-file-directory t) + ;; After deleting the parent, the descriptor must not be + ;; valid anymore. + (should (not (file-notify-valid-p file-notify--test-desc))))) ;; Exit. - (file-notify--test-cleanup))) + (ignore-errors + (file-notify--test-cleanup)))) (file-notify--deftest-remote file-notify-test04-file-validity "Check `file-notify-valid-p' via file notification for remote @@ -407,25 +413,25 @@ files.") "Check `file-notify-valid-p' for directories." (skip-unless (file-notify--test-local-enabled)) (unwind-protect - (progn - (setq dir (file-name-as-directory - (file-notify--test-make-temp-name))) - (make-directory dir) + (let ((temporary-file-directory (make-temp-file + "file-notify-test-parent" t))) + (setq file-notify--test-tmpfile (file-name-as-directory + (file-notify--test-make-temp-name))) + (make-directory file-notify--test-tmpfile) (setq file-notify--test-desc (file-notify-add-watch - dir + file-notify--test-tmpfile '(change) #'file-notify--test-event-handler)) (should (file-notify-valid-p file-notify--test-desc)) - (delete-directory dir) - ;; TODO: Even after deletion, the descriptor stays valid. Is - ;; that intended? - (should (file-notify-valid-p file-notify--test-desc))) + (delete-directory temporary-file-directory t) + ;; After deleting the parent, the descriptor must not be + ;; valid anymore. + (should (not (file-notify-valid-p file-notify--test-desc)))) - ;; FIXME: This signals an exception which indicates that - ;; file-notify--test-desc shouldn't really be valid anymore. + ;; Exit. (ignore-errors - (file-notify-rm-watch file-notify--test-desc)))) + (file-notify--test-cleanup)))) (file-notify--deftest-remote file-notify-test05-dir-validity "Check `file-notify-valid-p' via file notification for remote commit ef5b1a22bbeef239981dd6745abb4f08e2de54e0 Author: Eli Zaretskii Date: Mon Sep 14 10:31:17 2015 +0300 Report file-notify-error in w32notify.c * src/w32notify.c (report_w32notify_error): New function. (Fw32notify_add_watch, Fw32notify_rm_watch): Use it to report errors, instead of calling report_file_error. (Bug#21432) diff --git a/src/w32notify.c b/src/w32notify.c index fa4ad01..efd9e56 100644 --- a/src/w32notify.c +++ b/src/w32notify.c @@ -464,6 +464,21 @@ filter_list_to_flags (Lisp_Object filter_list) return flags; } +/* Like report_file_error, but reports a file-notify-error instead. */ +static void +report_w32notify_error (const char *string, Lisp_Object name) +{ + Lisp_Object data = CONSP (name) || NILP (name) ? name : list1 (name); + synchronize_system_messages_locale (); + char *str = strerror (errno); + Lisp_Object errstring + = code_convert_string_norecord (build_unibyte_string (str), + Vlocale_coding_system, 0); + Lisp_Object errdata = Fcons (errstring, data); + + xsignal (Qfile_notify_error, Fcons (build_string (string), errdata)); +} + DEFUN ("w32notify-add-watch", Fw32notify_add_watch, Sw32notify_add_watch, 3, 3, 0, doc: /* Add a watch for filesystem events pertaining to FILE. @@ -528,8 +543,8 @@ generate notifications correctly, though. */) || (w32_major_version == 5 && w32_major_version < 1)) { errno = ENOSYS; - report_file_error ("Watching filesystem events is not supported", - Qnil); + report_w32notify_error ("Watching filesystem events is not supported", + Qnil); } /* filenotify.el always passes us a directory, either the parent @@ -573,11 +588,11 @@ generate notifications correctly, though. */) Vlocale_coding_system, 0); else lisp_errstr = build_string (errstr); - report_file_error ("Cannot watch file", - Fcons (lisp_errstr, Fcons (file, Qnil))); + report_w32notify_error ("Cannot watch file", + Fcons (lisp_errstr, Fcons (file, Qnil))); } else - report_file_error ("Cannot watch file", Fcons (file, Qnil)); + report_w32notify_error ("Cannot watch file", Fcons (file, Qnil)); } /* Store watch object in watch list. */ watch_descriptor = make_pointer_integer (dirwatch); @@ -611,8 +626,8 @@ WATCH-DESCRIPTOR should be an object returned by `w32notify-add-watch'. */) } if (status == -1) - report_file_error ("Invalid watch descriptor", Fcons (watch_descriptor, - Qnil)); + report_w32notify_error ("Invalid watch descriptor", Fcons (watch_descriptor, + Qnil)); return Qnil; } commit 12629d2857ba2a7c8a6b6a6b61f28a179d2c92a7 Author: Eli Zaretskii Date: Mon Sep 14 10:02:04 2015 +0300 Implement w32notify-valid-p * src/w32notify.c (Fw32notify_valid_p): New function. (Bug#21432) * lisp/filenotify.el (w32notify-valid-p): No longer an alias for 'identity'. diff --git a/lisp/filenotify.el b/lisp/filenotify.el index 9a48c5e..002c5a5 100644 --- a/lisp/filenotify.el +++ b/lisp/filenotify.el @@ -359,7 +359,6 @@ DESCRIPTOR should be an object returned by `file-notify-add-watch'." ;; Temporary declarations. (defalias 'gfile-valid-p 'identity) -(defalias 'w32notify-valid-p 'identity) (defun file-notify-valid-p (descriptor) "Check a watch specified by its DESCRIPTOR. diff --git a/src/w32notify.c b/src/w32notify.c index ab6cd12..fa4ad01 100644 --- a/src/w32notify.c +++ b/src/w32notify.c @@ -628,6 +628,29 @@ w32_get_watch_object (void *desc) return NILP (watch_list) ? Qnil : assoc_no_quit (descriptor, watch_list); } +DEFUN ("w32notify-valid-p", Fw32notify_valid_p, Sw32notify_valid_p, 1, 1, 0, + doc: /* "Check a watch specified by its WATCH-DESCRIPTOR for validity. + +WATCH-DESCRIPTOR should be an object returned by `w32notify-add-watch'. + +A watch can become invalid if the directory it watches is deleted, or if +the watcher thread exits abnormally for any other reason. */) + (Lisp_Object watch_descriptor) +{ + Lisp_Object watch_object = Fassoc (watch_descriptor, watch_list); + + if (!NILP (watch_object)) + { + struct notification *dirwatch = + (struct notification *)XINTPTR (watch_descriptor); + if (w32_valid_pointer_p (dirwatch, sizeof(struct notification)) + && dirwatch->dir != NULL) + return Qt; + } + + return Qnil; +} + void globals_of_w32notify (void) { @@ -648,6 +671,7 @@ syms_of_w32notify (void) defsubr (&Sw32notify_add_watch); defsubr (&Sw32notify_rm_watch); + defsubr (&Sw32notify_valid_p); staticpro (&watch_list); commit 7a3f3183cd8faff8901ead547711e1c90ea02efe Author: Tassilo Horn Date: Mon Sep 14 08:03:11 2015 +0200 Test file-notify-valid-p. * test/automated/file-notify-tests.el (file-notify-test04-file-validity, file-notify-test05-dir-validity): New tests. diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el index 18e1b93..3ade998 100644 --- a/test/automated/file-notify-tests.el +++ b/test/automated/file-notify-tests.el @@ -372,6 +372,65 @@ This test is skipped in batch mode." "Check autorevert via file notification for remote files. This test is skipped in batch mode.") +(ert-deftest file-notify-test04-file-validity () + "Check `file-notify-valid-p'." + (skip-unless (file-notify--test-local-enabled)) + (unwind-protect + (progn + (setq file-notify--test-tmpfile (file-notify--test-make-temp-name)) + (setq file-notify--test-desc (file-notify-add-watch + file-notify--test-tmpfile + '(change) + #'file-notify--test-event-handler)) + + (file-notify--test-with-events + 3 3 (lambda (events) + (should (equal '(created changed deleted) + (mapcar #'cadr events)))) + (should (file-notify-valid-p file-notify--test-desc)) + (write-region + "any text" nil file-notify--test-tmpfile nil 'no-message) + (should (file-notify-valid-p file-notify--test-desc)) + (delete-file file-notify--test-tmpfile) + ;; TODO: Even after deletion, the descriptor stays valid. + ;; Is that intended? + (should (file-notify-valid-p file-notify--test-desc)))) + + ;; Exit. + (file-notify--test-cleanup))) + +(file-notify--deftest-remote file-notify-test04-file-validity + "Check `file-notify-valid-p' via file notification for remote +files.") + +(ert-deftest file-notify-test05-dir-validity () + "Check `file-notify-valid-p' for directories." + (skip-unless (file-notify--test-local-enabled)) + (unwind-protect + (progn + (setq dir (file-name-as-directory + (file-notify--test-make-temp-name))) + (make-directory dir) + (setq file-notify--test-desc (file-notify-add-watch + dir + '(change) + #'file-notify--test-event-handler)) + + (should (file-notify-valid-p file-notify--test-desc)) + (delete-directory dir) + ;; TODO: Even after deletion, the descriptor stays valid. Is + ;; that intended? + (should (file-notify-valid-p file-notify--test-desc))) + + ;; FIXME: This signals an exception which indicates that + ;; file-notify--test-desc shouldn't really be valid anymore. + (ignore-errors + (file-notify-rm-watch file-notify--test-desc)))) + +(file-notify--deftest-remote file-notify-test05-dir-validity + "Check `file-notify-valid-p' via file notification for remote +directories.") + (defun file-notify-test-all (&optional interactive) "Run all tests for \\[file-notify]." (interactive "p") commit fac7dda3a3b524082190e7469c01b27cb2a6379d Author: Eli Zaretskii Date: Sun Sep 13 22:56:38 2015 +0300 Fix markup in ELisp manual * doc/lispref/frames.texi (Font and Color Parameters): Fix markup of the 'alpha' parameter value. (Bug#21470) diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 23590af..1fcc7fd 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -1666,8 +1666,8 @@ variable, Emacs uses the latter. By default, @code{frame-alpha-lower-limit} is 20. The @code{alpha} frame parameter can also be a cons cell -@code{(@samp{active} . @samp{inactive})}, where @samp{active} is the -opacity of the frame when it is selected, and @samp{inactive} is the +@code{(@var{active} . @var{inactive})}, where @var{active} is the +opacity of the frame when it is selected, and @var{inactive} is the opacity when it is not selected. @end table commit f6f92e87692c22840deee068408a418d6e04b7e3 Author: Michael Albinus Date: Sun Sep 13 21:16:40 2015 +0200 Introduce `file-notify-valid-p' * lisp/filenotify.el (file-notify-valid-p): New defun. (gfile-valid-p, w32notify-valid-p): Make them an alias to `identity'. * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist) * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) * lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist) * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist) : Add handler. * lisp/net/tramp.el (tramp-file-name-for-operation): Add `file-notify-valid-p'. (tramp-handle-file-notify-valid-p): New defun. * src/inotify.c (Finotify_valid_p): New defun. (syms_of_inotify): Declare Sinotify_valid_p. diff --git a/lisp/filenotify.el b/lisp/filenotify.el index 89fc373..9a48c5e 100644 --- a/lisp/filenotify.el +++ b/lisp/filenotify.el @@ -357,6 +357,38 @@ DESCRIPTOR should be an object returned by `file-notify-add-watch'." ((eq file-notify--library 'w32notify) 'w32notify-rm-watch)) desc)))))) +;; Temporary declarations. +(defalias 'gfile-valid-p 'identity) +(defalias 'w32notify-valid-p 'identity) + +(defun file-notify-valid-p (descriptor) + "Check a watch specified by its DESCRIPTOR. +DESCRIPTOR should be an object returned by `file-notify-add-watch'." + (let* ((desc (if (consp descriptor) (car descriptor) descriptor)) + (file (if (consp descriptor) (cdr descriptor))) + (registered (gethash desc file-notify-descriptors)) + (dir (car registered)) + handler) + + (when (stringp dir) + (setq handler (find-file-name-handler dir 'file-notify-valid-p)) + + (and (or ;; It is a directory. + (not file) + ;; The file is registered. + (assoc file (cdr registered))) + (if handler + ;; A file name handler could exist even if there is no + ;; local file notification support. + (funcall handler 'file-notify-valid-p descriptor) + (funcall + (cond + ((eq file-notify--library 'gfilenotify) 'gfile-valid-p) + ((eq file-notify--library 'inotify) 'inotify-valid-p) + ((eq file-notify--library 'w32notify) 'w32notify-valid-p)) + desc)) + t)))) + ;; The end: (provide 'filenotify) diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index f818fcd..2a7f1a5 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -132,6 +132,7 @@ It is used for TCP/IP devices." (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) (file-notify-add-watch . tramp-handle-file-notify-add-watch) (file-notify-rm-watch . tramp-handle-file-notify-rm-watch) + (file-notify-valid-p . tramp-handle-file-notify-valid-p) (file-ownership-preserved-p . ignore) (file-readable-p . tramp-handle-file-exists-p) (file-regular-p . tramp-handle-file-regular-p) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 4dfdcd7..cf42b59 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -443,6 +443,7 @@ Every entry is a list (NAME ADDRESS).") (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) (file-notify-add-watch . tramp-gvfs-handle-file-notify-add-watch) (file-notify-rm-watch . tramp-handle-file-notify-rm-watch) + (file-notify-valid-p . tramp-handle-file-notify-valid-p) (file-ownership-preserved-p . ignore) (file-readable-p . tramp-gvfs-handle-file-readable-p) (file-regular-p . tramp-handle-file-regular-p) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index d9490a0..8598f0e 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1008,6 +1008,7 @@ of command line.") (file-newer-than-file-p . tramp-sh-handle-file-newer-than-file-p) (file-notify-add-watch . tramp-sh-handle-file-notify-add-watch) (file-notify-rm-watch . tramp-handle-file-notify-rm-watch) + (file-notify-valid-p . tramp-handle-file-notify-valid-p) (file-ownership-preserved-p . tramp-sh-handle-file-ownership-preserved-p) (file-readable-p . tramp-sh-handle-file-readable-p) (file-regular-p . tramp-handle-file-regular-p) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index c4f0f1f..5910d1f 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -247,6 +247,7 @@ See `tramp-actions-before-shell' for more info.") (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) (file-notify-add-watch . tramp-handle-file-notify-add-watch) (file-notify-rm-watch . tramp-handle-file-notify-rm-watch) + (file-notify-valid-p . tramp-handle-file-notify-valid-p) (file-ownership-preserved-p . ignore) (file-readable-p . tramp-handle-file-exists-p) (file-regular-p . tramp-handle-file-regular-p) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 0969048..8b6ad7f 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2070,7 +2070,7 @@ ARGS are the arguments OPERATION has been called with." 'dired-print-file 'dired-shell-call-process)) default-directory) ;; PROC. - ((eq operation 'file-notify-rm-watch) + ((member operation (list 'file-notify-rm-watch 'file-notify-valid-p)) (when (processp (nth 0 args)) (with-current-buffer (process-buffer (nth 0 args)) default-directory))) @@ -3421,6 +3421,10 @@ of." (tramp-message proc 6 "Kill %S" proc) (kill-process proc)) +(defun tramp-handle-file-notify-valid-p (proc) + "Like `file-notify-valid-p' for Tramp files." + (and proc (processp proc) (memq (process-status proc) '(run open)))) + ;;; Functions for establishing connection: ;; The following functions are actions to be taken when seeing certain @@ -3615,7 +3619,7 @@ This is needed in order to hide `last-coding-system-used', which is set for process communication also." (with-current-buffer (process-buffer proc) ;; FIXME: If there is a gateway process, we need communication - ;; between several processes. Too complicated to implement, so we + ;; between several processes. Too complicate to implement, so we ;; read output from all processes. (let ((p (if (tramp-get-connection-property proc "gateway" nil) nil proc)) buffer-read-only last-coding-system-used) diff --git a/src/inotify.c b/src/inotify.c index eddad73..b73e873 100644 --- a/src/inotify.c +++ b/src/inotify.c @@ -367,6 +367,16 @@ See inotify_rm_watch(2) for more information. return Qt; } +DEFUN ("inotify-valid-p", Finotify_valid_p, Sinotify_valid_p, 1, 1, 0, + doc: /* "Check a watch specified by its WATCH-DESCRIPTOR. + +WATCH-DESCRIPTOR should be an object returned by `inotify-add-watch'. */) + (Lisp_Object watch_descriptor) +{ + Lisp_Object watch_object = Fassoc (watch_descriptor, watch_list); + return NILP (watch_object) ? Qnil : Qt; +} + void syms_of_inotify (void) { @@ -401,6 +411,7 @@ syms_of_inotify (void) defsubr (&Sinotify_add_watch); defsubr (&Sinotify_rm_watch); + defsubr (&Sinotify_valid_p); staticpro (&watch_list); commit a85472bbdcd16b0a695cd75f98b68ee39b86ae2f Author: Paul Eggert Date: Sun Sep 13 11:55:28 2015 -0700 Port Unicode char detection to FreeBSD+svgalib Problem reported by Ashish SHUKLA in: http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg00531.html * configure.ac: Check for struct unipair.unicode instead of for , since that’s more specific to what the code actually needs. * src/terminal.c: Use HAVE_STRUCT_UNIPAIR_UNICODE, not HAVE_LINUX_KD_H. diff --git a/configure.ac b/configure.ac index cd828de..f86d29e 100644 --- a/configure.ac +++ b/configure.ac @@ -1582,7 +1582,6 @@ fi dnl checks for header files AC_CHECK_HEADERS_ONCE( - linux/kd.h sys/systeminfo.h sys/sysinfo.h coff.h pty.h @@ -3999,6 +3998,8 @@ AC_SUBST(KRB4LIB) AC_CHECK_HEADERS(valgrind/valgrind.h) +AC_CHECK_MEMBERS([struct unipair.unicode], [], [], [[#include ]]) + AC_CHECK_FUNCS_ONCE(tzset) ok_so_far=yes diff --git a/src/terminal.c b/src/terminal.c index d7c16d9..80c6aa2 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -28,7 +28,7 @@ along with GNU Emacs. If not, see . */ #include "coding.h" #include "keyboard.h" -#ifdef HAVE_LINUX_KD_H +#if HAVE_STRUCT_UNIPAIR_UNICODE # include # include # include @@ -532,7 +532,7 @@ selected frame's terminal). */) return store_terminal_param (decode_live_terminal (terminal), parameter, value); } -#if HAVE_LINUX_KD_H +#if HAVE_STRUCT_UNIPAIR_UNICODE /* Compute the glyph code table for T. */ @@ -575,7 +575,7 @@ calculate_glyph_code_table (struct terminal *t) Lisp_Object terminal_glyph_code (struct terminal *t, int ch) { -#if HAVE_LINUX_KD_H +#if HAVE_STRUCT_UNIPAIR_UNICODE if (t->type == output_termcap) { /* As a hack, recompute the table when CH is the maximum commit 59e3f2df9314e160b37bb1375b4bad15976cd56f Author: Paul Eggert Date: Sun Sep 13 09:13:22 2015 -0700 * src/indent.c (Fvertical_motion): Simplify bugfix (Bug#21468). diff --git a/src/indent.c b/src/indent.c index 777cd36..ded1843 100644 --- a/src/indent.c +++ b/src/indent.c @@ -2203,10 +2203,7 @@ whether or not it is currently displayed in some window. */) and then reposition point at the requested X coordinate; if we don't, the cursor will be placed just after the string, which might not be the requested column. */ - if (nlines > 0 - && it.method == GET_FROM_STRING - && !it.string_from_display_prop_p - && it.area == TEXT_AREA) + if (nlines > 0 && it.area == TEXT_AREA) { while (it.method == GET_FROM_STRING && !it.string_from_display_prop_p commit 6514b30e6eb14e9d2364c08526dc8440a7412fef Author: Eli Zaretskii Date: Sun Sep 13 13:15:55 2015 +0300 Fix vertical cursor motion across overlay strings with newlines * src/indent.c (Fvertical_motion): Don't leave point in the middle of an overlay string with newlines, as that will position the cursor after the string at whatever column is there. (Bug#21468) diff --git a/src/indent.c b/src/indent.c index 7e8f0a5..777cd36 100644 --- a/src/indent.c +++ b/src/indent.c @@ -2195,7 +2195,30 @@ whether or not it is currently displayed in some window. */) was originally hscrolled, the goal column is interpreted as an addition to the hscroll amount. */ if (lcols_given) - move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X); + { + move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X); + /* If we find ourselves in the middle of an overlay string + which includes a newline after current string position, + we need to move by lines until we get out of the string, + and then reposition point at the requested X coordinate; + if we don't, the cursor will be placed just after the + string, which might not be the requested column. */ + if (nlines > 0 + && it.method == GET_FROM_STRING + && !it.string_from_display_prop_p + && it.area == TEXT_AREA) + { + while (it.method == GET_FROM_STRING + && !it.string_from_display_prop_p + && memchr (SSDATA (it.string) + IT_STRING_BYTEPOS (it), + '\n', + SBYTES (it.string) - IT_STRING_BYTEPOS (it))) + { + move_it_by_lines (&it, 1); + move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X); + } + } + } SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); bidi_unshelve_cache (itdata, 0);