aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichal Nazarewicz2013-06-30 18:29:23 -0400
committerStefan Monnier2013-06-30 18:29:23 -0400
commitef099a941f7fb2d74ce1768388463f18b284f9c5 (patch)
tree1573bfacf90fc940c297c5428c132e9e65318716 /src
parent6d89e343ab402851d94e37b2ca79a67e4c6fb474 (diff)
downloademacs-ef099a941f7fb2d74ce1768388463f18b284f9c5.tar.gz
emacs-ef099a941f7fb2d74ce1768388463f18b284f9c5.zip
Add `remember-notes' function to store random notes across Emacs
restarts. * remember.el (remember-data-file): Add :set callback to affect notes buffer (if any). (remember-notes): New command. (remember-notes-buffer-name, bury-remember-notes-on-kill): New defcustoms for the `remember-notes' function. (remember-notes-save-and-bury-buffer): New command. (remember-notes-mode-map): New variable. (remember-mode): New minor mode. (remember-notes--kill-buffer-query): New function. * lisp/startup.el (initial-buffer-choice): Add notes to custom type. * src/buffer.c (FKill_buffer): Run `kill-buffer-query-functions' before checking whether buffer is modified. This lets `kill-buffer-query-functions' cancel killing of the buffer or save its content before `kill-buffer' asks user the "Buffer %s modified; kill anyway?" question. * remember.el (remember-append-to-file): Don't mix `find-buffer-visiting' and `get-file-buffer'. * lisp/files.el (find-file-noselect): Simplify conditional expression.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog34
-rw-r--r--src/buffer.c28
-rw-r--r--src/xdisp.c2
3 files changed, 47 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9dc1b989e3f..8b3f98fe9f3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12013-06-30 Michal Nazarewicz <mina86@mina86.com>
2
3 * buffer.c (FKill_buffer): Run `kill-buffer-query-functions'
4 before checking whether buffer is modified. This lets
5 `kill-buffer-query-functions' cancel killing of the buffer or save
6 its content before `kill-buffer' asks user the "Buffer %s
7 modified; kill anyway?" question.
8
12013-06-30 Jan Djärv <jan.h.d@swipnet.se> 92013-06-30 Jan Djärv <jan.h.d@swipnet.se>
2 10
3 * nsfns.m (handlePanelKeys): Don't process Command+Function keys. 11 * nsfns.m (handlePanelKeys): Don't process Command+Function keys.
@@ -59,6 +67,24 @@
59 :prefer-utf-8. 67 :prefer-utf-8.
60 (syms_of_coding): Adjust for coding_arg_undecided_max. 68 (syms_of_coding): Adjust for coding_arg_undecided_max.
61 69
702013-06-28 Kenichi Handa <handa@gnu.org>
71
72 * coding.h (define_coding_undecided_arg_index): New enum.
73 (coding_attr_index): New members
74 coding_attr_undecided_inhibit_null_byte_detection,
75 coding_attr_undecided_inhibit_iso_escape_detection,
76 coding_attr_undecided_prefer_utf_8.
77 (undecided_spec): New struct.
78 (struct coding_system): New member `undecided' of the member `spec'.
79
80 * coding.c (setup_coding_system): Handle CODING->spec.undecided.
81 (detect_coding): Likewise.
82 (detect_coding_system): Likewise.
83 (Fdefine_coding_system_internal): New coding system properties
84 :inhibit-null-byte-detection, :inhibit-iso-escape-detection, and
85 :prefer-utf-8.
86 (syms_of_coding): Adjust for coding_arg_undecided_max.
87
622013-06-28 Paul Eggert <eggert@cs.ucla.edu> 882013-06-28 Paul Eggert <eggert@cs.ucla.edu>
63 89
64 * image.c (x_from_xcolors): Remove unused local. 90 * image.c (x_from_xcolors): Remove unused local.
@@ -75,8 +101,8 @@
75 (x_clear_image_1): New arg `flags' instead of 3 bools `pixmap_p', 101 (x_clear_image_1): New arg `flags' instead of 3 bools `pixmap_p',
76 `mask_p', and `colors_p'. All uses changed. 102 `mask_p', and `colors_p'. All uses changed.
77 (x_clear_image_1) [HAVE_X_WINDOWS]: Destroy `ximg' and `mask_img'. 103 (x_clear_image_1) [HAVE_X_WINDOWS]: Destroy `ximg' and `mask_img'.
78 (CLEAR_IMAGE_PIXMAP, CLEAR_IMAGE_MASK, CLEAR_IMAGE_COLORS): New 104 (CLEAR_IMAGE_PIXMAP, CLEAR_IMAGE_MASK, CLEAR_IMAGE_COLORS):
79 macros for `flags' arg to x_clear_image_1. 105 New macros for `flags' arg to x_clear_image_1.
80 (postprocess_image, xpm_load_image, x_build_heuristic_mask) 106 (postprocess_image, xpm_load_image, x_build_heuristic_mask)
81 (png_load_body): Use x_clear_image_1 instead of Free_Pixmap. 107 (png_load_body): Use x_clear_image_1 instead of Free_Pixmap.
82 (ZPixmap, XGetImage) [HAVE_NS]: Remove. 108 (ZPixmap, XGetImage) [HAVE_NS]: Remove.
@@ -343,7 +369,7 @@
343 * textprop.c (property_set_type): New enum. 369 * textprop.c (property_set_type): New enum.
344 (add_properties): Allow appending/prepending text properties. 370 (add_properties): Allow appending/prepending text properties.
345 (add_text_properties_1): Factored out of Fadd_text_properties. 371 (add_text_properties_1): Factored out of Fadd_text_properties.
346 (Fadd_text_properties): Moved all the code into 372 (Fadd_text_properties): Move all the code into
347 add_text_properties_1. 373 add_text_properties_1.
348 (Fadd_face_text_property): New function that calls 374 (Fadd_face_text_property): New function that calls
349 add_text_properties_1. 375 add_text_properties_1.
@@ -914,7 +940,7 @@
914 (Fxw_color_values): Use EmacsCGFloat 940 (Fxw_color_values): Use EmacsCGFloat
915 (Fns_display_monitor_attributes_list): Only get screen number for 941 (Fns_display_monitor_attributes_list): Only get screen number for
916 Cocoa. 942 Cocoa.
917 (getDirectory, getFilename): Removed from EmacsOpenPanel and 943 (getDirectory, getFilename): Remove from EmacsOpenPanel and
918 EmacsSavePanel. 944 EmacsSavePanel.
919 (EmacsOpenPanel:ok:): Use ns_filename_from_panel and 945 (EmacsOpenPanel:ok:): Use ns_filename_from_panel and
920 ns_directory_from_panel. 946 ns_directory_from_panel.
diff --git a/src/buffer.c b/src/buffer.c
index 08299daa7dc..ad670e0a121 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1734,18 +1734,6 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1734 if (!BUFFER_LIVE_P (b)) 1734 if (!BUFFER_LIVE_P (b))
1735 return Qnil; 1735 return Qnil;
1736 1736
1737 /* Query if the buffer is still modified. */
1738 if (INTERACTIVE && !NILP (BVAR (b, filename))
1739 && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
1740 {
1741 GCPRO1 (buffer);
1742 tem = do_yes_or_no_p (format2 ("Buffer %s modified; kill anyway? ",
1743 BVAR (b, name), make_number (0)));
1744 UNGCPRO;
1745 if (NILP (tem))
1746 return Qnil;
1747 }
1748
1749 /* Run hooks with the buffer to be killed the current buffer. */ 1737 /* Run hooks with the buffer to be killed the current buffer. */
1750 { 1738 {
1751 ptrdiff_t count = SPECPDL_INDEX (); 1739 ptrdiff_t count = SPECPDL_INDEX ();
@@ -1761,6 +1749,22 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1761 if (NILP (tem)) 1749 if (NILP (tem))
1762 return unbind_to (count, Qnil); 1750 return unbind_to (count, Qnil);
1763 1751
1752 /* Query if the buffer is still modified. */
1753 if (INTERACTIVE && !NILP (BVAR (b, filename))
1754 && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
1755 {
1756 GCPRO1 (buffer);
1757 tem = do_yes_or_no_p (format2 ("Buffer %s modified; kill anyway? ",
1758 BVAR (b, name), make_number (0)));
1759 UNGCPRO;
1760 if (NILP (tem))
1761 return unbind_to (count, Qnil);
1762 }
1763
1764 /* If the hooks have killed the buffer, exit now. */
1765 if (!BUFFER_LIVE_P (b))
1766 return unbind_to (count, Qt);
1767
1764 /* Then run the hooks. */ 1768 /* Then run the hooks. */
1765 Frun_hooks (1, &Qkill_buffer_hook); 1769 Frun_hooks (1, &Qkill_buffer_hook);
1766 unbind_to (count, Qnil); 1770 unbind_to (count, Qnil);
diff --git a/src/xdisp.c b/src/xdisp.c
index 89761a0cfdc..3fa80336a61 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -20110,7 +20110,7 @@ Value is the new character position of point. */)
20110 w->cursor.vpos = -1; 20110 w->cursor.vpos = -1;
20111 return make_number (PT); 20111 return make_number (PT);
20112 } 20112 }
20113 else if (!INTEGERP (g->object) && g->object != gpt->object) 20113 else if (!INTEGERP (g->object) && !EQ (g->object, gpt->object))
20114 { 20114 {
20115 ptrdiff_t new_pos; 20115 ptrdiff_t new_pos;
20116 20116