aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2018-04-17 23:14:55 +0200
committerLars Ingebrigtsen2018-04-17 23:14:55 +0200
commite3b0dd6bf118c60ba41a09e3ffdce056b2e7c494 (patch)
treef0f8c6101513fa2175d0e898dc946800fb6d0d28
parentf10fa789ca8f0feff0e85df3624270604ed54dd6 (diff)
downloademacs-e3b0dd6bf118c60ba41a09e3ffdce056b2e7c494.tar.gz
emacs-e3b0dd6bf118c60ba41a09e3ffdce056b2e7c494.zip
Fix problem in `g' in Info with strings like "(foo)"
* lisp/info.el (Info-find-file): Add a new parameter to avoid jumping to the directory if the user looks for a filename on the form "(foo)" that doesn't exist. (Info-read-node-name-1): Use it to allow completing over strings like "(foo)" without losing focus (bug#30091).
-rw-r--r--lisp/info.el12
-rw-r--r--lisp/progmodes/sql.el19
2 files changed, 18 insertions, 13 deletions
diff --git a/lisp/info.el b/lisp/info.el
index 8743b449976..0db84fb3dab 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -868,10 +868,13 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
868 (forward-line 1) ; does the line after delimiter match REGEXP? 868 (forward-line 1) ; does the line after delimiter match REGEXP?
869 (re-search-backward regexp beg t)))) 869 (re-search-backward regexp beg t))))
870 870
871(defun Info-find-file (filename &optional noerror) 871(defun Info-find-file (filename &optional noerror no-pop-to-dir)
872 "Return expanded FILENAME, or t if FILENAME is \"dir\". 872 "Return expanded FILENAME, or t if FILENAME is \"dir\".
873Optional second argument NOERROR, if t, means if file is not found 873Optional second argument NOERROR, if t, means if file is not found
874just return nil (no error)." 874just return nil (no error).
875
876If NO-POP-TO-DIR, don't try to pop to the info buffer if we can't
877find a node."
875 ;; Convert filename to lower case if not found as specified. 878 ;; Convert filename to lower case if not found as specified.
876 ;; Expand it. 879 ;; Expand it.
877 (cond 880 (cond
@@ -930,7 +933,8 @@ just return nil (no error)."
930 (if noerror 933 (if noerror
931 (setq filename nil) 934 (setq filename nil)
932 ;; If there is no previous Info file, go to the directory. 935 ;; If there is no previous Info file, go to the directory.
933 (unless Info-current-file 936 (when (and (not no-pop-to-dir)
937 (not Info-current-file))
934 (Info-directory)) 938 (Info-directory))
935 (user-error "Info file %s does not exist" filename))) 939 (user-error "Info file %s does not exist" filename)))
936 filename)))) 940 filename))))
@@ -1868,7 +1872,7 @@ See `completing-read' for a description of arguments and usage."
1868 (lambda (string pred action) 1872 (lambda (string pred action)
1869 (complete-with-action 1873 (complete-with-action
1870 action 1874 action
1871 (Info-build-node-completions (Info-find-file file1)) 1875 (Info-build-node-completions (Info-find-file file1 nil t))
1872 string pred)) 1876 string pred))
1873 nodename predicate code)))) 1877 nodename predicate code))))
1874 ;; Otherwise use Info-read-node-completion-table. 1878 ;; Otherwise use Info-read-node-completion-table.
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index f907a01d8cf..ebbef8d89ee 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -4031,15 +4031,16 @@ Writes the input history to a history file using
4031 4031
4032This function is a sentinel watching the SQL interpreter process. 4032This function is a sentinel watching the SQL interpreter process.
4033Sentinels will always get the two parameters PROCESS and EVENT." 4033Sentinels will always get the two parameters PROCESS and EVENT."
4034 (with-current-buffer (process-buffer process) 4034 (when (buffer-live-p (process-buffer process))
4035 (let 4035 (with-current-buffer (process-buffer process)
4036 ((comint-input-ring-separator sql-input-ring-separator) 4036 (let
4037 (comint-input-ring-file-name sql-input-ring-file-name)) 4037 ((comint-input-ring-separator sql-input-ring-separator)
4038 (comint-write-input-ring)) 4038 (comint-input-ring-file-name sql-input-ring-file-name))
4039 4039 (comint-write-input-ring))
4040 (if (not buffer-read-only) 4040
4041 (insert (format "\nProcess %s %s\n" process event)) 4041 (if (not buffer-read-only)
4042 (message "Process %s %s" process event)))) 4042 (insert (format "\nProcess %s %s\n" process event))
4043 (message "Process %s %s" process event)))))
4043 4044
4044 4045
4045 4046