aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Wiegley2016-03-03 23:53:08 -0800
committerJohn Wiegley2016-03-03 23:53:08 -0800
commit692caf1e8d1657fbe4809294df6791c2879a7bb1 (patch)
tree0c6357b6325adbf0d675851d7a655ce9636b51e7
parent018bdf7528d0d4bb0560d86b84c21ae9fed1206a (diff)
parentb13cab683c6060e002906fc944680aaa5f4ac123 (diff)
downloademacs-692caf1e8d1657fbe4809294df6791c2879a7bb1.tar.gz
emacs-692caf1e8d1657fbe4809294df6791c2879a7bb1.zip
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)
-rw-r--r--doc/misc/eww.texi8
-rw-r--r--etc/NEWS19
-rw-r--r--etc/PROBLEMS10
-rw-r--r--etc/TODO243
-rw-r--r--lib-src/pop.c2
-rw-r--r--lisp/apropos.el5
-rw-r--r--lisp/emacs-lisp/derived.el3
-rw-r--r--lisp/leim/quail/latin-pre.el2
-rw-r--r--lisp/mouse.el29
-rw-r--r--lisp/net/eww.el13
-rw-r--r--lisp/saveplace.el48
-rw-r--r--lisp/thingatpt.el13
-rw-r--r--nextstep/README4
-rw-r--r--nextstep/WISHLIST247
-rw-r--r--src/dispextern.h4
-rw-r--r--src/dispnew.c4
-rw-r--r--src/keyboard.c28
-rw-r--r--src/xdisp.c9
-rw-r--r--src/xftfont.c10
19 files changed, 374 insertions, 327 deletions
diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi
index afb1cafb744..f15e2f2518e 100644
--- a/doc/misc/eww.texi
+++ b/doc/misc/eww.texi
@@ -216,6 +216,14 @@ For details about the Cookie handling @xref{Cookies,,,url}.
216@code{eww-header-line-format}. The format replaces @code{%t} with the 216@code{eww-header-line-format}. The format replaces @code{%t} with the
217title of the website and @code{%u} with the URL. 217title of the website and @code{%u} with the URL.
218 218
219@findex eww-toggle-paragraph-direction
220@cindex paragraph direction
221 The @kbd{D} command (@code{eww-toggle-paragraph-direction}) toggles
222the paragraphs direction between left-to-right and right-to-left
223text. This can be useful on web pages that display right-to-left test
224(like Arabic and Hebrew), but where the web pages don't explicitly
225state the directionality.
226
219@c @vindex shr-bullet 227@c @vindex shr-bullet
220@c @vindex shr-hr-line 228@c @vindex shr-hr-line
221@c @vindex eww-form-checkbox-selected-symbol 229@c @vindex eww-form-checkbox-selected-symbol
diff --git a/etc/NEWS b/etc/NEWS
index 8c7f4942ac5..8725049779d 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -588,13 +588,14 @@ additionally need to add `getSelection' to `xterm-extra-capabilities'.
588*** `xterm-mouse-mode' now supports mouse-tracking (if your xterm supports it). 588*** `xterm-mouse-mode' now supports mouse-tracking (if your xterm supports it).
589 589
590--- 590---
591** To turn on `save-place' mode globally, you must call `(save-place-mode 1)'. 591** The way to turn on and off `save-place' mode has changed.
592In order to have the last place in every file saved it is no longer 592It is no longer sufficient to load the saveplace library and set
593sufficient to load the saveplace library and set the default value of 593`save-place' non-nil. Instead, use the two new minor modes:
594`save-place' to non-nil. You must explicitly call the function 594`save-place-mode' turns on saving last place in every file, and
595`save-place-mode' with a positive argument instead. The `save-place' 595`save-place-local-mode' does that only for the file in whose buffer it
596variable is now an obsolete alias for `save-place-mode', which 596is invoked. The `save-place' variable is now an obsolete alias for
597replaces it. 597`save-place-mode', which replaces it, and `toggle-save-place' is an
598obsolete alias for the new `save-place-local-mode' command.
598 599
599** ERC 600** ERC
600 601
@@ -865,6 +866,10 @@ customize the `shr-use-colors' variable.
865textual parts of a web page and display only that, leaving menus and 866textual parts of a web page and display only that, leaving menus and
866the like off the page. 867the like off the page.
867 868
869+++
870*** A new command `D' (`eww-toggle-paragraph-direction') allows you to
871toggle the paragraph direction between left-to-right and right-to-left.
872
868--- 873---
869*** Images that are being loaded are now marked with grey 874*** Images that are being loaded are now marked with grey
870"placeholder" images of the size specified by the HTML. They are then 875"placeholder" images of the size specified by the HTML. They are then
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 7d780371d46..0491935b10c 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -600,6 +600,16 @@ you have a personal configuration file (normally ~/.aspell.conf), it
600can cause this error. Remove that file, execute 'ispell-kill-ispell' 600can cause this error. Remove that file, execute 'ispell-kill-ispell'
601in Emacs, and then try spell-checking again. 601in Emacs, and then try spell-checking again.
602 602
603*** Emacs eats all file descriptors when using kqueue file notifications.
604
605When you have a large number of buffers running auto-revert-mode, and
606Emacs is configured to use the kqueue file notification library, it
607uses an own file descriptor for every watched file. On systems with a
608small limit of file descriptors allowed per process, like OS X, you
609could run out of file descriptors. You won't be able to open new files.
610
611Set auto-revert-use-notify to nil in order to avoid this problem.
612
603* Runtime problems related to font handling 613* Runtime problems related to font handling
604 614
605** Characters are displayed as empty boxes or with wrong font under X. 615** Characters are displayed as empty boxes or with wrong font under X.
diff --git a/etc/TODO b/etc/TODO
index 590d233fef7..39ebef3fe02 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -675,15 +675,242 @@ from the emacsclient process.
675 675
676** NeXTstep port 676** NeXTstep port
677 677
678*** Missing features
679
680This sections contains features found in other official Emacs ports.
681
682**** Support for "xwidget"
683
684Emacs 25 has support for "xwidgets", a system to include operating
685system components into an Emacs buffer. The components range from
686simple buttons to "webkit" (effectively, a web browser).
687
688Currently, "xwidget" only works for the "gtk+" framework but it is
689designed to be compatible with multiple Emacs ports.
690
691**** Respect `frame-inhibit-implied-resize'
692
693When the variable `frame-inhibit-implied-resize' is non-nil, frames
694should not be resized when operations like changing font or toggling
695the tool bar is performed.
696
697Unfortunately, the tool bar (and possible other operations) always
698resize the frame.
699
700**** Support `proced' (implement `process-attributes')
701
702Unfortunately, a user-level process like Emacs does not have the
703privileges to get information about other processes under OS X.
704
705There are other ways to do this:
706
707 1) Spawn "ps" and parse the output ("ps" has superuser privileges).
708
709 2) Sign Emacs as part of the distribution process.
710
711 3) Ask the user to self-sign Emacs, if this feature is of interest.
712
713Anders Lindgren <andlind@gmail.com> has implemented
714`process-attributes' for OS X, which currently only work when
715running Emacs as root.
716
717See this article by Bozhidar Batsov for an overview of Proced:
718http://emacsredux.com/blog/2013/05/02/manage-processes-with-proced/
719
720**** Tooltip properties
721
722Tooltip properties like the background color and font are hard-wired,
723even though Emacs allows a user to customize such features.
724
725*** New features
726
727This section contains features unique to Nextstep and/or OS X.
728
729**** PressAndHold for writing accented character
730
731On OS X, many application support the press and hold pattern to
732invoke a menu of accented characters. (See example at
733https://support.apple.com/en-us/HT201586 .)
734
735Currently, this doesn't work in Emacs.
736
737Note that "ns-win.el" explicitly disables this.
738
739Note: This feature might not be allowed to be implemented until also
740implemented in Emacs for a free system.
741
742**** Floating scroll bars
743
744In modern OS X applications, the scroll bar often floats over the
745content, and is invisible unless actually used. This makes the user
746interface less cluttered and more area could be used to contain text.
747
748With floating scroll bars, the user interface would look like it does
749when they are disabled today. However, they will be made visible when
750a scroll action is initiated, e.g. by putting two fingers on a
751trackpad.
752
753Note: This feature might not be allowed to be implemented until also
754implemented in Emacs for a free system.
755
756*** Features from the "mac" port
757
758This section contains features available in the "mac" Emacs port.
759
760As the "mac" port (as of this writing) isn't an official Emacs port,
761it might contain features not following the FSF rule "must exist on
762free systems".
763
764The "mac" port is based on the Emacs 22 C-based Carbon interface.
765It has been maintained in parallel to the official Cocoa-based NS
766interface. The Carbon interface has been enhanced, and a number of the
767features of that interface could be implemented NS.
768
769**** Smooth scrolling -- maybe not a good idea
770
771Today, by default, scrolling with a trackpad makes the text move in
772steps of five lines. (Scrolling with SHIFT scrolls one line at a time.)
773
774The "mac" port provides smooth, pixel-based, scrolling. This is a very
775popular features. However, there are drawbacks to this method: what
776happens if only a fraction of a line is visible at the top of a
777window, is the partially visible text considered part of the window or
778not? (Technically, what should `window-start' return.)
779
780An alternative would be to make one-line scrolling the default on NS
781(or in Emacs in general).
782
783Note: This feature might not be allowed to be implemented until also
784implemented in Emacs for a free system.
785
786**** Mouse gestures
787
788The "mac" port defines the gestures `swipe-left/right/up/down',
789`magnify-up/down', and `rotate-left/right'.
790
791It also binds the magnification commands to change the font
792size. (This should be not be done in a specific interface, instead
793Emacs should do this binding globally.)
794
795Note: This feature might not be allowed to be implemented until also
796implemented in Emacs for a free system.
797
798**** Synthesize bold fonts
799
800*** Open issues
801
802This section contains issues where there is an ongoing debate.
803
804**** Key bindings of CMD and ALT
805
806Currently in the "ns" port, ALT is bound to Meta and CMD is bound to
807Super -- allowing the user to use typical OS X commands like CMD-A to
808mark everything.
809
810Unfortunately, when using an international keyboard, you can't type
811normal characters like "(" etc.
812
813There are many alternative key bindings. One solution is to bind CMD
814to Meta and pass ALT to the system. In fact, this is what Emacs did up
815to, and including, version 22. Also, this is how the "mac" port binds
816the keys.
817
818One could envision asymmetrical variants as well, however, this is
819inappropriate for the default setting.
820
821See the discussion on emacs-devel:
822https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg01575.html
823https://lists.gnu.org/archive/html/emacs-devel/2016-01/msg00008.html
824
825*** Internal development features
826
827**** Regression test system (or at least a checklist)
828
829Today, after each change to the user interface, Emacs must be manually
830tested. Often, small details are overlooked ("Oh, I didn't test
831toggling the tool-bar in one of the full screen modes, when multiple
832frame were open -- silly me.")
833
834It would be an enormous help if this could be tested automatically.
835Many features are generic, however, the NS interface provides a number
836of unique features.
837
838**** Existing packages
839
840Note that there is a generic UI test named frame-test.el, see
841http://debbugs.gnu.org/21415#284 .
842The NS interface passes this, with the exception of two toolbar-related errors.
843
844**** Anders frame test
845
846Anders Lindgren <andlind@gmail.com> has implemented some (very basic)
847tests for full screen, toolbar, and auto-hiding the menu bar.
848
849**** Make sure all build variants work
850
851Emacs can be build in a number of different ways. For each feature,
852consider if is really is "NS" specific, or if it should be applied to
853all build versions.
854
855- With the "NS" interface. This is the normal way to build Emacs on OS X.
856
857- With the "X11" interface. On OS X, this is mainly of interest to
858 developers of Emacs to get a "reference" interface implementations.
859 However, it might be of interest for people working remotely, as X11
860 applications can be used over a network connection.
861
862- Console only.
863
678*** Bugs 864*** Bugs
679 865
866**** Incorrect translation of Super modifier with Ctrl or Meta on OS X
867
868When pressing `M-s-a', Emacs replies "M-s-å is undefined". What
869happened is a mix of Emacs view that Meta and Super has been pressed,
870and OS X view that ALT-a should yield "å".
871
872The bug reports suggests two different patched, unfortunately, none
873work properly. For example:
874
875 Use a Swedish keyboard layout
876
877 (setq ns-alternate-modifier nil)
878
879 "CMD-ALT-9"
880
881Today, this correctly yields that s-] is undefined. With the either
882of the two patches, Emacs responds that s-9 was pressed.
883
884More investigation is needed to fix this problem.
885
886Links:
887- http://debbugs.gnu.org/19977
888- http://debbugs.gnu.org/21330
889- http://debbugs.gnu.org/21551
890
891**** Toggling the toolbar in fullheight or maximized modes
892
893The toolbar, in the NS interface, is not considered part of the text
894area. When it is toggled, the Emacs frame change height accordingly.
895
896Unfortunately, this also occurs when the frame is in fullheight or
897maximized modes (N.B. this is not the same as "fullscreen"). The
898effect is that the full frame size either increases (stretching down
899below the lower edge of the screen) or decreases (leaving space
900between the lower edge of the frame and the lower edge of the screen).
901
902A better solution would be for the frame to retain its size,
903i.e. change the text area.
904
905This is related to the `frame-inhibit-implied-resize' issue.
906
680**** The event loop does not redraw. 907**** The event loop does not redraw.
681 A problem is that redraw don't happen during resize, 908A problem is that redraw don't happen during resize,
682 because we can't break out from the NSapp loop during resize. 909because we can't break out from the NSapp loop during resize.
683 There was a special trick to detect mouse press in the lower right 910There was a special trick to detect mouse press in the lower right
684 corner and track mouse movements, but this did not work well, and was 911corner and track mouse movements, but this did not work well, and was
685 not scalable to the new Lion "resize on every window edge" behavior. 912not scalable to the new Lion "resize on every window edge" behavior.
686 [As of trunk r109635, 2012-08-15, the event loop no longer polls.] 913[As of trunk r109635, 2012-08-15, the event loop no longer polls.]
687 914
688**** (mouse-avoidance-mode 'banish) then minimize Emacs, will pop window back 915**** (mouse-avoidance-mode 'banish) then minimize Emacs, will pop window back
689up on top of all others (probably fixed in bug#17439) 916up on top of all others (probably fixed in bug#17439)
@@ -1329,3 +1556,7 @@ GNU General Public License for more details.
1329 1556
1330You should have received a copy of the GNU General Public License 1557You should have received a copy of the GNU General Public License
1331along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. 1558along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
1559
1560;; Local Variables:
1561;; coding: utf-8
1562;; End:
diff --git a/lib-src/pop.c b/lib-src/pop.c
index 57a5e529daf..812bd4ca24c 100644
--- a/lib-src/pop.c
+++ b/lib-src/pop.c
@@ -1184,7 +1184,7 @@ socket_connection (char *host, int flags)
1184 { 1184 {
1185 int errlen = err_ret->text.length; 1185 int errlen = err_ret->text.length;
1186 snprintf (pop_error + pop_error_len, ERROR_MAX - pop_error_len, 1186 snprintf (pop_error + pop_error_len, ERROR_MAX - pop_error_len,
1187 " [server says '.*%s']", errlen, err_ret->text.data); 1187 " [server says '%.*s']", errlen, err_ret->text.data);
1188 } 1188 }
1189#elif defined HAVE_KRB5_ERROR_E_TEXT 1189#elif defined HAVE_KRB5_ERROR_E_TEXT
1190 if (err_ret && err_ret->e_text && **err_ret->e_text) 1190 if (err_ret && err_ret->e_text && **err_ret->e_text)
diff --git a/lisp/apropos.el b/lisp/apropos.el
index 3c1a4136fbf..eb145bdc571 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -505,8 +505,9 @@ variables, not just user options."
505;;;###autoload 505;;;###autoload
506(defun apropos-variable (pattern &optional do-not-all) 506(defun apropos-variable (pattern &optional do-not-all)
507 "Show variables that match PATTERN. 507 "Show variables that match PATTERN.
508When DO-NOT-ALL is non-nil, show user options only, i.e. behave 508With the optional argument DO-NOT-ALL non-nil (or when called
509like `apropos-user-option'." 509interactively with the prefix \\[universal-argument]), show user
510options only, i.e. behave like `apropos-user-option'."
510 (interactive (list (apropos-read-pattern 511 (interactive (list (apropos-read-pattern
511 (if current-prefix-arg "user option" "variable")) 512 (if current-prefix-arg "user option" "variable"))
512 current-prefix-arg)) 513 current-prefix-arg))
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index f30271e15fc..19ff7abda39 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
162See Info node `(elisp)Derived Modes' for more details." 162See Info node `(elisp)Derived Modes' for more details."
163 (declare (debug (&define name symbolp sexp [&optional stringp] 163 (declare (debug (&define name symbolp sexp [&optional stringp]
164 [&rest keywordp sexp] def-body)) 164 [&rest keywordp sexp] def-body))
165 (doc-string 4) 165 (doc-string 4))
166 (indent 3))
167 166
168 (when (and docstring (not (stringp docstring))) 167 (when (and docstring (not (stringp docstring)))
169 ;; Some trickiness, since what appears to be the docstring may really be 168 ;; 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 e960ff32c79..078f9f99fab 100644
--- a/lisp/leim/quail/latin-pre.el
+++ b/lisp/leim/quail/latin-pre.el
@@ -707,7 +707,7 @@ Key translation rules are:
707 "polish-slash" "Polish" "PL>" nil 707 "polish-slash" "Polish" "PL>" nil
708 "Polish diacritics and slash character are input as `/[acelnosxzACELNOSXZ/]'. 708 "Polish diacritics and slash character are input as `/[acelnosxzACELNOSXZ/]'.
709For example, the character named `aogonek' is obtained by `/a'." 709For example, the character named `aogonek' is obtained by `/a'."
710 nil t t t nil nil nil nil nil nil t) 710 nil t t nil nil nil nil nil nil nil t)
711 711
712(quail-define-rules 712(quail-define-rules
713 ("//" ?/) 713 ("//" ?/)
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 85ffc43d0dc..fa355ffeb71 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -931,20 +931,29 @@ If MODE is 2 then do the same for lines."
931 (= start end) 931 (= start end)
932 (char-after start) 932 (char-after start)
933 (= (char-syntax (char-after start)) ?\()) 933 (= (char-syntax (char-after start)) ?\())
934 (list start 934 (if (/= (syntax-class (syntax-after start)) 4) ; raw syntax code for ?\(
935 (save-excursion 935 ;; This happens in CC Mode when unbalanced parens in CPP
936 (goto-char start) 936 ;; constructs are given punctuation syntax with
937 (forward-sexp 1) 937 ;; syntax-table text properties. (2016-02-21).
938 (point)))) 938 (signal 'scan-error (list "Containing expression ends prematurely"
939 start start))
940 (list start
941 (save-excursion
942 (goto-char start)
943 (forward-sexp 1)
944 (point)))))
939 ((and (= mode 1) 945 ((and (= mode 1)
940 (= start end) 946 (= start end)
941 (char-after start) 947 (char-after start)
942 (= (char-syntax (char-after start)) ?\))) 948 (= (char-syntax (char-after start)) ?\)))
943 (list (save-excursion 949 (if (/= (syntax-class (syntax-after start)) 5) ; raw syntax code for ?\)
944 (goto-char (1+ start)) 950 ;; See above comment about CC Mode.
945 (backward-sexp 1) 951 (signal 'scan-error (list "Unbalanced parentheses" start start))
946 (point)) 952 (list (save-excursion
947 (1+ start))) 953 (goto-char (1+ start))
954 (backward-sexp 1)
955 (point))
956 (1+ start))))
948 ((and (= mode 1) 957 ((and (= mode 1)
949 (= start end) 958 (= start end)
950 (char-after start) 959 (char-after start)
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 3c3736ac376..d37b1b3261b 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."
617 (html-mode)))) 617 (html-mode))))
618 (view-buffer buf))) 618 (view-buffer buf)))
619 619
620(defun eww-toggle-paragraph-direction ()
621 "Toggle the paragraphs direction between left-to-right and right-to-left."
622 (interactive)
623 (setq bidi-paragraph-direction
624 (if (eq bidi-paragraph-direction 'left-to-right)
625 'right-to-left
626 'left-to-right))
627 (message "The paragraph direction is now %s" bidi-paragraph-direction))
628
620(defun eww-readable () 629(defun eww-readable ()
621 "View the main \"readable\" parts of the current web page. 630 "View the main \"readable\" parts of the current web page.
622This command uses heuristics to find the parts of the web page that 631This command uses heuristics to find the parts of the web page that
@@ -701,6 +710,7 @@ the like."
701 (define-key map "s" 'eww-switch-to-buffer) 710 (define-key map "s" 'eww-switch-to-buffer)
702 (define-key map "S" 'eww-list-buffers) 711 (define-key map "S" 'eww-list-buffers)
703 (define-key map "F" 'eww-toggle-fonts) 712 (define-key map "F" 'eww-toggle-fonts)
713 (define-key map "D" 'eww-toggle-paragraph-direction)
704 (define-key map [(meta C)] 'eww-toggle-colors) 714 (define-key map [(meta C)] 'eww-toggle-colors)
705 715
706 (define-key map "b" 'eww-add-bookmark) 716 (define-key map "b" 'eww-add-bookmark)
@@ -729,7 +739,8 @@ the like."
729 ["List cookies" url-cookie-list t] 739 ["List cookies" url-cookie-list t]
730 ["Toggle fonts" eww-toggle-fonts t] 740 ["Toggle fonts" eww-toggle-fonts t]
731 ["Toggle colors" eww-toggle-colors t] 741 ["Toggle colors" eww-toggle-colors t]
732 ["Character Encoding" eww-set-character-encoding])) 742 ["Character Encoding" eww-set-character-encoding]
743 ["Toggle Paragraph Direction" eww-toggle-paragraph-direction]))
733 map)) 744 map))
734 745
735(defvar eww-tool-bar-map 746(defvar eww-tool-bar-map
diff --git a/lisp/saveplace.el b/lisp/saveplace.el
index c27df150248..02302798718 100644
--- a/lisp/saveplace.el
+++ b/lisp/saveplace.el
@@ -120,6 +120,25 @@ disabled, i.e., the position is recorded for all files."
120 120
121(declare-function dired-current-directory "dired" (&optional localp)) 121(declare-function dired-current-directory "dired" (&optional localp))
122 122
123(defun save-place--setup-hooks (add)
124 (cond
125 (add
126 (add-hook 'find-file-hook #'save-place-find-file-hook t)
127 (add-hook 'dired-initial-position-hook #'save-place-dired-hook)
128 (unless noninteractive
129 (add-hook 'kill-emacs-hook #'save-place-kill-emacs-hook))
130 (add-hook 'kill-buffer-hook #'save-place-to-alist))
131 (t
132 ;; We should remove the hooks, but only if save-place-mode
133 ;; is nil everywhere. Is it worth the trouble, tho?
134 ;; (unless (or (default-value 'save-place-mode)
135 ;; (cl-some <save-place-local-mode-p> (buffer-list)))
136 ;; (remove-hook 'find-file-hook #'save-place-find-file-hook)
137 ;; (remove-hook 'dired-initial-position-hook #'save-place-dired-hook)
138 ;; (remove-hook 'kill-emacs-hook #'save-place-kill-emacs-hook)
139 ;; (remove-hook 'kill-buffer-hook #'save-place-to-alist))
140 )))
141
123(define-obsolete-variable-alias 'save-place 'save-place-mode "25.1") 142(define-obsolete-variable-alias 'save-place 'save-place-mode "25.1")
124;;;###autoload 143;;;###autoload
125(define-minor-mode save-place-mode 144(define-minor-mode save-place-mode
@@ -128,22 +147,14 @@ This means when you visit a file, point goes to the last place
128where it was when you previously visited the same file." 147where it was when you previously visited the same file."
129 :global t 148 :global t
130 :group 'save-place 149 :group 'save-place
131 (cond 150 (save-place--setup-hooks save-place-mode))
132 (save-place-mode
133 (add-hook 'find-file-hook 'save-place-find-file-hook t)
134 (add-hook 'dired-initial-position-hook 'save-place-dired-hook)
135 (unless noninteractive
136 (add-hook 'kill-emacs-hook 'save-place-kill-emacs-hook))
137 (add-hook 'kill-buffer-hook 'save-place-to-alist))
138 (t
139 (remove-hook 'find-file-hook 'save-place-find-file-hook t)
140 (remove-hook 'dired-initial-position-hook 'save-place-dired-hook)
141 (remove-hook 'kill-emacs-hook 'save-place-kill-emacs-hook)
142 (remove-hook 'kill-buffer-hook 'save-place-to-alist))))
143 151
144(make-variable-buffer-local 'save-place-mode) ; Hysterical raisins. 152(make-variable-buffer-local 'save-place-mode)
145 153
146(defun toggle-save-place (&optional parg) ;FIXME: save-place-local-mode! 154(define-obsolete-function-alias 'toggle-save-place
155 #'save-place-local-mode "25.1")
156;;;###autoload
157(define-minor-mode save-place-local-mode
147 "Toggle whether to save your place in this file between sessions. 158 "Toggle whether to save your place in this file between sessions.
148If this mode is enabled, point is recorded when you kill the buffer 159If this mode is enabled, point is recorded when you kill the buffer
149or exit Emacs. Visiting this file again will go to that position, 160or 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
156file: 167file:
157 168
158\(save-place-mode 1)" 169\(save-place-mode 1)"
159 (interactive "P") 170 :variable save-place-mode
160 (if (not (or buffer-file-name (and (derived-mode-p 'dired-mode) 171 (if (not (or buffer-file-name (and (derived-mode-p 'dired-mode)
161 (boundp 'dired-subdir-alist) 172 (boundp 'dired-subdir-alist)
162 dired-subdir-alist 173 dired-subdir-alist
163 (dired-current-directory)))) 174 (dired-current-directory))))
164 (message "Buffer `%s' not visiting a file or directory" (buffer-name)) 175 (message "Buffer `%s' not visiting a file or directory" (buffer-name))
165 (setq save-place (if parg 176 (save-place--setup-hooks save-place-mode)))
166 (> (prefix-numeric-value parg) 0)
167 (not save-place)))
168 (message (if save-place
169 "Place will be saved"
170 "No place will be saved in this file"))))
171 177
172(declare-function dired-get-filename "dired" (&optional localp no-error-if-not-filep)) 178(declare-function dired-get-filename "dired" (&optional localp no-error-if-not-filep))
173 179
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 1686c02ada3..9920fa06d0c 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -489,19 +489,26 @@ looks like an email address, \"ftp://\" if it starts with
489(defun thing-at-point-looking-at (regexp &optional distance) 489(defun thing-at-point-looking-at (regexp &optional distance)
490 "Return non-nil if point is in or just after a match for REGEXP. 490 "Return non-nil if point is in or just after a match for REGEXP.
491Set the match data from the earliest such match ending at or after 491Set the match data from the earliest such match ending at or after
492point." 492point.
493
494Optional argument DISTANCE limits search for REGEXP forward and
495back from point."
493 (save-excursion 496 (save-excursion
494 (let ((old-point (point)) 497 (let ((old-point (point))
495 (forward-bound (and distance (+ (point) distance))) 498 (forward-bound (and distance (+ (point) distance)))
496 (backward-bound (and distance (- (point) distance))) 499 (backward-bound (and distance (- (point) distance)))
497 match) 500 match prev-pos new-pos)
498 (and (looking-at regexp) 501 (and (looking-at regexp)
499 (>= (match-end 0) old-point) 502 (>= (match-end 0) old-point)
500 (setq match (point))) 503 (setq match (point)))
501 ;; Search back repeatedly from end of next match. 504 ;; Search back repeatedly from end of next match.
502 ;; This may fail if next match ends before this match does. 505 ;; This may fail if next match ends before this match does.
503 (re-search-forward regexp forward-bound 'limit) 506 (re-search-forward regexp forward-bound 'limit)
504 (while (and (re-search-backward regexp backward-bound t) 507 (setq prev-pos (point))
508 (while (and (setq new-pos (re-search-backward regexp backward-bound t))
509 ;; Avoid inflooping with some regexps, such as "^",
510 ;; matching which never moves point.
511 (< new-pos prev-pos)
505 (or (> (match-beginning 0) old-point) 512 (or (> (match-beginning 0) old-point)
506 (and (looking-at regexp) ; Extend match-end past search start 513 (and (looking-at regexp) ; Extend match-end past search start
507 (>= (match-end 0) old-point) 514 (>= (match-end 0) old-point)
diff --git a/nextstep/README b/nextstep/README
index 7724afa43bf..026a048e9d4 100644
--- a/nextstep/README
+++ b/nextstep/README
@@ -101,5 +101,5 @@ interface.
101 101
102The INSTALL file in this directory for compilation instructions. 102The INSTALL file in this directory for compilation instructions.
103 103
104The WISHLIST file in this directory for a list of ideas for future 104The Nextstep section in the etc/TODO file for a list of ideas for
105development of the NS interface. 105future development.
diff --git a/nextstep/WISHLIST b/nextstep/WISHLIST
deleted file mode 100644
index 1c4b9e2deb4..00000000000
--- a/nextstep/WISHLIST
+++ /dev/null
@@ -1,247 +0,0 @@
1 -*- org -*-
2
3 Wish list for the "NS" OS X Emacs port
4 --------------------------------------
5
6 Note: This document is written using "org-mode", a plain-text
7 format supporting outlines. To expand a heading, press TAB. To
8 expand all headings and subheadings, press S-TAB until Emacs
9 responds "SHOW ALL".
10
11* Introduction
12
13This is a wishlist for future development of the "NS" Emacs user
14interface whose primary use is the official Emacs version on OS X.
15
16This list should be seen as a complement to the bug- and wishlist on
17[[http://debbugs.gnu.org/cgi/pkgreport.cgi?package%3Demacs][debbugs]], the Emacs bug tracker.
18
19* Missing features
20
21This sections contains features found in other official Emacs ports.
22
23** Support for "xwidget"
24
25Emacs 25 has support for "xwidgets", a system to include operating
26system components into an Emacs buffer. The components range from
27simple buttons to "webkit" (effectively, a web browser).
28
29Currently, "xwidget" only works for the "gtk+" framework but it is
30designed to be compatible with multiple Emacs ports.
31
32** Respect `frame-inhibit-implied-resize'
33
34When the variable `frame-inhibit-implied-resize' is non-nil, frames
35should not be resized when operations like changing font or toggling
36the tool bar is performed.
37
38Unfortunately, the tool bar (and possible other operations) always
39resize the frame.
40
41** Support `proced' (implement `process-attributes')
42
43Unfortunately, a user-level process like Emacs does not have the
44privileges to get information about other processes under OS X.
45
46There are other ways to do this:
47
48 1) Spawn "ps" and parse the output ("ps" has superuser privileges).
49
50 2) Sign Emacs as part of the distribution process.
51
52 3) Ask the user to self-sign Emacs, if this feature is of interest.
53
54Anders Lindgren <andlind@gmail.com> has implemented
55`process-attributes' for OS X -- which currently only work when
56running Emacs as root.
57
58[[http://emacsredux.com/blog/2013/05/02/manage-processes-with-proced/][See this article by Bozhidar Batsov for an overview of Proced.]]
59
60** Tooltip properties
61
62Tooltip properties like the background color and font are hard wired,
63even though Emacs allow a user to customize such features.
64
65* New features
66
67This section contains features unique to the NS and/or OS X.
68
69** PressAndHold for writing accented character
70
71On OS X, many application supports the press and hold pattern to
72invoke a menu of accented characters. (See example at [[https://support.apple.com/en-us/HT201586][Apple]].)
73
74Currently, this doesn't work in Emacs.
75
76Note that "ns-win.el" explicitly disables this.
77
78Note: This feature might not be allowed to be implemented until also
79implemented in Emacs for a free system.
80
81** Floating scroll bars
82
83In modern OS X applications, the scroll bar often float over the
84content, and is invisible unless actually used. This makes user
85interface less cluttered and more area could be used to contain text.
86
87With floating scroll bars, the user interface would look like it does
88when they are disabled today. However, they will be made visible when
89a scroll action is initiated, e.g. by putting two fingers on a
90trackpad.
91
92Note: This feature might not be allowed to be implemented until also
93implemented in Emacs for a free system.
94
95* Features from the "mac" port
96
97This section contains features available in the "mac" Emacs port.
98
99As the "mac" port (as of this writing) isn't an official Emacs port,
100it might contain features not following the FSF rule "must exist on
101free systems".
102
103The "mac" port is based on the Emacs 22 C-based Carbon interface. It
104has been maintained in parallel to the official Cocoa-based NS
105interface. The Carbon interface has been enhanced, and a number of the
106features of that interface could be implemented NS.
107
108** Smooth scrolling -- maybe not a good idea
109
110Today, by default, scrolling with a trackpad makes the text move in
111steps of five lines. (Scrolling with SHIFT scrolls one line at a
112time.)
113
114The "mac" port provides smooth, pixel-based, scrolling. This is a very
115popular features. However, there are drawbacks to this method: what
116happens if only a fraction of a line is visible at the top of a
117window, is the partially visible text considered part of the window or
118not? (Technically, what should `window-start' return.)
119
120An alternative would be to make one-line scrolling the default on NS
121(or in Emacs in general).
122
123Note: This feature might not be allowed to be implemented until also
124implemented in Emacs for a free system.
125
126** Mouse gestures
127
128The "mac" port defines the gestures `swipe-left/right/up/down',
129`magnify-up/down', and `rotate-left/right'.
130
131It also binds the magnification commands to change the font
132size. (This should be not be done in a specific interface, instead
133Emacs should do this binding globally.)
134
135Note: This feature might not be allowed to be implemented until also
136implemented in Emacs for a free system.
137
138** Synthesize bold fonts
139
140* Open issues
141
142This section contains issues where there is an ongoing debate.
143
144** Key bindings of CMD and ALT
145
146Currently in the "ns" port, ALT is bound to Meta and CMD is bound to
147Super -- allowing the user to use typical OS X commands like CMD-A to
148mark everything.
149
150Unfortunately, when using an international keyboard, you can't type
151normal characters like "(" etc.
152
153There are many alternative key bindings. One solution is to bind CMD
154to Meta and pass ALT to the system. In fact, this is what Emacs did up
155to, and including, version 22. Also, this is how the "mac" port binds
156the keys.
157
158One could envision asymmetrical variants as well, however, this is
159inappropriate for the default setting.
160
161See 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]].
162
163* Bugs
164
165This sections contains a small selection of bugs which are hard to
166fix. For other bugs, see the official bug tracker debbugs.gnu.org.
167
168** Incorrect translation of Super modifier with Ctrl or Meta on OS X
169
170When pressing `M-s-a', Emacs replies "M-s-å is undefined". What
171happened is a mix of Emacs view that Meta and Super has been pressed,
172and OS X view that ALT-a should yield "å".
173
174The bug reports suggests two different patched, unfortunately, none
175work properly. For example:
176
177 Use a Swedish keyboard layout
178
179 (setq ns-alternate-modifier nil)
180
181 "CMD-ALT-9"
182
183Today, this correctly yields that s-] is undefined. With the either
184of the two patches, Emacs responds that s-9 was pressed.
185
186More investigation is needed to fix this problem.
187
188Links:
189- [[http://debbugs.gnu.org/cgi/bugreport.cgi?bug%3D19977][bug#19977]]
190- [[http://debbugs.gnu.org/cgi/bugreport.cgi?bug%3D21330][bug#21330]]
191- [[http://debbugs.gnu.org/cgi/bugreport.cgi?bug%3D21551][bug#21551]]
192
193** Toggline the toolbar in fullheight or maximized modes
194
195The toolbar, in the NS interface, is not considered part of the text
196area. When it is toggled, the Emacs frame change height accordingly.
197
198Unfortunately, this also occurs when the frame is in fullheight or
199maximized modes (N.B. this is not the same as "fullscreen"). The
200effect is that the full frame size either increases (stretching down
201below the lower edge of the screen) or decreases (leaving space
202between the lower edge of the frame and the lower edge of the screen).
203
204A better solution would be for the frame to retain its size,
205i.e. change the text area.
206
207This is related to the `frame-inhibit-implied-resize' issue.
208
209* Internal development features
210
211** Regression test system (or at least a checklist)
212
213Today, after each change to the user interface, Emacs must be manually
214tested. Often, small details are overlooked ("Oh, I didn't test
215toggling the tool-bar in one of the full screen modes, when multiple
216frame were open -- silly me.")
217
218It would be an enormous help if this could be tested automatically.
219Many features are generic, however, the NS interface provides a number
220of unique features.
221
222*** Existing packages
223
224Note that there is a generic UI test named "[[http://debbugs.gnu.org/cgi/bugreport.cgi?bug%3D21415#284][frame-test.el]]". The NS
225interface pass this, with the exception of two toolbar related
226errors.
227
228*** Anders frame test
229
230Anders Lindgren <andlind@gmail.com> has implemented some (very basic)
231tests for full screen, toolbar, and auto-hiding the menu bar.
232
233** Make sure all build variants work
234
235Emacs can be build in a number of different ways. For each feature,
236consider if is really is "NS" specific, or if it should be applied to
237all build versions.
238
239- With the "NS" interface. This is the normal way to build Emacs on
240 OS X.
241
242- With the "X11" interface. On OS X, this is mainly of interest to
243 developers of Emacs to get a "reference" interface implementations.
244 However, it might be of interest for people working remotely, as X11
245 applications can be used over a network connection.
246
247- Console only.
diff --git a/src/dispextern.h b/src/dispextern.h
index 7d7d7305b43..00667c5a8fa 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1973,8 +1973,8 @@ struct bidi_it {
1973 resolving weak and neutral types */ 1973 resolving weak and neutral types */
1974 bidi_type_t type_after_wn; /* bidi type after overrides and Wn */ 1974 bidi_type_t type_after_wn; /* bidi type after overrides and Wn */
1975 bidi_type_t orig_type; /* original bidi type, as found in the buffer */ 1975 bidi_type_t orig_type; /* original bidi type, as found in the buffer */
1976 char resolved_level; /* final resolved level of this character */ 1976 signed char resolved_level; /* final resolved level of this character */
1977 char isolate_level; /* count of isolate initiators unmatched by PDI */ 1977 signed char isolate_level; /* count of isolate initiators unmatched by PDI */
1978 ptrdiff_t invalid_levels; /* how many PDFs to ignore */ 1978 ptrdiff_t invalid_levels; /* how many PDFs to ignore */
1979 ptrdiff_t invalid_isolates; /* how many PDIs to ignore */ 1979 ptrdiff_t invalid_isolates; /* how many PDIs to ignore */
1980 struct bidi_saved_info prev; /* info about previous character */ 1980 struct bidi_saved_info prev; /* info about previous character */
diff --git a/src/dispnew.c b/src/dispnew.c
index b05356a3b64..a9f06eb3c12 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -681,7 +681,9 @@ void
681clear_glyph_matrix_rows (struct glyph_matrix *matrix, int start, int end) 681clear_glyph_matrix_rows (struct glyph_matrix *matrix, int start, int end)
682{ 682{
683 eassert (start <= end); 683 eassert (start <= end);
684 eassert (start >= 0 && start <= matrix->nrows); 684 eassert (start >= 0 && (start < matrix->nrows
685 /* matrix->nrows can be 0 for the initial frame. */
686 || (matrix->nrows == 0)));
685 eassert (end >= 0 && end <= matrix->nrows); 687 eassert (end >= 0 && end <= matrix->nrows);
686 688
687 for (; start < end; ++start) 689 for (; start < end; ++start)
diff --git a/src/keyboard.c b/src/keyboard.c
index 6535e04d826..4e1ac152a59 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -427,6 +427,15 @@ kset_system_key_syms (struct kboard *kb, Lisp_Object val)
427} 427}
428 428
429 429
430static bool
431echo_keystrokes_p (void)
432{
433 return (!cursor_in_echo_area)
434 && (FLOATP (Vecho_keystrokes) ? XFLOAT_DATA (Vecho_keystrokes) > 0.0
435 : INTEGERP (Vecho_keystrokes) ? XINT (Vecho_keystrokes) > 0
436 : false);
437}
438
430/* Add C to the echo string, without echoing it immediately. C can be 439/* Add C to the echo string, without echoing it immediately. C can be
431 a character, which is pretty-printed, or a symbol, whose name is 440 a character, which is pretty-printed, or a symbol, whose name is
432 printed. */ 441 printed. */
@@ -568,7 +577,9 @@ echo_update (void)
568static void 577static void
569echo_now (void) 578echo_now (void)
570{ 579{
571 if (!current_kboard->immediate_echo) 580 if (!current_kboard->immediate_echo
581 /* This test breaks calls that use `echo_now' to display the echo_prompt.
582 && echo_keystrokes_p () */)
572 { 583 {
573 current_kboard->immediate_echo = true; 584 current_kboard->immediate_echo = true;
574 echo_update (); 585 echo_update ();
@@ -2270,13 +2281,6 @@ read_decoded_event_from_main_queue (struct timespec *end_time,
2270 } 2281 }
2271} 2282}
2272 2283
2273static bool
2274echo_keystrokes_p (void)
2275{
2276 return (FLOATP (Vecho_keystrokes) ? XFLOAT_DATA (Vecho_keystrokes) > 0.0
2277 : INTEGERP (Vecho_keystrokes) ? XINT (Vecho_keystrokes) > 0 : false);
2278}
2279
2280/* Read a character from the keyboard; call the redisplay if needed. */ 2284/* Read a character from the keyboard; call the redisplay if needed. */
2281/* commandflag 0 means do not autosave, but do redisplay. 2285/* commandflag 0 means do not autosave, but do redisplay.
2282 -1 means do not redisplay, but do autosave. 2286 -1 means do not redisplay, but do autosave.
@@ -8889,11 +8893,15 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
8889 of echoing, so that it serves as a prompt for the next 8893 of echoing, so that it serves as a prompt for the next
8890 character. */ 8894 character. */
8891 kset_echo_prompt (current_kboard, prompt); 8895 kset_echo_prompt (current_kboard, prompt);
8896 /* FIXME: This use of echo_now doesn't look quite right and is ugly
8897 since it forces us to fiddle with current_kboard->immediate_echo
8898 before and after. */
8892 current_kboard->immediate_echo = false; 8899 current_kboard->immediate_echo = false;
8893 echo_now (); 8900 echo_now ();
8901 if (!echo_keystrokes_p ())
8902 current_kboard->immediate_echo = false;
8894 } 8903 }
8895 else if (cursor_in_echo_area 8904 else if (echo_keystrokes_p ())
8896 && echo_keystrokes_p ())
8897 /* This doesn't put in a dash if the echo buffer is empty, so 8905 /* This doesn't put in a dash if the echo buffer is empty, so
8898 you don't always see a dash hanging out in the minibuffer. */ 8906 you don't always see a dash hanging out in the minibuffer. */
8899 echo_dash (); 8907 echo_dash ();
diff --git a/src/xdisp.c b/src/xdisp.c
index acb275481ad..b9d496ed556 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -11232,6 +11232,7 @@ clear_garbaged_frames (void)
11232 if (frame_garbaged) 11232 if (frame_garbaged)
11233 { 11233 {
11234 Lisp_Object tail, frame; 11234 Lisp_Object tail, frame;
11235 struct frame *sf = SELECTED_FRAME ();
11235 11236
11236 FOR_EACH_FRAME (tail, frame) 11237 FOR_EACH_FRAME (tail, frame)
11237 { 11238 {
@@ -11239,7 +11240,13 @@ clear_garbaged_frames (void)
11239 11240
11240 if (FRAME_VISIBLE_P (f) && FRAME_GARBAGED_P (f)) 11241 if (FRAME_VISIBLE_P (f) && FRAME_GARBAGED_P (f))
11241 { 11242 {
11242 if (f->resized_p) 11243 if (f->resized_p
11244 /* It makes no sense to redraw a non-selected TTY
11245 frame, since that will actually clear the
11246 selected frame, and might leave the selected
11247 frame with corrupted display, if it happens not
11248 to be marked garbaged. */
11249 && !(f != sf && (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))))
11243 redraw_frame (f); 11250 redraw_frame (f);
11244 else 11251 else
11245 clear_current_matrices (f); 11252 clear_current_matrices (f);
diff --git a/src/xftfont.c b/src/xftfont.c
index 110f99a9be9..d94955f296a 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -395,16 +395,6 @@ xftfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
395 395
396 font->ascent = xftfont->ascent; 396 font->ascent = xftfont->ascent;
397 font->descent = xftfont->descent; 397 font->descent = xftfont->descent;
398 if (pixel_size >= 5)
399 {
400 /* The above condition is a dirty workaround because
401 XftTextExtents8 behaves strangely for some fonts
402 (e.g. "Dejavu Sans Mono") when pixel_size is less than 5. */
403 if (font->ascent < extents.y)
404 font->ascent = extents.y;
405 if (font->descent < extents.height - extents.y)
406 font->descent = extents.height - extents.y;
407 }
408 font->height = font->ascent + font->descent; 398 font->height = font->ascent + font->descent;
409 399
410 if (XINT (AREF (entity, FONT_SIZE_INDEX)) == 0) 400 if (XINT (AREF (entity, FONT_SIZE_INDEX)) == 0)