mirrored from git://git.sv.gnu.org/emacs.git
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comment cache #3
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* src/syntax.c (internalize_parse_state): New function. (scan_sexps_forward): Remove stuff now done in the above. Adapt parameter list. Add code conditionally to apply `comment-depth' text properties. (Fparse_partial_sexp, back_comment): Call internalize_parse_state. (comment-depth, comment-depth-hwm, comment-cacheing-flag): New symbol, variables.
Change the definition of `comment-depth''s values from an atom to a cons so as to hold enough information to initiliaze `scan_sexps_forward''s state. * src/syntax.c (old_back_comment): renamed from `back_comment'. (back_comment): New function which, when `comment-cacheing-flag' is non-nil applies `comment-depth' text properties then (for now) calls `old-back-comment'. (scan_sexp_forward): Enhance values applied as `comment-depth''s values.
To test this facility, set `comment-cacheing-flag' to non-nil. * src/buffer.c, src/buffer.h: Create BVAR variable `comment-depth-hwm'. * src/insdel.c (signal_after_change): call Ftrim_comment_cache. * src/syntax.c (comment-depth-hwm): Removed (moved into buffer.c/h). (scan_sexps_forward): Restore to the previous functionality by removing the parameter `propertize' and the code which applied text properties. (Ftrim_comment_cache, syntax_table_value_is_interesting_for_literals) (check_comment_depth_hwm_for_prop, scan_literals_forward_to): New functions. (back_comment): Extensive rework. It now calls old_back_comment only when `comment-cacheing-flag' is non-nil. (comment-depth-values): New variable. * src/syntax.h (check_comment_depth_hwm_for_prop): Exported. * src/textprop.c (set_properties, add_properties, remove_properties): * call check_comment_depth_hwm_for_prop.
* src/syntax.c: (back_comment): Also check for syntax Scomment_fence whilst verifying comment opener. (scan_sexps_forward): Remove unused variable `count'.
…-state' * lisp/progmodes/cc-defs.el (c-use-category): Set to nil when 'comment-depth-hwm' exists. (c-save-buffer-state): Bind `inhibit-modification-hooks' to non-nil.
This is needed because parse-partial-sexp doesn't stop at the starters or enders of nested comments. * src/syntax.c (scan_nested_comments_forward): New function. (scan_comments_forward_to): Add a call to scan_nested_comments_forward.
…ault * buffer.c: * buffer.h: * syntax.c: * syntax.h: * insdel.c: * textprop.c: Rename `comment-depth' to `literal-cache', `comment-depth-hwm' to `literal-cache-hwm', `comment-cacheing-flag' to `literal-cacheing-flag'. Rename some functions and internal variables similarly. * syntax.c (literal-cacheing-flag): Enable by default.
* src/syntax.c (scan_comments_forward_to): Only put `literal-cache' text property over literals, not non-literals. (back_comment): minor consequential changes.
Changes to a syntax table (by modify-syntax-entry or set-syntax-table) now cause the literal-cache cache(s) in the affected buffer(s) to be emptied, if the change might have an affect on the parsing of comments or strings. * doc/emacs/programs.texi (Left Margin Paren): document that open parens may now be freely written in column 0 inside comments. Explain the changes to the low level SW which make this possible. * src/chartab.c (make-char-table): Initialize any extra slots to nil, rather than the default value for the table's values. (sub_char_table_ref_and_range): Export this function. (char_table_ref_and_range_with_parents): New function. * src/lisp.h: Export sub_char_table_ref_and_range and char_table_ref_and_range_with_parents for chartab.c * src/syntax.c (find_defun_start, old_back_comment, literal-cacheing-flag): remove. (empty_syntax_tables_buffers_literal_caches, LITERAL_MASK, SYNTAB_LITERAL) (literally_different, syntax_table_ranges_differ_literally_p) (least-literal-difference-between-syntax-tables) (syntax-tables-literally-different-p) (syntax_table_value_range_is_interesting_for_literals) (break_off_syntax_tables_literal_relations): New functions/DEFUNs/macros. (set-syntax-table): When the new syntax table is "literally different" from the old, empty the buffer's literal cache. (modify-syntax-entry): if the new syntax descriptor is "literally different" from the old, empty the literal cache in every pertinent buffer. (syntax-table): Add two (char table) extra slots: they hold lists of, respectively, other syntax tables known to be (i) literally the same; (ii) literally different from the current syntax table.
hubot
pushed a commit
that referenced
this pull request
Apr 7, 2017
The recent changes to src/casefiddle.c cause build failure as seen below: Starting program: /home/npostavs/src/emacs/emacs-bootstrapping/src/temacs --batch --load loadup bootstrap [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". Loading loadup.el (source)... Using load-path (/home/npostavs/src/emacs/emacs-bootstrapping/lisp /home/npostavs/src/emacs/emacs-bootstrapping/lisp/emacs-lisp /home/npostavs/src/emacs/emacs-bootstrapping/lisp/language /home/npostavs/src/emacs/emacs-bootstrapping/lisp/international /home/npostavs/src/emacs/emacs-bootstrapping/lisp/textmodes /home/npostavs/src/emacs/emacs-bootstrapping/lisp/vc) Loading emacs-lisp/byte-run (source)... Loading emacs-lisp/backquote (source)... Loading subr (source)... Loading version (source)... Loading widget (source)... Loading custom (source)... Loading emacs-lisp/map-ynp (source)... Loading international/mule (source)... Loading international/mule-conf (source)... lread.c:3914: Emacs fatal error: assertion failed: !NILP (Vpurify_flag) Breakpoint 1, terminate_due_to_signal at emacs.c:363 363 signal (sig, SIG_DFL); (gdb) bt #0 0x0000000000579826 in terminate_due_to_signal at emacs.c:363 #1 0x000000000060ec33 in die at alloc.c:7352 #2 0x000000000066db40 in intern_c_string_1 at lread.c:3914 #3 0x0000000000576884 in intern_c_string at lisp.h:3790 #4 0x00000000005dc84f in prepare_casing_context at casefiddle.c:69 #5 0x00000000005dd37f in casify_object at casefiddle.c:311 #6 0x00000000005dd47f in Fcapitalize at casefiddle.c:356 #7 0x00000000006325ac in eval_sub at eval.c:2219 #8 0x0000000000632368 in eval_sub at eval.c:2184 #9 0x000000000063446c in apply_lambda at eval.c:2875 #10 0x00000000006329af in eval_sub at eval.c:2294 #11 0x000000000062d462 in Fprogn at eval.c:449 #12 0x000000000062d4cf in prog_ignore at eval.c:461 #13 0x000000000062f19c in Fwhile at eval.c:982 #14 0x00000000006321f4 in eval_sub at eval.c:2172 #15 0x000000000062d462 in Fprogn at eval.c:449 #16 0x000000000062f0c4 in Flet at eval.c:963 #17 0x00000000006321f4 in eval_sub at eval.c:2172 #18 0x0000000000632963 in eval_sub at eval.c:2290 #19 0x000000000062d462 in Fprogn at eval.c:449 #20 0x000000000062f0c4 in Flet at eval.c:963 #21 0x00000000006321f4 in eval_sub at eval.c:2172 #22 0x0000000000668caa in readevalloop at lread.c:1927 #23 0x0000000000667253 in Fload at lread.c:1332 #24 0x0000000000632683 in eval_sub at eval.c:2233 #25 0x0000000000668caa in readevalloop at lread.c:1927 #26 0x0000000000667253 in Fload at lread.c:1332 #27 0x0000000000632683 in eval_sub at eval.c:2233 #28 0x0000000000631be5 in Feval at eval.c:2041 #29 0x000000000057e1af in top_level_2 at keyboard.c:1121 #30 0x000000000062ffc7 in internal_condition_case at eval.c:1324 #31 0x000000000057e1f0 in top_level_1 at keyboard.c:1129 #32 0x000000000062f51e in internal_catch at eval.c:1091 #33 0x000000000057e0ea in command_loop at keyboard.c:1090 #34 0x000000000057d6d5 in recursive_edit_1 at keyboard.c:697 #35 0x000000000057d8b4 in Frecursive_edit at keyboard.c:768 #36 0x000000000057b55b in main at emacs.c:1687 Lisp Backtrace: "capitalize" (0xffffcf70) "format" (0xffffd130) "define-charset" (0xffffd370) "while" (0xffffd560) "let" (0xffffd7c0) "dolist" (0xffffd910) "let" (0xffffdb70) "load" (0xffffdfe0) "load" (0xffffe4a0) * src/casefiddle.c (syms_of_casefiddle): Declare four new symbols: Qtitlecase, Qspecial_uppercase, Qspecial_lowercase and Qspecial_titlecase. (prepare_casing_context): Use aforementioned symbols.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey love a good bit of Emacs m8, thanks for putting up this mirror.
Unorthodox pull request right? XD