summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--admin/ChangeLog10
-rw-r--r--admin/notes/repo19
-rw-r--r--doc/man/emacsclient.12
-rw-r--r--etc/emacs.desktop1
-rw-r--r--lisp/ChangeLog41
-rw-r--r--lisp/Makefile.in12
-rw-r--r--lisp/delsel.el76
-rw-r--r--lisp/emulation/cua-base.el72
-rw-r--r--lisp/net/tramp-cache.el4
-rw-r--r--lisp/net/tramp-sh.el61
-rw-r--r--lisp/progmodes/compile.el6
-rw-r--r--lisp/progmodes/vhdl-mode.el24
-rw-r--r--lisp/simple.el10
-rw-r--r--src/ChangeLog30
-rw-r--r--src/emacs.c8
-rw-r--r--src/macfont.m7
-rw-r--r--src/nsfns.m32
-rw-r--r--src/nsterm.h10
-rw-r--r--src/nsterm.m55
-rw-r--r--src/xdisp.c9
20 files changed, 312 insertions, 177 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 6bd5ceaca55..5dcdc563e56 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,7 +1,13 @@
+2014-11-01 Eli Zaretskii <eliz@gnu.org>
+
+ * notes/repo (Notes): Reword the stylistic guidance for commit log
+ messages so that they are in line with Emacs development practices
+ and style guidance.
+
2014-10-27 Eric S. Raymond <esr@thyrsus.com>
- * notes/bzr: Renamed to notes/repo, reorganixed to separate
- VCS-dependent from VCS-independent stuff. Added guidance about
+ * notes/bzr: Rename to notes/repo, reorganize to separate
+ VCS-dependent from VCS-independent stuff. Add guidance about
commit-comment format under DVCSes.
* notes/BRANCH: Merged into notes/repo.
diff --git a/admin/notes/repo b/admin/notes/repo
index 2044bb9ea2d..276dd372b37 100644
--- a/admin/notes/repo
+++ b/admin/notes/repo
@@ -5,18 +5,15 @@ NOTES ON COMMITTING TO EMACS'S REPOSITORY -*- outline -*-
Commits should follow the conventions used in all modern distributed
version-control systems. That is, they should consist of
-- A self-contained topic line no more than 75 chars long.
+- A self-contained topic line, preferably no more than 75 chars long.
-- If other content follows the topic line, there should be
- a blank line separating the two.
+- If other content follows the topic line, there should be a blank
+ line separating the two.
-Try to keep your commits - and your commit comments - small. If
-you feel an urge to put a bullet list in your commit comment, it's
-doing too many things at once.
-
-Yes, these directins are a departure from historical Emacs practice,
-but it helps modern log-viewing and summary tools work better so that
-other people can comprehend your code.
+- Follow the blank line with ChangeLog-like entries for the specific
+ changes you made, if any. (As long as Emacs maintains ChangeLog
+ files, just copy the entries you made in them to the commit message
+ after the blank line.)
* Commit to the right branch
@@ -184,7 +181,7 @@ the trunk at all, use `bzr resolve path/to/file --take-this' to keep the
trunk version. Prior to bzr 2.2.3, this may fail. You can just
delete the .OTHER etc files by hand and use bzr resolve path/to/file.
-* Sanity-checking branch merges
+* Sanity-checking branch merges
Inspect the ChangeLog entries (e.g. in case too many entries have been
included or whitespace between entries needs fixing). bzrmerge tries
diff --git a/doc/man/emacsclient.1 b/doc/man/emacsclient.1
index a5abcff0d5d..6930271e548 100644
--- a/doc/man/emacsclient.1
+++ b/doc/man/emacsclient.1
@@ -52,7 +52,7 @@ options starting with two dashes (`-').
.B \-a, \-\-alternate-editor=EDITOR
if the Emacs server is not running, run the specified editor instead.
This can also be specified via the `ALTERNATE_EDITOR' environment variable.
-If the value of EDITOR is the empty string, run `emacs --daemon' to
+If the value of EDITOR is the empty string, run `emacs \-\-daemon' to
start Emacs in daemon mode, and try to connect to it.
.TP
.B -c, \-\-create-frame
diff --git a/etc/emacs.desktop b/etc/emacs.desktop
index ff303a61536..2e6496e58c9 100644
--- a/etc/emacs.desktop
+++ b/etc/emacs.desktop
@@ -9,3 +9,4 @@ Type=Application
Terminal=false
Categories=Development;TextEditor;
StartupWMClass=Emacs
+Keywords=Text;Editor;
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ba63ff7772a..fc7e7392551 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,44 @@
+2014-11-01 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-cache.el (tramp-get-file-property)
+ (tramp-set-file-property): Check that `tramp-cache-get-count-*'
+ and `tramp-cache-set-count-*' are bound. Otherwise, there might
+ be compiler warnings.
+
+ * net/tramp-sh.el (tramp-get-remote-uid, tramp-get-remote-gid):
+ Return -1 respective "UNKNOWN", if uid or gid cannot be determined.
+
+2014-11-01 Eli Zaretskii <eliz@gnu.org>
+
+ * progmodes/compile.el (compilation-mode): Turn off deferred
+ fontifications locally. (Bug#18856)
+
+2014-11-01 Wolfgang Jenkner <wjenkner@inode.at>
+
+ * net/tramp-sh.el (tramp-send-command): Fix the case where the
+ remote-echo connection property is non-nil (bug#18858).
+
+2014-11-01 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * simple.el (newline): Add assertions to try and help catch bug#18913.
+
+ * emulation/cua-base.el (cua-delete-region): Use delete-active-region
+ (bug#18886).
+ (cua--last-deleted-region-pos, cua--last-deleted-region-text): Remove.
+
+2014-11-01 Kim F. Storm <storm@cua.dk>
+
+ Restore cua-delete-copy-to-register-0 and M-v command (bug#18886).
+ * delsel.el (delete-selection-save-to-register)
+ (delsel--replace-text-or-position): New vars.
+ (delete-active-region): Use them.
+ (delete-selection-repeat-replace-region): New command, moved from
+ cua-base.el.
+ * emulation/cua-base.el (cua--repeat-replace-text): Remove var.
+ (cua-repeat-replace-region): Move command to delsel.el.
+ (cua--init-keymaps): Update binding accordingly.
+ (cua-mode): Set delete-selection-save-to-register.
+
2014-11-01 Alan Mackenzie <acm@muc.de>
Make blink-parens work with a closing template delimiter.
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index b8b03a47362..84d92c21e7b 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -201,12 +201,12 @@ update-subdirs:
# Some modes of make-dist use this.
updates: update-subdirs autoloads finder-data custom-deps
-# This is useful after a repostiory fetch; but it doesn't do anything that a
-# plain "make" at top-level doesn't.
-# The only difference between this and this directory's "all" rule
-# is that this runs "autoloads" as well (because it uses "compile"
-# rather than "compile-main"). In a bootstrap, $(lisp) in src/Makefile
-# triggers this directory's autoloads rule.
+# This is useful after updating from the repository; but it doesn't do
+# anything that a plain "make" at top-level doesn't. The only
+# difference between this and this directory's "all" rule is that this
+# runs "autoloads" as well (because it uses "compile" rather than
+# "compile-main"). In a bootstrap, $(lisp) in src/Makefile triggers
+# this directory's autoloads rule.
repo-update: compile finder-data custom-deps
# Update the AUTHORS file.
diff --git a/lisp/delsel.el b/lisp/delsel.el
index 1ada02705fe..96794fce7aa 100644
--- a/lisp/delsel.el
+++ b/lisp/delsel.el
@@ -54,6 +54,10 @@
;;; Code:
+(defvar delete-selection-save-to-register nil
+ "If non-nil, deleted region text is stored in this register.
+Value must be the register (key) to use.")
+
;;;###autoload
(defalias 'pending-delete-mode 'delete-selection-mode)
@@ -72,16 +76,78 @@ point regardless of any selection."
(remove-hook 'pre-command-hook 'delete-selection-pre-hook)
(add-hook 'pre-command-hook 'delete-selection-pre-hook)))
+(defvar delsel--replace-text-or-position nil)
+
(defun delete-active-region (&optional killp)
"Delete the active region.
If KILLP in not-nil, the active region is killed instead of deleted."
- (if killp
- ;; Don't allow `kill-region' to change the value of `this-command'.
- (let (this-command)
- (kill-region (point) (mark) t))
- (funcall region-extract-function 'delete-only))
+ (cond
+ (killp
+ ;; Don't allow `kill-region' to change the value of `this-command'.
+ (let (this-command)
+ (kill-region (point) (mark) t)))
+ (delete-selection-save-to-register
+ (set-register delete-selection-save-to-register
+ (funcall region-extract-function t))
+ (setq delsel--replace-text-or-position
+ (cons (current-buffer)
+ (and (consp buffer-undo-list) (car buffer-undo-list)))))
+ (t
+ (funcall region-extract-function 'delete-only)))
t)
+(defun delete-selection-repeat-replace-region (arg)
+ "Repeat replacing text of highlighted region with typed text.
+Search for the next stretch of text identical to the region last replaced
+by typing text over it and replaces it with the same stretch of text.
+With ARG, repeat that many times. `C-u' means until end of buffer."
+ (interactive "P")
+ (let ((old-text (and delete-selection-save-to-register
+ (get-register delete-selection-save-to-register)))
+ (count (if (consp arg) (point-max)
+ (prefix-numeric-value current-prefix-arg))))
+ (if (not (and old-text
+ (> (length old-text) 0)
+ (or (stringp delsel--replace-text-or-position)
+ (buffer-live-p (car delsel--replace-text-or-position)))))
+ (message "No known previous replacement")
+ ;; If this is the first use after overwriting regions,
+ ;; find the replacement text by looking at the undo list.
+ (when (consp delsel--replace-text-or-position)
+ (let ((buffer (car delsel--replace-text-or-position))
+ (elt (cdr delsel--replace-text-or-position)))
+ (setq delsel--replace-text-or-position nil)
+ (with-current-buffer buffer
+ (save-restriction
+ (widen)
+ ;; Find the text that replaced the region via the undo list.
+ (let ((ul buffer-undo-list) u s e)
+ (when elt
+ (while (consp ul)
+ (setq u (car ul) ul (cdr ul))
+ (cond
+ ((eq u elt) ;; got it
+ (setq ul nil))
+ ((and (consp u) (integerp (car u)) (integerp (cdr u)))
+ (if (and s (= (cdr u) s))
+ (setq s (car u))
+ (setq s (car u) e (cdr u)))))))
+ (cond ((and s e (<= s e) (= s (mark t)))
+ (setq delsel--replace-text-or-position
+ (filter-buffer-substring s e))
+ (set-text-properties
+ 0 (length delsel--replace-text-or-position)
+ nil delsel--replace-text-or-position))
+ ((and (null s) (eq u elt)) ;; Nothing inserted.
+ (setq delsel--replace-text-or-position ""))
+ (t
+ (message "Cannot locate replacement text"))))))))
+ (while (and (> count 0)
+ delsel--replace-text-or-position
+ (search-forward old-text nil t))
+ (replace-match delsel--replace-text-or-position nil t)
+ (setq count (1- count))))))
+
(defun delete-selection-helper (type)
"Delete selection according to TYPE:
`yank'
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index ee70071b7ec..0b6891d6d6d 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -277,7 +277,7 @@ enabled."
(defcustom cua-remap-control-v t
"If non-nil, C-v binding is used for paste (yank).
-Also, M-v is mapped to `cua-repeat-replace-region'."
+Also, M-v is mapped to `delete-selection-repeat-replace-region'."
:type 'boolean
:group 'cua)
@@ -350,6 +350,8 @@ interpreted as a register number."
:group 'cua)
(defcustom cua-delete-copy-to-register-0 t
+ ;; FIXME: Obey delete-selection-save-to-register rather than hardcoding
+ ;; register 0.
"If non-nil, save last deleted region or rectangle to register 0."
:type 'boolean
:group 'cua)
@@ -788,26 +790,12 @@ Repeating prefix key when region is active works as a single prefix key."
;;; Region specific commands
-(defvar cua--last-deleted-region-pos nil)
-(defvar cua--last-deleted-region-text nil)
-
(defun cua-delete-region ()
"Delete the active region.
Save a copy in register 0 if `cua-delete-copy-to-register-0' is non-nil."
(interactive)
- (let ((start (mark)) (end (point)))
- (or (<= start end)
- (setq start (prog1 end (setq end start))))
- (setq cua--last-deleted-region-text
- (funcall region-extract-function t))
- (if cua-delete-copy-to-register-0
- (set-register ?0 cua--last-deleted-region-text))
- (setq cua--last-deleted-region-pos
- (cons (current-buffer)
- (and (consp buffer-undo-list)
- (car buffer-undo-list))))
- (cua--deactivate)
- (/= start end)))
+ (require 'delsel)
+ (delete-active-region))
(defun cua-copy-region (arg)
"Copy the region to the kill ring.
@@ -958,48 +946,8 @@ See also `exchange-point-and-mark'."
(t
(let (mark-active)
(exchange-point-and-mark)
- (if cua--rectangle
- (cua--rectangle-corner 0))))))
-
-;; Typed text that replaced the highlighted region.
-(defvar cua--repeat-replace-text nil)
-
-(defun cua-repeat-replace-region (arg)
- "Repeat replacing text of highlighted region with typed text.
-Searches for the next stretch of text identical to the region last
-replaced by typing text over it and replaces it with the same stretch
-of text."
- (interactive "P")
- (when cua--last-deleted-region-pos
- (with-current-buffer (car cua--last-deleted-region-pos)
- (save-restriction
- (widen)
- ;; Find the text that replaced the region via the undo list.
- (let ((ul buffer-undo-list)
- (elt (cdr cua--last-deleted-region-pos))
- u s e)
- (when elt
- (while (consp ul)
- (setq u (car ul) ul (cdr ul))
- (cond
- ((eq u elt) ;; got it
- (setq ul nil))
- ((and (consp u) (integerp (car u)) (integerp (cdr u)))
- (if (and s (= (cdr u) s))
- (setq s (car u))
- (setq s (car u) e (cdr u)))))))
- (cond ((and s e (<= s e) (= s (mark t)))
- (setq cua--repeat-replace-text (cua--filter-buffer-noprops s e)))
- ((and (null s) (eq u elt)) ;; nothing inserted
- (setq cua--repeat-replace-text
- ""))
- (t
- (message "Cannot locate replacement text"))))))
- (setq cua--last-deleted-region-pos nil))
- (if (and cua--last-deleted-region-text
- cua--repeat-replace-text
- (search-forward cua--last-deleted-region-text nil t nil))
- (replace-match cua--repeat-replace-text arg t)))
+ (if cua--rectangle
+ (cua--rectangle-corner 0))))))
(defun cua-help-for-region (&optional help)
"Show region specific help in echo area."
@@ -1320,7 +1268,8 @@ If ARG is the atom `-', scroll upward by nearly full screen."
(define-key cua--cua-keys-keymap [(control z)] 'undo))
(when cua-remap-control-v
(define-key cua--cua-keys-keymap [(control v)] 'yank)
- (define-key cua--cua-keys-keymap [(meta v)] 'cua-repeat-replace-region))
+ (define-key cua--cua-keys-keymap [(meta v)]
+ 'delete-selection-repeat-replace-region))
(define-key cua--prefix-override-keymap [(control x)] 'cua--prefix-override-handler)
(define-key cua--prefix-override-keymap [(control c)] 'cua--prefix-override-handler)
@@ -1359,6 +1308,7 @@ If ARG is the atom `-', scroll upward by nearly full screen."
;; delete-selection-mode
(defvar cua--saved-state nil)
+(defvar delete-selection-save-to-register)
;;;###autoload
(define-minor-mode cua-mode
@@ -1426,6 +1376,8 @@ the prefix fallback behavior."
(if (and (boundp 'delete-selection-mode) delete-selection-mode)
(delete-selection-mode -1)))
(if cua-highlight-region-shift-only (transient-mark-mode -1))
+ (if cua-delete-copy-to-register-0
+ (setq delete-selection-save-to-register ?0))
(cua--deactivate))
(cua--saved-state
(if (nth 0 cua--saved-state)
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 056b1bdaf91..a6b7500433b 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -144,7 +144,7 @@ Returns DEFAULT if not set."
(tramp-message key 8 "%s %s %s" file property value)
(when (>= tramp-verbose 10)
(let* ((var (intern (concat "tramp-cache-get-count-" property)))
- (val (or (ignore-errors (symbol-value var)) 0)))
+ (val (or (and (boundp var) (symbol-value var)) 0)))
(set var (1+ val))))
value))
@@ -161,7 +161,7 @@ Returns VALUE."
(tramp-message key 8 "%s %s %s" file property value)
(when (>= tramp-verbose 10)
(let* ((var (intern (concat "tramp-cache-set-count-" property)))
- (val (or (ignore-errors (symbol-value var)) 0)))
+ (val (or (and (boundp var) (symbol-value var)) 0)))
(set var (1+ val))))
value))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 1976e0e7f66..e120aedfc01 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4769,6 +4769,17 @@ function waits for output unless NOOUTPUT is set."
(when (tramp-get-connection-property p "remote-echo" nil)
;; We mark the command string that it can be erased in the output buffer.
(tramp-set-connection-property p "check-remote-echo" t)
+ ;; If we put `tramp-echo-mark' after a trailing newline (which
+ ;; is assumed to be unquoted) `tramp-send-string' doesn't see
+ ;; that newline and adds `tramp-rsh-end-of-line' right after
+ ;; `tramp-echo-mark', so the remote shell sees two consecutive
+ ;; trailing line endings and sends two prompts after executing
+ ;; the command, which confuses `tramp-wait-for-output'.
+ (when (and (not (string= command ""))
+ (string-equal (substring command -1) "\n"))
+ (setq command (substring command 0 -1)))
+ ;; No need to restore a trailing newline here since `tramp-send-string'
+ ;; makes sure that the string ends in `tramp-rsh-end-of-line', anyway.
(setq command (format "%s%s%s" tramp-echo-mark command tramp-echo-mark)))
;; Send the command.
(tramp-message vec 6 "%s" command)
@@ -5278,17 +5289,20 @@ Return ATTR."
(defun tramp-get-remote-uid (vec id-format)
(with-tramp-connection-property vec (format "uid-%s" id-format)
- (let ((res (cond
- ((tramp-get-remote-id vec)
- (tramp-get-remote-uid-with-id vec id-format))
- ((tramp-get-remote-perl vec)
- (tramp-get-remote-uid-with-perl vec id-format))
- ((tramp-get-remote-python vec)
- (tramp-get-remote-uid-with-python vec id-format))
- (t (tramp-error
- vec 'file-error "Cannot determine remote uid")))))
- ;; The command might not always return a number.
- (if (and (equal id-format 'integer) (not (integerp res))) -1 res))))
+ (let ((res
+ (ignore-errors
+ (cond
+ ((tramp-get-remote-id vec)
+ (tramp-get-remote-uid-with-id vec id-format))
+ ((tramp-get-remote-perl vec)
+ (tramp-get-remote-uid-with-perl vec id-format))
+ ((tramp-get-remote-python vec)
+ (tramp-get-remote-uid-with-python vec id-format))))))
+ ;; Ensure there is a valid result.
+ (cond
+ ((and (equal id-format 'integer) (not (integerp res))) -1)
+ ((and (equal id-format 'string) (not (stringp res))) "UNKNOWN")
+ (t res)))))
(defun tramp-get-remote-gid-with-id (vec id-format)
(tramp-send-command-and-read
@@ -5319,17 +5333,20 @@ Return ATTR."
(defun tramp-get-remote-gid (vec id-format)
(with-tramp-connection-property vec (format "gid-%s" id-format)
- (let ((res (cond
- ((tramp-get-remote-id vec)
- (tramp-get-remote-gid-with-id vec id-format))
- ((tramp-get-remote-perl vec)
- (tramp-get-remote-gid-with-perl vec id-format))
- ((tramp-get-remote-python vec)
- (tramp-get-remote-gid-with-python vec id-format))
- (t (tramp-error
- vec 'file-error "Cannot determine remote gid")))))
- ;; The command might not always return a number.
- (if (and (equal id-format 'integer) (not (integerp res))) -1 res))))
+ (let ((res
+ (ignore-errors
+ (cond
+ ((tramp-get-remote-id vec)
+ (tramp-get-remote-gid-with-id vec id-format))
+ ((tramp-get-remote-perl vec)
+ (tramp-get-remote-gid-with-perl vec id-format))
+ ((tramp-get-remote-python vec)
+ (tramp-get-remote-gid-with-python vec id-format))))))
+ ;; Ensure there is a valid result.
+ (cond
+ ((and (equal id-format 'integer) (not (integerp res))) -1)
+ ((and (equal id-format 'string) (not (stringp res))) "UNKNOWN")
+ (t res)))))
;; Some predefined connection properties.
(defun tramp-get-inline-compress (vec prop size)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index d3d03cd2030..5de2c6afa53 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1984,6 +1984,12 @@ Runs `compilation-mode-hook' with `run-mode-hooks' (which see).
compilation-page-delimiter)
;; (set (make-local-variable 'compilation-buffer-modtime) nil)
(compilation-setup)
+ ;; Turn off deferred fontifications in the compilation buffer, if
+ ;; the user turned them on globally. This is because idle timers
+ ;; aren't re-run after receiving input from a subprocess, so the
+ ;; buffer is left unfontified after the compilation exits, until
+ ;; some other input event happens.
+ (set (make-local-variable 'jit-lock-defer-time) nil)
(setq buffer-read-only t)
(run-mode-hooks 'compilation-mode-hook))
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 3d5a3980a94..9f54b246eff 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -503,7 +503,7 @@ NOTE: Activate the new setting by restarting Emacs."
"List of default target names in Makefiles.
Automatically generated Makefiles include three default targets to compile
the entire design, clean the entire design and to create the design library.
-This option allows to change the names of these targets to avoid conflicts
+This option allows you to change the names of these targets to avoid conflicts
with other user Makefiles."
:type '(list (string :tag "Compile entire design")
(string :tag "Clean entire design ")
@@ -513,7 +513,7 @@ with other user Makefiles."
(defcustom vhdl-makefile-generation-hook nil
"Functions to run at the end of Makefile generation.
-Allows to insert user specific parts into a Makefile.
+Allows you to insert user specific parts into a Makefile.
Example:
\(lambda nil
@@ -590,8 +590,8 @@ well as \"./\" and \"../\" (\"sh\" syntax). Paths can also be absolute.
Environment variables (e.g. \"$EXAMPLE2\") are resolved. If no sources are
specified, the default directory is taken as source directory. Otherwise,
the default directory is only taken as source directory if there is a sources
-entry with the empty string or \"./\". Exclude regexp allows to filter out
-specific file and directory names from the list of sources (e.g. CVS
+entry with the empty string or \"./\". Exclude regexp allows you to filter
+out specific file and directory names from the list of sources (e.g. CVS
directories).
Files are compiled in the compile directory. Makefiles are also placed into
@@ -606,7 +606,7 @@ overwrite the settings of the current compiler.
File-specific compiler options (highest priority) overwrite project-specific
options which overwrite default options (lowest priority). Lower priority
-options can be inserted in higher priority options. This allows to reuse
+options can be inserted in higher priority options. This allows you to reuse
default options (e.g. \"-file\") in project- or file-specific options (e.g.
\"-93 -file\").
@@ -671,7 +671,7 @@ browser. The current project can also be changed temporarily in the menu."
(defcustom vhdl-project-file-name '("\\1.prj")
"List of file names/paths for importing/exporting project setups.
\"\\1\" is replaced by the project name (SPC is replaced by `_'), \"\\2\" is
-replaced by the user name (allows to have user-specific project setups).
+replaced by the user name (allows you to have user-specific project setups).
The first entry is used as file name to import/export individual project
setups. All entries are used to automatically import project setups at
startup (see option `vhdl-project-auto-load'). Projects loaded from the
@@ -1540,8 +1540,8 @@ Option `vhdl-align-groups' still applies within these blocks."
:group 'vhdl-beautify)
(defcustom vhdl-beautify-options '(t t t t t)
- "List of options for beautifying code. Allows to disable individual
-features of code beautification."
+ "List of options for beautifying code.
+Allows you to disable individual features of code beautification."
:type '(list (boolean :tag "Whitespace cleanup ")
(boolean :tag "Single statement per line")
(boolean :tag "Indentation ")
@@ -4449,7 +4449,7 @@ Usage:
and vice versa.
Syntax-based indentation can be very slow in large files. Option
- `vhdl-indent-syntax-based' allows to use faster but simpler indentation.
+ `vhdl-indent-syntax-based' allows you to use faster but simpler indentation.
Option `vhdl-indent-comment-like-next-code-line' controls whether
comment lines are indented like the preceding or like the following code
@@ -4482,7 +4482,7 @@ Usage:
CODE FILLING:
- Code filling allows to condense code (e.g. sensitivity lists or port
+ Code filling allows you to condense code (e.g. sensitivity lists or port
maps) by removing comments and newlines and re-wrapping so that all
lines are maximally filled (block filling). `C-c C-f C-f' fills a list
enclosed by parenthesis, `C-c C-f C-g' a group of lines separated by
@@ -4742,7 +4742,7 @@ Usage:
Words with special syntax can be highlighted by specifying their
syntax and color in option `vhdl-special-syntax-alist' and by setting
- option `vhdl-highlight-special-words' to non-nil. This allows to
+ option `vhdl-highlight-special-words' to non-nil. This allows you to
establish some naming conventions (e.g. to distinguish different kinds
of signals or other objects by using name suffices) and to support them
visually.
@@ -16964,7 +16964,7 @@ do not print any file names."
(defun vhdl-make (&optional target)
"Call make command for compilation of all updated source files (requires
-`Makefile'). Optional argument TARGET allows to compile the design
+`Makefile'). Optional argument TARGET allows you to compile the design
specified by a target."
(interactive)
(setq vhdl-make-target
diff --git a/lisp/simple.el b/lisp/simple.el
index a50294e54fd..1a596cf11db 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -28,6 +28,8 @@
;;; Code:
+(eval-when-compile (require 'cl-lib))
+
(declare-function widget-convert "wid-edit" (type &rest args))
(declare-function shell-mode "shell" ())
@@ -410,6 +412,7 @@ A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'."
;; Do the rest in post-self-insert-hook, because we want to do it
;; *before* other functions on that hook.
(lambda ()
+ (cl-assert (eq ?\n (char-before)))
;; Mark the newline(s) `hard'.
(if use-hard-newlines
(set-hard-newline-properties
@@ -428,7 +431,8 @@ A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'."
;; starts a page.
(or was-page-start
(move-to-left-margin nil t)))))
- (if (not interactive)
+ (unwind-protect
+ (if (not interactive)
;; FIXME: For non-interactive uses, many calls actually just want
;; (insert "\n"), so maybe we should do just that, so as to avoid
;; the risk of filling or running abbrevs unexpectedly.
@@ -441,7 +445,9 @@ A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'."
;; We first used let-binding to protect the hook, but that was naive
;; since add-hook affects the symbol-default value of the variable,
;; whereas the let-binding might only protect the buffer-local value.
- (remove-hook 'post-self-insert-hook postproc))))
+ (remove-hook 'post-self-insert-hook postproc)))
+ (cl-assert (not (member postproc post-self-insert-hook)))
+ (cl-assert (not (member postproc (default-value 'post-self-insert-hook))))))
nil)
(defun set-hard-newline-properties (from to)
diff --git a/src/ChangeLog b/src/ChangeLog
index d2cfa0dbfc3..4fb50118444 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,33 @@
+2014-11-01 Jan Djärv <jan.h.d@swipnet.se>
+
+ * macfont.m (macfont_glyph_extents): Turn off synthetic bold
+ if force_integral_p (i.e. no antialias).
+ (macfont_draw): Check ns_antialias_text, also turn off synthetic
+ bold if no antialias (Bug#18876).
+
+ * emacs.c (main): Don't chdir to $HOME on Cocoa if --chdir
+ was given (Bug#18846).
+
+ * nsterm.h (ns_set_doc_edited): Declare taking no args.
+
+ * nsfns.m (ns_set_doc_edited): Do all logic (check frames) here
+ instead of in xdisp.c, function now takes void. (Bug#18884).
+
+ * xdisp.c (prepare_menu_bars): Remove HAVE_NS code.
+ (redisplay_internal): Call ns_set_doc_edited if HAVE_NS (Bug#18884).
+
+ * nsterm.h (EmacsScroller): Replace Lisp_Object win with
+ struct window* (Bug#18889).
+ Remove getMouseMotionPart.
+ (ns_output): Make icon_top/left int.
+
+ * nsfns.m (x_icon): icon_top/left is int.
+
+ * nsterm.m (ns_mouse_position): Remove unused code.
+ (initFrame:window:, dealloc): Use window instead of win.
+ (getMouseMotionPart:window:x:y:): Remove, unused.
+ (sendScrollEventAtLoc:fromEvent:): Make Lisp_Object win from window.
+
2014-11-01 Eli Zaretskii <eliz@gnu.org>
* keyboard.c (readable_events): When FLAGS include
diff --git a/src/emacs.c b/src/emacs.c
index 90182e53e70..62f03c6ea12 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -721,7 +721,7 @@ main (int argc, char **argv)
#ifdef DAEMON_MUST_EXEC
char dname_arg2[80];
#endif
- char *ch_to_dir;
+ char *ch_to_dir = 0;
/* If we use --chdir, this records the original directory. */
char *original_pwd = 0;
@@ -1230,19 +1230,19 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
/* Started from GUI? */
/* FIXME: Do the right thing if getenv returns NULL, or if
chdir fails. */
- if (! inhibit_window_system && ! isatty (0))
+ if (! inhibit_window_system && ! isatty (0) && ! ch_to_dir)
chdir (getenv ("HOME"));
if (skip_args < argc)
{
if (!strncmp (argv[skip_args], "-psn", 4))
{
skip_args += 1;
- chdir (getenv ("HOME"));
+ if (! ch_to_dir) chdir (getenv ("HOME"));
}
else if (skip_args+1 < argc && !strncmp (argv[skip_args+1], "-psn", 4))
{
skip_args += 2;
- chdir (getenv ("HOME"));
+ if (! ch_to_dir) chdir (getenv ("HOME"));
}
}
#endif /* COCOA */
diff --git a/src/macfont.m b/src/macfont.m
index 366d087f8c2..c29ecc03f23 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -1086,7 +1086,7 @@ macfont_glyph_extents (struct font *font, CGGlyph glyph,
bounds.size =
CGSizeApplyAffineTransform (bounds.size, synthetic_italic_atfm);
}
- if (macfont_info->synthetic_bold_p)
+ if (macfont_info->synthetic_bold_p && ! force_integral_p)
{
CGFloat d =
- synthetic_bold_factor * mac_font_get_size (macfont) / 2;
@@ -2692,7 +2692,8 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y,
CGPoint *positions;
CGFloat font_size = mac_font_get_size (macfont_info->macfont);
bool no_antialias_p =
- (macfont_info->antialias == MACFONT_ANTIALIAS_OFF
+ (NILP (ns_antialias_text)
+ || macfont_info->antialias == MACFONT_ANTIALIAS_OFF
|| (macfont_info->antialias == MACFONT_ANTIALIAS_DEFAULT
&& font_size <= macfont_antialias_threshold));
int len = to - from;
@@ -2755,7 +2756,7 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y,
atfm = synthetic_italic_atfm;
else
atfm = CGAffineTransformIdentity;
- if (macfont_info->synthetic_bold_p)
+ if (macfont_info->synthetic_bold_p && ! no_antialias_p))
{
CGContextSetTextDrawingMode (context, kCGTextFillStroke);
CGContextSetLineWidth (context, synthetic_bold_factor * font_size);
diff --git a/src/nsfns.m b/src/nsfns.m
index a93b2724403..ce859e8333d 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -629,18 +629,26 @@ ns_set_name_as_filename (struct frame *f)
void
-ns_set_doc_edited (struct frame *f, Lisp_Object arg)
+ns_set_doc_edited (void)
{
- NSView *view = FRAME_NS_VIEW (f);
NSAutoreleasePool *pool;
- if (!MINI_WINDOW_P (XWINDOW (f->selected_window)))
+ Lisp_Object tail, frame;
+ block_input ();
+ pool = [[NSAutoreleasePool alloc] init];
+ FOR_EACH_FRAME (tail, frame)
{
- block_input ();
- pool = [[NSAutoreleasePool alloc] init];
- [[view window] setDocumentEdited: !NILP (arg)];
- [pool release];
- unblock_input ();
+ BOOL edited = NO;
+ struct frame *f = XFRAME (frame);
+ struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f));
+ NSView *view = FRAME_NS_VIEW (f);
+ if (!MINI_WINDOW_P (w))
+ edited = ! NILP (Fbuffer_modified_p (w->contents)) &&
+ ! NILP (Fbuffer_file_name (w->contents));
+ [[view window] setDocumentEdited: edited];
}
+
+ [pool release];
+ unblock_input ();
}
@@ -935,8 +943,8 @@ x_icon (struct frame *f, Lisp_Object parms)
Lisp_Object icon_x, icon_y;
struct ns_display_info *dpyinfo = check_ns_display_info (Qnil);
- f->output_data.ns->icon_top = Qnil;
- f->output_data.ns->icon_left = Qnil;
+ f->output_data.ns->icon_top = -1;
+ f->output_data.ns->icon_left = -1;
/* Set the position of the icon. */
icon_x = x_get_arg (dpyinfo, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER);
@@ -945,8 +953,8 @@ x_icon (struct frame *f, Lisp_Object parms)
{
CHECK_NUMBER (icon_x);
CHECK_NUMBER (icon_y);
- f->output_data.ns->icon_top = icon_y;
- f->output_data.ns->icon_left = icon_x;
+ f->output_data.ns->icon_top = XINT (icon_y);
+ f->output_data.ns->icon_left = XINT (icon_x);
}
else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound))
error ("Both left and top icon corners of icon must be specified");
diff --git a/src/nsterm.h b/src/nsterm.h
index f59405fe9af..b665ac1dd52 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -373,7 +373,7 @@ typedef float EmacsCGFloat;
@interface EmacsScroller : NSScroller
{
- Lisp_Object win;
+ struct window *window;
struct frame *frame;
NSResponder *prevResponder;
@@ -397,8 +397,6 @@ typedef float EmacsCGFloat;
- setPosition: (int) position portion: (int) portion whole: (int) whole;
- (int) checkSamePosition: (int)position portion: (int)portion
whole: (int)whole;
-- (void) getMouseMotionPart: (int *)part window: (Lisp_Object *)window
- x: (Lisp_Object *)x y: ( Lisp_Object *)y;
- (void) sendScrollEventAtLoc: (float)loc fromEvent: (NSEvent *)e;
- repeatScroll: (NSTimer *)sender;
- condemn;
@@ -667,8 +665,8 @@ struct ns_output
value contains an ID of the fontset, else -1. */
int fontset; /* only used with font_backend */
- Lisp_Object icon_top;
- Lisp_Object icon_left;
+ int icon_top;
+ int icon_left;
/* The size of the extra width currently allotted for vertical
scroll bars, in pixels. */
@@ -817,7 +815,7 @@ extern void nxatoms_of_nsselect (void);
extern int ns_lisp_to_cursor_type (Lisp_Object arg);
extern Lisp_Object ns_cursor_type_to_lisp (int arg);
extern void ns_set_name_as_filename (struct frame *f);
-extern void ns_set_doc_edited (struct frame *f, Lisp_Object arg);
+extern void ns_set_doc_edited (void);
extern bool
ns_defined_color (struct frame *f,
diff --git a/src/nsterm.m b/src/nsterm.m
index 3ae4146dc20..c814e63f12e 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1892,14 +1892,36 @@ ns_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
block_input ();
- if (dpyinfo->last_mouse_scroll_bar != nil && insist == 0)
+ /* Clear the mouse-moved flag for every frame on this display. */
+ FOR_EACH_FRAME (tail, frame)
+ if (FRAME_NS_P (XFRAME (frame))
+ && FRAME_NS_DISPLAY (XFRAME (frame)) == FRAME_NS_DISPLAY (*fp))
+ XFRAME (frame)->mouse_moved = 0;
+
+ dpyinfo->last_mouse_scroll_bar = nil;
+ if (dpyinfo->last_mouse_frame
+ && FRAME_LIVE_P (dpyinfo->last_mouse_frame))
+ f = dpyinfo->last_mouse_frame;
+ else
+ f = dpyinfo->x_focus_frame ? dpyinfo->x_focus_frame : SELECTED_FRAME ();
+
+ if (f && FRAME_NS_P (f))
{
- /* TODO: we do not use this path at the moment because drag events will
- go directly to the EmacsScroller. Leaving code in for now. */
- [dpyinfo->last_mouse_scroll_bar
- getMouseMotionPart: (int *)part window: bar_window x: x y: y];
+ view = FRAME_NS_VIEW (*fp);
+
+ position = [[view window] mouseLocationOutsideOfEventStream];
+ position = [view convertPoint: position fromView: nil];
+ remember_mouse_glyph (f, position.x, position.y,
+ &dpyinfo->last_mouse_glyph);
+/*fprintf (stderr, "ns_mouse_position: %.0f, %.0f\n", position.x, position.y); */
+
+ if (bar_window) *bar_window = Qnil;
+ if (part) *part = 0; /*scroll_bar_handle; */
+
+ if (x) XSETINT (*x, lrint (position.x));
+ if (y) XSETINT (*y, lrint (position.y));
if (time)
- *time = dpyinfo->last_mouse_movement_time;
+ *time = dpyinfo->last_mouse_movement_time;
dpyinfo->last_mouse_scroll_bar = nil;
}
else
@@ -7164,13 +7186,13 @@ if (cols > 0 && rows > 0)
[self setAutoresizingMask: NSViewMinXMargin | NSViewHeightSizable];
#endif
- win = nwin;
+ window = XWINDOW (nwin);
condemned = NO;
pixel_height = NSHeight (r);
if (pixel_height == 0) pixel_height = 1;
min_portion = 20 / pixel_height;
- frame = XFRAME (XWINDOW (win)->frame);
+ frame = XFRAME (window->frame);
if (FRAME_LIVE_P (frame))
{
int i;
@@ -7302,30 +7324,17 @@ if (cols > 0 && rows > 0)
return self;
}
-/* FIXME: unused at moment (see ns_mouse_position) at the moment because
- drag events will go directly to the EmacsScroller. Leaving in for now. */
--(void)getMouseMotionPart: (int *)part window: (Lisp_Object *)window
- x: (Lisp_Object *)x y: ( Lisp_Object *)y
-{
- *part = last_hit_part;
- *window = win;
- XSETINT (*y, pixel_height);
- if ([self floatValue] > 0.999F)
- XSETINT (*x, pixel_height);
- else
- XSETINT (*x, pixel_height * [self floatValue]);
-}
-
-
/* set up emacs_event */
- (void) sendScrollEventAtLoc: (float)loc fromEvent: (NSEvent *)e
{
+ Lisp_Object win;
if (!emacs_event)
return;
emacs_event->part = last_hit_part;
emacs_event->code = 0;
emacs_event->modifiers = EV_MODIFIERS (e) | down_modifier;
+ XSETWINDOW (win, window);
emacs_event->frame_or_window = win;
emacs_event->timestamp = EV_TIMESTAMP (e);
emacs_event->kind = SCROLL_BAR_CLICK_EVENT;
diff --git a/src/xdisp.c b/src/xdisp.c
index d27d76d8f5b..228b6cb586d 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -11785,12 +11785,6 @@ prepare_menu_bars (void)
#ifdef HAVE_WINDOW_SYSTEM
update_tool_bar (f, 0);
#endif
-#ifdef HAVE_NS
- if (windows_or_buffers_changed
- && FRAME_NS_P (f))
- ns_set_doc_edited
- (f, Fbuffer_modified_p (XWINDOW (f->selected_window)->contents));
-#endif
UNGCPRO;
}
@@ -14121,6 +14115,9 @@ redisplay_internal (void)
#endif /* HAVE_WINDOW_SYSTEM */
end_of_redisplay:
+#ifdef HAVE_NS
+ ns_set_doc_edited ();
+#endif
if (interrupt_input && interrupts_deferred)
request_sigio ();