logo
down
shadow

Setting a directory using "system-name" on Elisp


Setting a directory using "system-name" on Elisp

Content Index :

Setting a directory using "system-name" on Elisp
Tag : emacs , By : Karina
Date : November 07 2020, 03:01 PM

should help you out Indeed, I'm not fluent when dealing with Elisp. Anyhow: I use the same Emacs config file, but as usual, there are small differences when I'm in home or in the office, I don't know if is possible to define my working dir with a code like this: ,
I don't know if is possible to define my working dir...
(if (string= system-name "hp-pavilion23")
    (setq my-dir "/home/manuel/entwicklung/lisp/")
  (setq my-dir "/home/mmontoya/projects/chipotle/"))

(setq default-directory my-dir)
;; Somewhere in your ~/.emacs
(if (string= system-name "hp-pavilion23")
    ;; Set default-directory here.
    (setq default-directory "/home/manuel/entwicklung/lisp/")
  (setq default-directory "/home/mmontoya/projects/chipotle/"))

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

Default setting for "Build Action" and "Copy to Output Directory"?


Tag : asp.net , By : vasil
Date : March 29 2020, 07:55 AM
I hope this helps you . I believe for Default.aspx the build Action shoud be Content and for Default.aspx.cs the build Action should be Compile.
Site.Master build action is Content but the Site.Master.cs is compile. Global.asax build action is Content but the Global.asax.cs is compile and finally web.config is content

Delphi 2007 - Systemwide Hot key is NOT "system-wide" if setting "MainFormOnTaskBar := True"


Tag : delphi , By : Justin Bowers
Date : March 29 2020, 07:55 AM
seems to work fine TApplication.MainFormOnTaskbar has no effect on system-wide hotkeys at all. I can positively confirm that. I am able to receive WM_HOTKEY messages regardless of what MainFormOnTaskbar is set to, regardless of whether the app is focused or not, etc. So whatever you are seeing is not what you think is happening.
Most likely, the Form's Handle is simply being recreated behind your back after you have called RegisterHotKey(), so you lose the HWND that would receive the WM_HOTKEY messages. Instead of using the OnCreate event, you should override the Form's CreateWindowHandle() and DestroyWindowHandle() methods instead to ensure the hot key is always registered for the Form's current HWND no matter what happens to it (you should always do that whenever you tie any kind of data to the Form's Handle), eg:
type
  TForm1 = class(TForm)
  private
    HotKey_xyz: WORD;
    procedure WMHotKey(var Message: TMessage); message WM_HOTKEY;
  protected
    procedure CreateWindowHandle(const Params: TCreateParams); override;
    procedure DestroyWindowHandle; override;
  end;

procedure TForm1.CreateWindowHandle(const Params: TCreateParams);
begin
  inherited;
  HotKey_xyz := GlobalAddAtom('Hotkey_xyz'); 
  if HotKey_xyz <> 0 then
    RegisterHotKey(Self.Handle, HotKey_xyz, MOD_CONTROL, VK_F12);
end;

procedure TForm1.DestroyWindowHandle(const Params: TCreateParams);
begin
  if HotKey_xyz <> 0 then
  begin
    UnregisterHotKey(Self.Handle, HotKey_xyz);
    GlobalDeleteAtom(HotKey_xyz);
    HotKey_xyz := 0;
  end;
  inherited;
end;

procedure TForm1.WMHotKey(var Message: TMessage);
begin
  ...
end;
type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    HotKey_xyz: WORD;
    HotKeyWnd: HWND;
    procedure HotKeyWndProc(var Message: TMessage);
  end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  HotKeyWnd := AllocateHwnd(HotKeyWndProc);
  HotKey_xyz := GlobalAddAtom('Hotkey_xyz'); 
  if HotKey_xyz <> 0 then
    RegisterHotKey(HotKeyWnd, HotKey_xyz, MOD_CONTROL, VK_F12);
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  if HotKey_xyz <> 0 then
  begin
    UnregisterHotKey(HotKeyWnd, HotKey_xyz);
    GlobalDeleteAtom(HotKey_xyz);
    HotKey_xyz := 0;
  end;
  if HotKeyWnd <> 0 then
  begin
    DeallocateHWnd(HotKeyWnd);
    HotKeyWnd := 0;
  end;
end;

procedure TForm1.HotKeyWndProc(var Message: TMessage);
begin
  if Message.Msg = WM_HOTKEY then
  begin
    ...
  end else
    Message.Result := DefWindowProc(HotKeyWnd, Message.Msg, Message.WParam, Message.LParam);
end;

Debugging "Error setting nil" in Elisp


Tag : emacs , By : Harvey
Date : March 29 2020, 07:55 AM
will help you I have this piece of Elisp code in my Emacs configuration file: , There's quite a lot wrong with that, I'm afraid.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.

Elisp suppress "Select coding system" when write buffer to file


Tag : emacs , By : RyanMcG
Date : March 29 2020, 07:55 AM
This might help you You should set coding-system-for-write, or buffer-file-coding-system instead of using set-language-environment.
PS. Generally speaking, you should use the lowest-level function possible in your code (e.g., help for next-line explicitly recommends that one use forward-line in code instead).

Setting "Override high DPI scaling" to "System (Enhanced)" programmatically or with a manifest (MinG


Tag : c , By : Daniel Halsey
Date : March 29 2020, 07:55 AM
help you fix your problem I tried all possible combinations of gdiScaling and dpiAware, still no luck. , Try this manifest:
<asmv3:application>
   <asmv3:windowsSettings>
        <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">false</dpiAware>
        <gdiScaling xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">true</gdiScaling>
   </asmv3:windowsSettings>
</asmv3:application>
#define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED    ((DPI_AWARENESS_CONTEXT)-5)
Related Posts Related QUESTIONS :
shadow
Privacy Policy - Terms - Contact Us © scrbit.com