elisp

How to use sshpass when loging in to remote server with Emacs / Tramp

一曲冷凌霜 提交于 2019-12-25 05:51:09
问题 I found a related thread that describes how to login to a remote server using sshpass : sshpass -p '<password>' <ssh/scp command> How can logging in with password be accomplished in Emacs / Tramp? I presently use the following and then enter the password manually: C-x C-f /ssh:user@server:/home/user/public_html/ I have the following function, that I access from my right-click context pop-up menu: (defun lawlist-remote-server-login () (interactive) (find-file "/ssh:user@server:/home/user

How to search for a complete org headline that was saved as a variable

寵の児 提交于 2019-12-25 01:46:47
问题 The function (org-heading-components) and (org-element-property) produce integers for the number of stars and also for the priority. I'd like to store the entire headline as a variable and then use re-search-forward (or a similar function) to go back to that heading, but I foresee the problem that will occur when it cannot find an integer. I need to store the whole heading as a variable, because I often have todo entries with duplicate titles but the other components are diferent. For example

the list inside a list of lisp tutorial

扶醉桌前 提交于 2019-12-25 00:17:24
问题 I am reading Programming in Emacs Lisp Here is another list, this time with a list inside of it: '(this list has (a list inside of it)) I am confused with the nested list, why it has not a prefix quoting as '(this list has '(a list inside of it)) if not has a prefix `, why it not parse the a as a function? 回答1: 's-expression is an abbreviation for (quote s-expression) : anything inside the s-expression is considered a datum and it is not evaluated. So, '(this list has (a list inside of it))

defaultcontent.el - @@LISP tag - read-closest-sexp?

青春壹個敷衍的年華 提交于 2019-12-24 18:22:51
问题 I started using defaultcontent.el to fill newly-created buffers with content. Apparently this module is not widely used. I think there are 3 people including me and the author who use it, because when I do a search on it, my published emacs.el comes up as the first hit. Despite that, I find it useful. I specify a template for each file type, and every time I create a new file of that type (or extension), it gets filled with the content in the template file. The template supports well-known

flush commands xemacs/elisp necessary?

大兔子大兔子 提交于 2019-12-24 17:19:41
问题 Im new to xemacs and linux in general, so consider me a newbie. And i was wondering if there is a reason why elisp wouldn't execute a command or commands instantly. I've the following code in my init.el: (defun myClear () "Clears console output buffer (F5)" (erase-buffer "*Shell Command Output*")) (defun myMake () "Executes make (F6)" (shell-command "make")) (defun myClearMake () "Clears console output buffer before executing make (F7)" (erase-buffer "*Shell Command Output*") (shell-command

If no blank lines preceding an outline heading `**`, then insert one blank line

孤者浪人 提交于 2019-12-24 15:15:15
问题 Could someone please give me a hand further defining my org outline cleanup function. I am looking to have one blank line between each outline heading beginning with ** , taking into consideration both possibilities -- i.e., there might be no blank lines (which means we need to insert one); and, there might be too many blank lines (which means we need to delete the extra ones). The situation with no blank lines (where we need to insert one) is what is missing from the function. The outline

How to test whether lines of text are greater than the window height

柔情痞子 提交于 2019-12-24 14:28:25
问题 I'd like to test, please, whether the lines of text in a no-file visiting buffer are greater than the window height -- if not, then (set-window-scroll-bars (get-buffer-window "*Org Agenda*" (selected-frame)) 0 nil) 回答1: You can test with this: (> (count-lines (point-min) (point-max)) (window-height)) 回答2: Comparing count-lines with window-height works in some cases but doesn't account for line-wrapping, images, and variable-sized fonts. Another approch is to check if window-end is before

Sync two windows

萝らか妹 提交于 2019-12-24 13:03:25
问题 I have this code that is "partially" working. I am trying to sync two windows, so regardless which window you are in the other will sync and start moving accordingly. The inconsistency I am seeing are around page boundaries; if you move the cursor in one window all the way down till you scroll one more into the next page then directly go up again one line you will notice that both windows will go out of sync. I tried debugging this with no luck. Not sure what is causing this weird behavior.

emacs lisp scripting optimization help request

狂风中的少年 提交于 2019-12-24 10:49:05
问题 I'm learning emacs lisp and I'm trying to script using it. I wrote a script and it works fine but I just think there are a lot of things I make in bash that I can do in emacs lisp instead. Big deal here: I'm not sure if my start-process works correct Please suggest / show me the lisp way of scripting on my script (as example) : #!/usr/bin/emacs --script (message "Vision synchronization \n") (let ((default-directory "/home/vision/")) (shell-command "git pull;") (princ (shell-command-to-string

Why does this elisp function to grab text from buffer not work

…衆ロ難τιáo~ 提交于 2019-12-24 10:48:17
问题 I have some text like this: qwerty\tberty merty\tserty I want to grab the text berty between the tab character and end of line. Then to show it worked goto the end of the buffer and insert the text there. But this code doesn't work. Any ideas why not? (defun do-test () "tester" (interactive) (goto-char (point-min)) (if (search-forward "qwerty" nil t) (delete-char 1) ;;delete tab (setq myStr (buffer-substring point end-of-line)) ;add text to variable ;goto end of buffer and insert text as