emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 692caf1 09/21: Merge from origin/emacs-25


From: John Wiegley
Subject: [Emacs-diffs] master 692caf1 09/21: Merge from origin/emacs-25
Date: Fri, 04 Mar 2016 08:06:52 +0000

branch: master
commit 692caf1e8d1657fbe4809294df6791c2879a7bb1
Merge: 018bdf7 b13cab6
Author: John Wiegley <address@hidden>
Commit: John Wiegley <address@hidden>

    Merge from origin/emacs-25
    
    b13cab6 Add a eww command to toggle paragraph direction
    4e46128 * nextstep/WISHLIST: Merge into etc/TODO and remove.
    9e078e5 Fix char signedness issue in bidi code
    064adf6 * lib-src/pop.c (socket_connection): Fix format string.
    14060a9 Avoid inflooping in thing-at-point-looking-at
    098d47b * lisp/emacs-lisp/derived.el (define-derived-mode): Revert
            indent change.
    b5db8e0 etc/PROBLEMS: Mention problems with using file descriptors
    ec10ef9 * lisp/apropos.el (apropos-variable): Doc fix.  (Bug#22813).
    d2dd614 Remove unneeded workaround in xftfont.c
    9b7593c ; * etc/NEWS: Reflect latest changes in saveplace.
    fde0cd1 * lisp/saveplace.el (save-place-local-mode): New minor mode
    06a872b Fix redisplay on a TTY after 'make-frame'
    95f5a43 Make double-click-1 work with unbalanced parens in CC Mode.
            Fixes bug#5560.
    7d206fc Input method polish-slash should not use keyboard translation
    8be32cf Fix an assertion
    040e0d6 Fix 'toggle-save-place'
    5244db2 * src/keyboard.c: Don't inadvertently set immediate_echo (bug#22581)
---
 doc/misc/eww.texi            |    8 ++
 etc/NEWS                     |   19 ++--
 etc/PROBLEMS                 |   10 ++
 etc/TODO                     |  243 ++++++++++++++++++++++++++++++++++++++++-
 lib-src/pop.c                |    2 +-
 lisp/apropos.el              |    5 +-
 lisp/emacs-lisp/derived.el   |    3 +-
 lisp/leim/quail/latin-pre.el |    2 +-
 lisp/mouse.el                |   29 ++++--
 lisp/net/eww.el              |   13 ++-
 lisp/saveplace.el            |   48 +++++----
 lisp/thingatpt.el            |   13 ++-
 nextstep/README              |    4 +-
 nextstep/WISHLIST            |  247 ------------------------------------------
 src/dispextern.h             |    4 +-
 src/dispnew.c                |    4 +-
 src/keyboard.c               |   28 +++--
 src/xdisp.c                  |    9 ++-
 src/xftfont.c                |   10 --
 19 files changed, 374 insertions(+), 327 deletions(-)

diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi
index afb1caf..f15e2f2 100644
--- a/doc/misc/eww.texi
+++ b/doc/misc/eww.texi
@@ -216,6 +216,14 @@ For details about the Cookie handling @xref{Cookies,,,url}.
 @code{eww-header-line-format}.  The format replaces @code{%t} with the
 title of the website and @code{%u} with the URL.
 
address@hidden eww-toggle-paragraph-direction
address@hidden paragraph direction
+  The @kbd{D} command (@code{eww-toggle-paragraph-direction}) toggles
+the paragraphs direction between left-to-right and right-to-left
+text.  This can be useful on web pages that display right-to-left test
+(like Arabic and Hebrew), but where the web pages don't explicitly
+state the directionality.
+
 @c @vindex shr-bullet
 @c @vindex shr-hr-line
 @c @vindex eww-form-checkbox-selected-symbol
diff --git a/etc/NEWS b/etc/NEWS
index 8c7f494..8725049 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -588,13 +588,14 @@ additionally need to add `getSelection' to 
`xterm-extra-capabilities'.
 *** `xterm-mouse-mode' now supports mouse-tracking (if your xterm supports it).
 
 ---
-** To turn on `save-place' mode globally, you must call `(save-place-mode 1)'.
-In order to have the last place in every file saved it is no longer
-sufficient to load the saveplace library and set the default value of
-`save-place' to non-nil.  You must explicitly call the function
-`save-place-mode' with a positive argument instead.  The `save-place'
-variable is now an obsolete alias for `save-place-mode', which
-replaces it.
+** The way to turn on and off `save-place' mode has changed.
+It is no longer sufficient to load the saveplace library and set
+`save-place' non-nil.  Instead, use the two new minor modes:
+`save-place-mode' turns on saving last place in every file, and
+`save-place-local-mode' does that only for the file in whose buffer it
+is invoked.  The `save-place' variable is now an obsolete alias for
+`save-place-mode', which replaces it, and `toggle-save-place' is an
+obsolete alias for the new `save-place-local-mode' command.
 
 ** ERC
 
@@ -865,6 +866,10 @@ customize the `shr-use-colors' variable.
 textual parts of a web page and display only that, leaving menus and
 the like off the page.
 
++++
+*** A new command `D' (`eww-toggle-paragraph-direction') allows you to
+toggle the paragraph direction between left-to-right and right-to-left.
+
 ---
 *** Images that are being loaded are now marked with grey
 "placeholder" images of the size specified by the HTML.  They are then
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 7d78037..0491935 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -600,6 +600,16 @@ you have a personal configuration file (normally 
~/.aspell.conf), it
 can cause this error.  Remove that file, execute 'ispell-kill-ispell'
 in Emacs, and then try spell-checking again.
 
+*** Emacs eats all file descriptors when using kqueue file notifications.
+
+When you have a large number of buffers running auto-revert-mode, and
+Emacs is configured to use the kqueue file notification library, it
+uses an own file descriptor for every watched file.  On systems with a
+small limit of file descriptors allowed per process, like OS X, you
+could run out of file descriptors.  You won't be able to open new files.
+
+Set auto-revert-use-notify to nil in order to avoid this problem.
+
 * Runtime problems related to font handling
 
 ** Characters are displayed as empty boxes or with wrong font under X.
diff --git a/etc/TODO b/etc/TODO
index 590d233..39ebef3 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -675,15 +675,242 @@ from the emacsclient process.
 
 ** NeXTstep port
 
+*** Missing features
+
+This sections contains features found in other official Emacs ports.
+
+**** Support for "xwidget"
+
+Emacs 25 has support for "xwidgets", a system to include operating
+system components into an Emacs buffer.  The components range from
+simple buttons to "webkit" (effectively, a web browser).
+
+Currently, "xwidget" only works for the "gtk+" framework but it is
+designed to be compatible with multiple Emacs ports.
+
+**** Respect `frame-inhibit-implied-resize'
+
+When the variable `frame-inhibit-implied-resize' is non-nil, frames
+should not be resized when operations like changing font or toggling
+the tool bar is performed.
+
+Unfortunately, the tool bar (and possible other operations) always
+resize the frame.
+
+**** Support `proced' (implement `process-attributes')
+
+Unfortunately, a user-level process like Emacs does not have the
+privileges to get information about other processes under OS X.
+
+There are other ways to do this:
+
+ 1) Spawn "ps" and parse the output ("ps" has superuser privileges).
+
+ 2) Sign Emacs as part of the distribution process.
+
+ 3) Ask the user to self-sign Emacs, if this feature is of interest.
+
+Anders Lindgren <address@hidden> has implemented
+`process-attributes' for OS X, which currently only work when
+running Emacs as root.
+
+See this article by Bozhidar Batsov for an overview of Proced:
+http://emacsredux.com/blog/2013/05/02/manage-processes-with-proced/
+
+**** Tooltip properties
+
+Tooltip properties like the background color and font are hard-wired,
+even though Emacs allows a user to customize such features.
+
+*** New features
+
+This section contains features unique to Nextstep and/or OS X.
+
+**** PressAndHold for writing accented character
+
+On OS X, many application support the press and hold pattern to
+invoke a menu of accented characters.  (See example at
+https://support.apple.com/en-us/HT201586 .)
+
+Currently, this doesn't work in Emacs.
+
+Note that "ns-win.el" explicitly disables this.
+
+Note: This feature might not be allowed to be implemented until also
+implemented in Emacs for a free system.
+
+**** Floating scroll bars
+
+In modern OS X applications, the scroll bar often floats over the
+content, and is invisible unless actually used.  This makes the user
+interface less cluttered and more area could be used to contain text.
+
+With floating scroll bars, the user interface would look like it does
+when they are disabled today.  However, they will be made visible when
+a scroll action is initiated, e.g. by putting two fingers on a
+trackpad.
+
+Note: This feature might not be allowed to be implemented until also
+implemented in Emacs for a free system.
+
+*** Features from the "mac" port
+
+This section contains features available in the "mac" Emacs port.
+
+As the "mac" port (as of this writing) isn't an official Emacs port,
+it might contain features not following the FSF rule "must exist on
+free systems".
+
+The "mac" port is based on the Emacs 22 C-based Carbon interface.
+It has been maintained in parallel to the official Cocoa-based NS
+interface.  The Carbon interface has been enhanced, and a number of the
+features of that interface could be implemented NS.
+
+**** Smooth scrolling -- maybe not a good idea
+
+Today, by default, scrolling with a trackpad makes the text move in
+steps of five lines.  (Scrolling with SHIFT scrolls one line at a time.)
+
+The "mac" port provides smooth, pixel-based, scrolling.  This is a very
+popular features.  However, there are drawbacks to this method: what
+happens if only a fraction of a line is visible at the top of a
+window, is the partially visible text considered part of the window or
+not?  (Technically, what should `window-start' return.)
+
+An alternative would be to make one-line scrolling the default on NS
+(or in Emacs in general).
+
+Note: This feature might not be allowed to be implemented until also
+implemented in Emacs for a free system.
+
+**** Mouse gestures
+
+The "mac" port defines the gestures `swipe-left/right/up/down',
+`magnify-up/down', and `rotate-left/right'.
+
+It also binds the magnification commands to change the font
+size.  (This should be not be done in a specific interface, instead
+Emacs should do this binding globally.)
+
+Note: This feature might not be allowed to be implemented until also
+implemented in Emacs for a free system.
+
+**** Synthesize bold fonts
+
+*** Open issues
+
+This section contains issues where there is an ongoing debate.
+
+**** Key bindings of CMD and ALT
+
+Currently in the "ns" port, ALT is bound to Meta and CMD is bound to
+Super -- allowing the user to use typical OS X commands like CMD-A to
+mark everything.
+
+Unfortunately, when using an international keyboard, you can't type
+normal characters like "(" etc.
+
+There are many alternative key bindings.  One solution is to bind CMD
+to Meta and pass ALT to the system.  In fact, this is what Emacs did up
+to, and including, version 22.  Also, this is how the "mac" port binds
+the keys.
+
+One could envision asymmetrical variants as well, however, this is
+inappropriate for the default setting.
+
+See the discussion on emacs-devel:
+https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg01575.html
+https://lists.gnu.org/archive/html/emacs-devel/2016-01/msg00008.html
+
+*** Internal development features
+
+**** Regression test system (or at least a checklist)
+
+Today, after each change to the user interface, Emacs must be manually
+tested.  Often, small details are overlooked ("Oh, I didn't test
+toggling the tool-bar in one of the full screen modes, when multiple
+frame were open -- silly me.")
+
+It would be an enormous help if this could be tested automatically.
+Many features are generic, however, the NS interface provides a number
+of unique features.
+
+**** Existing packages
+
+Note that there is a generic UI test named frame-test.el, see
+http://debbugs.gnu.org/21415#284 .
+The NS interface passes this, with the exception of two toolbar-related errors.
+
+**** Anders frame test
+
+Anders Lindgren <address@hidden> has implemented some (very basic)
+tests for full screen, toolbar, and auto-hiding the menu bar.
+
+**** Make sure all build variants work
+
+Emacs can be build in a number of different ways.  For each feature,
+consider if is really is "NS" specific, or if it should be applied to
+all build versions.
+
+- With the "NS" interface.  This is the normal way to build Emacs on OS X.
+
+- With the "X11" interface.  On OS X, this is mainly of interest to
+  developers of Emacs to get a "reference" interface implementations.
+  However, it might be of interest for people working remotely, as X11
+  applications can be used over a network connection.
+
+- Console only.
+
 *** Bugs
 
+**** Incorrect translation of Super modifier with Ctrl or Meta on OS X
+
+When pressing `M-s-a', Emacs replies "M-s-å is undefined".  What
+happened is a mix of Emacs view that Meta and Super has been pressed,
+and OS X view that ALT-a should yield "å".
+
+The bug reports suggests two different patched, unfortunately, none
+work properly.  For example:
+
+   Use a Swedish keyboard layout
+
+   (setq ns-alternate-modifier nil)
+
+   "CMD-ALT-9"
+
+Today, this correctly yields that s-] is undefined.  With the either
+of the two patches, Emacs responds that s-9 was pressed.
+
+More investigation is needed to fix this problem.
+
+Links:
+- http://debbugs.gnu.org/19977
+- http://debbugs.gnu.org/21330
+- http://debbugs.gnu.org/21551
+
+**** Toggling the toolbar in fullheight or maximized modes
+
+The toolbar, in the NS interface, is not considered part of the text
+area.  When it is toggled, the Emacs frame change height accordingly.
+
+Unfortunately, this also occurs when the frame is in fullheight or
+maximized modes (N.B. this is not the same as "fullscreen").  The
+effect is that the full frame size either increases (stretching down
+below the lower edge of the screen) or decreases (leaving space
+between the lower edge of the frame and the lower edge of the screen).
+
+A better solution would be for the frame to retain its size,
+i.e. change the text area.
+
+This is related to the `frame-inhibit-implied-resize' issue.
+
 **** The event loop does not redraw.
-     A problem is that redraw don't happen during resize,
-     because we can't break out from the NSapp loop during resize.
-     There was a special trick to detect mouse press in the lower right
-     corner and track mouse movements, but this did not work well, and was
-     not scalable to the new Lion "resize on every window edge" behavior.
-     [As of trunk r109635, 2012-08-15, the event loop no longer polls.]
+A problem is that redraw don't happen during resize,
+because we can't break out from the NSapp loop during resize.
+There was a special trick to detect mouse press in the lower right
+corner and track mouse movements, but this did not work well, and was
+not scalable to the new Lion "resize on every window edge" behavior.
+[As of trunk r109635, 2012-08-15, the event loop no longer polls.]
 
 **** (mouse-avoidance-mode 'banish) then minimize Emacs, will pop window back
 up on top of all others (probably fixed in bug#17439)
@@ -1329,3 +1556,7 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;; Local Variables:
+;; coding: utf-8
+;; End:
diff --git a/lib-src/pop.c b/lib-src/pop.c
index 57a5e52..812bd4c 100644
--- a/lib-src/pop.c
+++ b/lib-src/pop.c
@@ -1184,7 +1184,7 @@ socket_connection (char *host, int flags)
            {
              int errlen = err_ret->text.length;
              snprintf (pop_error + pop_error_len, ERROR_MAX - pop_error_len,
-                       " [server says '.*%s']", errlen, err_ret->text.data);
+                       " [server says '%.*s']", errlen, err_ret->text.data);
            }
 #elif defined HAVE_KRB5_ERROR_E_TEXT
          if (err_ret && err_ret->e_text && **err_ret->e_text)
diff --git a/lisp/apropos.el b/lisp/apropos.el
index 3c1a413..eb145bd 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -505,8 +505,9 @@ variables, not just user options."
 ;;;###autoload
 (defun apropos-variable (pattern &optional do-not-all)
   "Show variables that match PATTERN.
-When DO-NOT-ALL is non-nil, show user options only, i.e. behave
-like `apropos-user-option'."
+With the optional argument DO-NOT-ALL non-nil (or when called
+interactively with the prefix \\[universal-argument]), show user
+options only, i.e. behave like `apropos-user-option'."
   (interactive (list (apropos-read-pattern
                      (if current-prefix-arg "user option" "variable"))
                      current-prefix-arg))
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index f30271e..19ff7ab 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -162,8 +162,7 @@ The new mode runs the hook constructed by the function
 See Info node `(elisp)Derived Modes' for more details."
   (declare (debug (&define name symbolp sexp [&optional stringp]
                           [&rest keywordp sexp] def-body))
-          (doc-string 4)
-           (indent 3))
+          (doc-string 4))
 
   (when (and docstring (not (stringp docstring)))
     ;; Some trickiness, since what appears to be the docstring may really be
diff --git a/lisp/leim/quail/latin-pre.el b/lisp/leim/quail/latin-pre.el
index e960ff3..078f9f9 100644
--- a/lisp/leim/quail/latin-pre.el
+++ b/lisp/leim/quail/latin-pre.el
@@ -707,7 +707,7 @@ Key translation rules are:
  "polish-slash" "Polish" "PL>" nil
  "Polish diacritics and slash character are input as `/[acelnosxzACELNOSXZ/]'.
 For example, the character named `aogonek' is obtained by `/a'."
- nil t t t nil nil nil nil nil nil t)
+ nil t t nil nil nil nil nil nil nil t)
 
 (quail-define-rules
  ("//" ?/)
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 85ffc43..fa355ff 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -931,20 +931,29 @@ If MODE is 2 then do the same for lines."
               (= start end)
              (char-after start)
               (= (char-syntax (char-after start)) ?\())
-        (list start
-              (save-excursion
-                (goto-char start)
-                (forward-sexp 1)
-                (point))))
+         (if (/= (syntax-class (syntax-after start)) 4) ; raw syntax code for 
?\(
+             ;; This happens in CC Mode when unbalanced parens in CPP
+             ;; constructs are given punctuation syntax with
+             ;; syntax-table text properties.  (2016-02-21).
+             (signal 'scan-error (list "Containing expression ends prematurely"
+                                       start start))
+           (list start
+                 (save-excursion
+                   (goto-char start)
+                   (forward-sexp 1)
+                   (point)))))
         ((and (= mode 1)
               (= start end)
              (char-after start)
               (= (char-syntax (char-after start)) ?\)))
-        (list (save-excursion
-                (goto-char (1+ start))
-                (backward-sexp 1)
-                (point))
-              (1+ start)))
+         (if (/= (syntax-class (syntax-after start)) 5) ; raw syntax code for 
?\)
+             ;; See above comment about CC Mode.
+             (signal 'scan-error (list "Unbalanced parentheses" start start))
+           (list (save-excursion
+                   (goto-char (1+ start))
+                   (backward-sexp 1)
+                   (point))
+                 (1+ start))))
        ((and (= mode 1)
               (= start end)
              (char-after start)
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 3c3736a..d37b1b3 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -617,6 +617,15 @@ Currently this means either text/html or 
application/xhtml+xml."
          (html-mode))))
     (view-buffer buf)))
 
+(defun eww-toggle-paragraph-direction ()
+  "Toggle the paragraphs direction between left-to-right and right-to-left."
+  (interactive)
+  (setq bidi-paragraph-direction
+        (if (eq bidi-paragraph-direction 'left-to-right)
+            'right-to-left
+          'left-to-right))
+  (message "The paragraph direction is now %s" bidi-paragraph-direction))
+
 (defun eww-readable ()
   "View the main \"readable\" parts of the current web page.
 This command uses heuristics to find the parts of the web page that
@@ -701,6 +710,7 @@ the like."
     (define-key map "s" 'eww-switch-to-buffer)
     (define-key map "S" 'eww-list-buffers)
     (define-key map "F" 'eww-toggle-fonts)
+    (define-key map "D" 'eww-toggle-paragraph-direction)
     (define-key map [(meta C)] 'eww-toggle-colors)
 
     (define-key map "b" 'eww-add-bookmark)
@@ -729,7 +739,8 @@ the like."
        ["List cookies" url-cookie-list t]
        ["Toggle fonts" eww-toggle-fonts t]
        ["Toggle colors" eww-toggle-colors t]
-       ["Character Encoding" eww-set-character-encoding]))
+        ["Character Encoding" eww-set-character-encoding]
+        ["Toggle Paragraph Direction" eww-toggle-paragraph-direction]))
     map))
 
 (defvar eww-tool-bar-map
diff --git a/lisp/saveplace.el b/lisp/saveplace.el
index c27df15..0230279 100644
--- a/lisp/saveplace.el
+++ b/lisp/saveplace.el
@@ -120,6 +120,25 @@ disabled, i.e., the position is recorded for all files."
 
 (declare-function dired-current-directory "dired" (&optional localp))
 
+(defun save-place--setup-hooks (add)
+  (cond
+   (add
+    (add-hook 'find-file-hook #'save-place-find-file-hook t)
+    (add-hook 'dired-initial-position-hook #'save-place-dired-hook)
+    (unless noninteractive
+      (add-hook 'kill-emacs-hook #'save-place-kill-emacs-hook))
+    (add-hook 'kill-buffer-hook #'save-place-to-alist))
+   (t
+    ;; We should remove the hooks, but only if save-place-mode
+    ;; is nil everywhere.  Is it worth the trouble, tho?
+    ;; (unless (or (default-value 'save-place-mode)
+    ;;             (cl-some <save-place-local-mode-p> (buffer-list)))
+    ;;   (remove-hook 'find-file-hook #'save-place-find-file-hook)
+    ;;   (remove-hook 'dired-initial-position-hook #'save-place-dired-hook)
+    ;;   (remove-hook 'kill-emacs-hook #'save-place-kill-emacs-hook)
+    ;;   (remove-hook 'kill-buffer-hook #'save-place-to-alist))
+    )))
+
 (define-obsolete-variable-alias 'save-place 'save-place-mode "25.1")
 ;;;###autoload
 (define-minor-mode save-place-mode
@@ -128,22 +147,14 @@ This means when you visit a file, point goes to the last 
place
 where it was when you previously visited the same file."
   :global t
   :group 'save-place
-  (cond
-   (save-place-mode
-    (add-hook 'find-file-hook 'save-place-find-file-hook t)
-    (add-hook 'dired-initial-position-hook 'save-place-dired-hook)
-    (unless noninteractive
-      (add-hook 'kill-emacs-hook 'save-place-kill-emacs-hook))
-    (add-hook 'kill-buffer-hook 'save-place-to-alist))
-   (t
-    (remove-hook 'find-file-hook 'save-place-find-file-hook t)
-    (remove-hook 'dired-initial-position-hook 'save-place-dired-hook)
-    (remove-hook 'kill-emacs-hook 'save-place-kill-emacs-hook)
-    (remove-hook 'kill-buffer-hook 'save-place-to-alist))))
+  (save-place--setup-hooks save-place-mode))
 
-(make-variable-buffer-local 'save-place-mode) ; Hysterical raisins.
+(make-variable-buffer-local 'save-place-mode)
 
-(defun toggle-save-place (&optional parg) ;FIXME: save-place-local-mode!
+(define-obsolete-function-alias 'toggle-save-place
+  #'save-place-local-mode "25.1")
+;;;###autoload
+(define-minor-mode save-place-local-mode
   "Toggle whether to save your place in this file between sessions.
 If this mode is enabled, point is recorded when you kill the buffer
 or exit Emacs.  Visiting this file again will go to that position,
@@ -156,18 +167,13 @@ To save places automatically in all files, put this in 
your init
 file:
 
 \(save-place-mode 1)"
-  (interactive "P")
+  :variable save-place-mode
   (if (not (or buffer-file-name (and (derived-mode-p 'dired-mode)
                                      (boundp 'dired-subdir-alist)
                                     dired-subdir-alist
                                     (dired-current-directory))))
       (message "Buffer `%s' not visiting a file or directory" (buffer-name))
-    (setq save-place (if parg
-                         (> (prefix-numeric-value parg) 0)
-                       (not save-place)))
-    (message (if save-place
-                 "Place will be saved"
-               "No place will be saved in this file"))))
+    (save-place--setup-hooks save-place-mode)))
 
 (declare-function dired-get-filename "dired" (&optional localp 
no-error-if-not-filep))
 
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 1686c02..9920fa0 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -489,19 +489,26 @@ looks like an email address, \"ftp://\"; if it starts with
 (defun thing-at-point-looking-at (regexp &optional distance)
   "Return non-nil if point is in or just after a match for REGEXP.
 Set the match data from the earliest such match ending at or after
-point."
+point.
+
+Optional argument DISTANCE limits search for REGEXP forward and
+back from point."
   (save-excursion
     (let ((old-point (point))
          (forward-bound (and distance (+ (point) distance)))
          (backward-bound (and distance (- (point) distance)))
-         match)
+         match prev-pos new-pos)
       (and (looking-at regexp)
           (>= (match-end 0) old-point)
           (setq match (point)))
       ;; Search back repeatedly from end of next match.
       ;; This may fail if next match ends before this match does.
       (re-search-forward regexp forward-bound 'limit)
-      (while (and (re-search-backward regexp backward-bound t)
+      (setq prev-pos (point))
+      (while (and (setq new-pos (re-search-backward regexp backward-bound t))
+                  ;; Avoid inflooping with some regexps, such as "^",
+                  ;; matching which never moves point.
+                  (< new-pos prev-pos)
                  (or (> (match-beginning 0) old-point)
                      (and (looking-at regexp)  ; Extend match-end past search 
start
                           (>= (match-end 0) old-point)
diff --git a/nextstep/README b/nextstep/README
index 7724afa..026a048 100644
--- a/nextstep/README
+++ b/nextstep/README
@@ -101,5 +101,5 @@ interface.
 
 The INSTALL file in this directory for compilation instructions.
 
-The WISHLIST file in this directory for a list of ideas for future
-development of the NS interface.
+The Nextstep section in the etc/TODO file for a list of ideas for
+future development.
diff --git a/nextstep/WISHLIST b/nextstep/WISHLIST
deleted file mode 100644
index 1c4b9e2..0000000
--- a/nextstep/WISHLIST
+++ /dev/null
@@ -1,247 +0,0 @@
-                            -*- org -*-
-
-  Wish list for the "NS" OS X Emacs port
-  --------------------------------------
-
-    Note: This document is written using "org-mode", a plain-text
-    format supporting outlines.  To expand a heading, press TAB.  To
-    expand all headings and subheadings, press S-TAB until Emacs
-    responds "SHOW ALL".
-
-* Introduction
-
-This is a wishlist for future development of the "NS" Emacs user
-interface whose primary use is the official Emacs version on OS X.
-
-This list should be seen as a complement to the bug- and wishlist on
-[[http://debbugs.gnu.org/cgi/pkgreport.cgi?package%3Demacs][debbugs]], the 
Emacs bug tracker.
-
-* Missing features
-
-This sections contains features found in other official Emacs ports.
-
-** Support for "xwidget"
-
-Emacs 25 has support for "xwidgets", a system to include operating
-system components into an Emacs buffer.  The components range from
-simple buttons to "webkit" (effectively, a web browser).
-
-Currently, "xwidget" only works for the "gtk+" framework but it is
-designed to be compatible with multiple Emacs ports.
-
-** Respect `frame-inhibit-implied-resize'
-
-When the variable `frame-inhibit-implied-resize' is non-nil, frames
-should not be resized when operations like changing font or toggling
-the tool bar is performed.
-
-Unfortunately, the tool bar (and possible other operations) always
-resize the frame.
-
-** Support `proced' (implement `process-attributes')
-
-Unfortunately, a user-level process like Emacs does not have the
-privileges to get information about other processes under OS X.
-
-There are other ways to do this:
-
- 1) Spawn "ps" and parse the output ("ps" has superuser privileges).
-
- 2) Sign Emacs as part of the distribution process.
-
- 3) Ask the user to self-sign Emacs, if this feature is of interest.
-
-Anders Lindgren <address@hidden> has implemented
-`process-attributes' for OS X -- which currently only work when
-running Emacs as root.
-
-[[http://emacsredux.com/blog/2013/05/02/manage-processes-with-proced/][See 
this article by Bozhidar Batsov for an overview of Proced.]]
-
-** Tooltip properties
-
-Tooltip properties like the background color and font are hard wired,
-even though Emacs allow a user to customize such features.
-
-* New features
-
-This section contains features unique to the NS and/or OS X.
-
-** PressAndHold for writing accented character
-
-On OS X, many application supports the press and hold pattern to
-invoke a menu of accented characters. (See example at 
[[https://support.apple.com/en-us/HT201586][Apple]].)
-
-Currently, this doesn't work in Emacs.
-
-Note that "ns-win.el" explicitly disables this.
-
-Note: This feature might not be allowed to be implemented until also
-implemented in Emacs for a free system.
-
-** Floating scroll bars
-
-In modern OS X applications, the scroll bar often float over the
-content, and is invisible unless actually used.  This makes user
-interface less cluttered and more area could be used to contain text.
-
-With floating scroll bars, the user interface would look like it does
-when they are disabled today.  However, they will be made visible when
-a scroll action is initiated, e.g. by putting two fingers on a
-trackpad.
-
-Note: This feature might not be allowed to be implemented until also
-implemented in Emacs for a free system.
-
-* Features from the "mac" port
-
-This section contains features available in the "mac" Emacs port.
-
-As the "mac" port (as of this writing) isn't an official Emacs port,
-it might contain features not following the FSF rule "must exist on
-free systems".
-
-The "mac" port is based on the Emacs 22 C-based Carbon interface. It
-has been maintained in parallel to the official Cocoa-based NS
-interface. The Carbon interface has been enhanced, and a number of the
-features of that interface could be implemented NS.
-
-** Smooth scrolling -- maybe not a good idea
-
-Today, by default, scrolling with a trackpad makes the text move in
-steps of five lines. (Scrolling with SHIFT scrolls one line at a
-time.)
-
-The "mac" port provides smooth, pixel-based, scrolling.  This is a very
-popular features.  However, there are drawbacks to this method: what
-happens if only a fraction of a line is visible at the top of a
-window, is the partially visible text considered part of the window or
-not? (Technically, what should `window-start' return.)
-
-An alternative would be to make one-line scrolling the default on NS
-(or in Emacs in general).
-
-Note: This feature might not be allowed to be implemented until also
-implemented in Emacs for a free system.
-
-** Mouse gestures
-
-The "mac" port defines the gestures `swipe-left/right/up/down',
-`magnify-up/down', and `rotate-left/right'.
-
-It also binds the magnification commands to change the font
-size. (This should be not be done in a specific interface, instead
-Emacs should do this binding globally.)
-
-Note: This feature might not be allowed to be implemented until also
-implemented in Emacs for a free system.
-
-** Synthesize bold fonts
-
-* Open issues
-
-This section contains issues where there is an ongoing debate.
-
-** Key bindings of CMD and ALT
-
-Currently in the "ns" port, ALT is bound to Meta and CMD is bound to
-Super -- allowing the user to use typical OS X commands like CMD-A to
-mark everything.
-
-Unfortunately, when using an international keyboard, you can't type
-normal characters like "(" etc.
-
-There are many alternative key bindings. One solution is to bind CMD
-to Meta and pass ALT to the system.  In fact, this is what Emacs did up
-to, and including, version 22.  Also, this is how the "mac" port binds
-the keys.
-
-One could envision asymmetrical variants as well, however, this is
-inappropriate for the default setting.
-
-See the discussion on emacs-devel 
[[https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg01575.html][part 
1]] and 
[[https://lists.gnu.org/archive/html/emacs-devel/2016-01/msg00008.html][part 
2]].
-
-* Bugs
-
-This sections contains a small selection of bugs which are hard to
-fix.  For other bugs, see the official bug tracker debbugs.gnu.org.
-
-** Incorrect translation of Super modifier with Ctrl or Meta on OS X
-
-When pressing `M-s-a', Emacs replies "M-s-å is undefined".  What
-happened is a mix of Emacs view that Meta and Super has been pressed,
-and OS X view that ALT-a should yield "å".
-
-The bug reports suggests two different patched, unfortunately, none
-work properly.  For example:
-
-   Use a Swedish keyboard layout
-
-   (setq ns-alternate-modifier nil)
-
-   "CMD-ALT-9"
-
-Today, this correctly yields that s-] is undefined.  With the either
-of the two patches, Emacs responds that s-9 was pressed.
-
-More investigation is needed to fix this problem.
-
-Links:
-- [[http://debbugs.gnu.org/cgi/bugreport.cgi?bug%3D19977][bug#19977]]
-- [[http://debbugs.gnu.org/cgi/bugreport.cgi?bug%3D21330][bug#21330]]
-- [[http://debbugs.gnu.org/cgi/bugreport.cgi?bug%3D21551][bug#21551]]
-
-** Toggline the toolbar in fullheight or maximized modes
-
-The toolbar, in the NS interface, is not considered part of the text
-area.  When it is toggled, the Emacs frame change height accordingly.
-
-Unfortunately, this also occurs when the frame is in fullheight or
-maximized modes (N.B. this is not the same as "fullscreen").  The
-effect is that the full frame size either increases (stretching down
-below the lower edge of the screen) or decreases (leaving space
-between the lower edge of the frame and the lower edge of the screen).
-
-A better solution would be for the frame to retain its size,
-i.e. change the text area.
-
-This is related to the `frame-inhibit-implied-resize' issue.
-
-* Internal development features
-
-** Regression test system (or at least a checklist)
-
-Today, after each change to the user interface, Emacs must be manually
-tested.  Often, small details are overlooked ("Oh, I didn't test
-toggling the tool-bar in one of the full screen modes, when multiple
-frame were open -- silly me.")
-
-It would be an enormous help if this could be tested automatically.
-Many features are generic, however, the NS interface provides a number
-of unique features.
-
-*** Existing packages
-
-Note that there is a generic UI test named 
"[[http://debbugs.gnu.org/cgi/bugreport.cgi?bug%3D21415#284][frame-test.el]]";.  
The NS
-interface pass this, with the exception of two toolbar related
-errors.
-
-*** Anders frame test
-
-Anders Lindgren <address@hidden> has implemented some (very basic)
-tests for full screen, toolbar, and auto-hiding the menu bar.
-
-** Make sure all build variants work
-
-Emacs can be build in a number of different ways.  For each feature,
-consider if is really is "NS" specific, or if it should be applied to
-all build versions.
-
-- With the "NS" interface.  This is the normal way to build Emacs on
-  OS X.
-
-- With the "X11" interface.  On OS X, this is mainly of interest to
-  developers of Emacs to get a "reference" interface implementations.
-  However, it might be of interest for people working remotely, as X11
-  applications can be used over a network connection.
-
-- Console only.
diff --git a/src/dispextern.h b/src/dispextern.h
index 7d7d730..00667c5 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1973,8 +1973,8 @@ struct bidi_it {
                                   resolving weak and neutral types */
   bidi_type_t type_after_wn;   /* bidi type after overrides and Wn */
   bidi_type_t orig_type;       /* original bidi type, as found in the buffer */
-  char resolved_level;         /* final resolved level of this character */
-  char isolate_level;          /* count of isolate initiators unmatched by PDI 
*/
+  signed char resolved_level;  /* final resolved level of this character */
+  signed char isolate_level;   /* count of isolate initiators unmatched by PDI 
*/
   ptrdiff_t invalid_levels;    /* how many PDFs to ignore */
   ptrdiff_t invalid_isolates;  /* how many PDIs to ignore */
   struct bidi_saved_info prev; /* info about previous character */
diff --git a/src/dispnew.c b/src/dispnew.c
index b05356a..a9f06eb 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -681,7 +681,9 @@ void
 clear_glyph_matrix_rows (struct glyph_matrix *matrix, int start, int end)
 {
   eassert (start <= end);
-  eassert (start >= 0 && start <= matrix->nrows);
+  eassert (start >= 0 && (start < matrix->nrows
+                         /* matrix->nrows can be 0 for the initial frame.  */
+                         || (matrix->nrows == 0)));
   eassert (end >= 0 && end <= matrix->nrows);
 
   for (; start < end; ++start)
diff --git a/src/keyboard.c b/src/keyboard.c
index 6535e04..4e1ac15 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -427,6 +427,15 @@ kset_system_key_syms (struct kboard *kb, Lisp_Object val)
 }
 
 
+static bool
+echo_keystrokes_p (void)
+{
+  return (!cursor_in_echo_area)
+        && (FLOATP (Vecho_keystrokes) ? XFLOAT_DATA (Vecho_keystrokes) > 0.0
+            : INTEGERP (Vecho_keystrokes) ? XINT (Vecho_keystrokes) > 0
+             : false);
+}
+
 /* Add C to the echo string, without echoing it immediately.  C can be
    a character, which is pretty-printed, or a symbol, whose name is
    printed.  */
@@ -568,7 +577,9 @@ echo_update (void)
 static void
 echo_now (void)
 {
-  if (!current_kboard->immediate_echo)
+  if (!current_kboard->immediate_echo
+      /* This test breaks calls that use `echo_now' to display the echo_prompt.
+         && echo_keystrokes_p () */)
     {
       current_kboard->immediate_echo = true;
       echo_update ();
@@ -2270,13 +2281,6 @@ read_decoded_event_from_main_queue (struct timespec 
*end_time,
     }
 }
 
-static bool
-echo_keystrokes_p (void)
-{
-  return (FLOATP (Vecho_keystrokes) ? XFLOAT_DATA (Vecho_keystrokes) > 0.0
-         : INTEGERP (Vecho_keystrokes) ? XINT (Vecho_keystrokes) > 0 : false);
-}
-
 /* Read a character from the keyboard; call the redisplay if needed.  */
 /* commandflag 0 means do not autosave, but do redisplay.
    -1 means do not redisplay, but do autosave.
@@ -8889,11 +8893,15 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, 
Lisp_Object prompt,
             of echoing, so that it serves as a prompt for the next
             character.  */
          kset_echo_prompt (current_kboard, prompt);
+          /* FIXME: This use of echo_now doesn't look quite right and is ugly
+             since it forces us to fiddle with current_kboard->immediate_echo
+             before and after.  */
          current_kboard->immediate_echo = false;
          echo_now ();
+          if (!echo_keystrokes_p ())
+           current_kboard->immediate_echo = false;
        }
-      else if (cursor_in_echo_area
-              && echo_keystrokes_p ())
+      else if (echo_keystrokes_p ())
        /* This doesn't put in a dash if the echo buffer is empty, so
           you don't always see a dash hanging out in the minibuffer.  */
        echo_dash ();
diff --git a/src/xdisp.c b/src/xdisp.c
index acb2754..b9d496e 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -11232,6 +11232,7 @@ clear_garbaged_frames (void)
   if (frame_garbaged)
     {
       Lisp_Object tail, frame;
+      struct frame *sf = SELECTED_FRAME ();
 
       FOR_EACH_FRAME (tail, frame)
        {
@@ -11239,7 +11240,13 @@ clear_garbaged_frames (void)
 
          if (FRAME_VISIBLE_P (f) && FRAME_GARBAGED_P (f))
            {
-             if (f->resized_p)
+             if (f->resized_p
+                 /* It makes no sense to redraw a non-selected TTY
+                    frame, since that will actually clear the
+                    selected frame, and might leave the selected
+                    frame with corrupted display, if it happens not
+                    to be marked garbaged.  */
+                 && !(f != sf && (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))))
                redraw_frame (f);
              else
                clear_current_matrices (f);
diff --git a/src/xftfont.c b/src/xftfont.c
index 110f99a..d94955f 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -395,16 +395,6 @@ xftfont_open (struct frame *f, Lisp_Object entity, int 
pixel_size)
 
   font->ascent = xftfont->ascent;
   font->descent = xftfont->descent;
-  if (pixel_size >= 5)
-    {
-      /* The above condition is a dirty workaround because
-        XftTextExtents8 behaves strangely for some fonts
-        (e.g. "Dejavu Sans Mono") when pixel_size is less than 5. */
-      if (font->ascent < extents.y)
-       font->ascent = extents.y;
-      if (font->descent < extents.height - extents.y)
-       font->descent = extents.height - extents.y;
-    }
   font->height = font->ascent + font->descent;
 
   if (XINT (AREF (entity, FONT_SIZE_INDEX)) == 0)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]